Skip to content

Commit

Permalink
AZINTS-2562 Metric Filtering ARM templates
Browse files Browse the repository at this point in the history
  • Loading branch information
aishwarya-ddog committed Jul 5, 2024
1 parent 3e4a77c commit 0b30c40
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,23 @@
"type": "Microsoft.Common.CheckBox",
"label": "Collect Custom Metrics",
"toolTip": "This option will enable custom metric collection from all Application Insights instances within the scope of this configuration. These custom metrics will appear in datadog under the namespace <b>application_insights.custom.&lt;METRIC_NAME&gt;</b>.<br> Note that <a target='_blank' href='https://learn.microsoft.com/en-us/azure/azure-monitor/app/standard-metrics/'>Standard</a> App Insights metrics are collected automatically and are available under the <b>azure.insights_components.*</b> namespace."
},
{
"name": "excluded_resource_providers",
"type": "Microsoft.Common.TextBox",
"label": "Excluded Resource Providers",
"defaultValue": "",
"toolTip": "Comma-separated list of Microsoft Resource Provider names to be excluded from metrics collection.",
"constraints": {
"required": false
},
"visible": true
}
],
"visible": true
},
{
"name": "resourceCollection",
"name": "resource,Collection",
"type": "Microsoft.Common.Section",
"label": "Resource Collection",
"elements": [
Expand Down Expand Up @@ -335,7 +346,8 @@
"automute": "[steps('datadogConfig').metrics.automute]",
"custom_metrics_enabled": "[steps('datadogConfig').metrics.custom_metrics_enabled]",
"resource_collection_enabled": "[steps('datadogConfig').resourceCollection.resource_collection_enabled]",
"cspm_enabled": "[and(steps('datadogConfig').resourceCollection.cspm_enabled, steps('datadogConfig').resourceCollection.resource_collection_enabled)]"
"cspm_enabled": "[and(steps('datadogConfig').resourceCollection.cspm_enabled, steps('datadogConfig').resourceCollection.resource_collection_enabled)]",
"excluded_resource_providers": "[steps('datadogConfig').metrics.excluded_resource_providers]"
}
}
}
14 changes: 13 additions & 1 deletion azure/deploy-to-azure/azure-integration/CreateUIDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,17 @@
"type": "Microsoft.Common.CheckBox",
"label": "Collect Custom Metrics",
"toolTip": "This option will enable custom metric collection from all Application Insights instances within the scope of this configuration. These custom metrics will appear in datadog under the namespace <b>application_insights.custom.&lt;METRIC_NAME&gt;</b>.<br> Note that <a target='_blank' href='https://learn.microsoft.com/en-us/azure/azure-monitor/app/standard-metrics/'>Standard</a> App Insights metrics are collected automatically and are available under the <b>azure.insights_components.*</b> namespace."
},
{
"name": "excluded_resource_providers",
"type": "Microsoft.Common.TextBox",
"label": "Excluded Resource Providers",
"defaultValue": "",
"toolTip": "Comma-separated list of Microsoft Resource Provider names to be excluded from metrics collection.",
"constraints": {
"required": false
},
"visible": true
}
],
"visible": true
Expand Down Expand Up @@ -310,7 +321,8 @@
"automute": "[steps('datadogConfig').integrationConfig.automute]",
"custom_metrics_enabled": "[steps('datadogConfig').integrationConfig.custom_metrics_enabled]",
"resource_collection_enabled": "[steps('datadogConfig').resourceCollection.resource_collection_enabled]",
"cspm_enabled": "[and(steps('datadogConfig').resourceCollection.cspm_enabled, steps('datadogConfig').resourceCollection.resource_collection_enabled)]"
"cspm_enabled": "[and(steps('datadogConfig').resourceCollection.cspm_enabled, steps('datadogConfig').resourceCollection.resource_collection_enabled)]",
"excluded_resource_providers": "[steps('datadogConfig').metrics.excluded_resource_providers]"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@
"description": "Whether or not to use custom metrics"
}
},
"excluded_resource_providers": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "List of Microsoft Resource Provider names to be excluded from metrics collection."
}
},
"datadogSite": {
"defaultValue": "datadoghq.com",
"type": "string",
Expand Down Expand Up @@ -183,6 +190,9 @@
"custom_metrics_enabled": {
"value": "[parameters('custom_metrics_enabled')]"
},
"excluded_resource_providers": {
"value": "[parameters('excluded_resource_providers')]"
},
"datadogSite": {
"value": "[parameters('datadogSite')]"
},
Expand Down Expand Up @@ -236,6 +246,9 @@
"custom_metrics_enabled": {
"type": "bool"
},
"excluded_resource_providers": {
"type": "array"
},
"datadogSite": {
"type": "String"
},
Expand Down Expand Up @@ -291,6 +304,10 @@
"name": "custom_metrics_enabled",
"value": "[parameters('custom_metrics_enabled')]"
},
{
"name": "excluded_resource_providers",
"value": "[parameters('excluded_resource_providers')]"
},
{
"name": "datadogSite",
"value": "[parameters('datadogSite')]"
Expand All @@ -313,7 +330,7 @@
"containerSettings": {},
"cleanupPreference": "Always",
"azPowerShellVersion": "8.1",
"scriptContent": "Invoke-WebRequest -SkipCertificateCheck -ContentType \"application/json\" -Method Post -Uri \"https://api.$Env:datadogSite/api/v1/integration/azure\" -Headers @{\"Accept\"=\"application/json\"; \"DD-APPLICATION-KEY\"=$Env:datadogApplicationKey; \"DD-API-KEY\"=$Env:datadogApiKey} -Body (@{\"automute\"=[bool]::Parse($Env:automute); \"resource_collection_enabled\"=[bool]::Parse($Env:resource_collection_enabled); \"cspm_enabled\"=[bool]::Parse($Env:cspm_enabled); \"custom_metrics_enabled\"=[bool]::Parse($Env:custom_metrics_enabled); \"client_id\"=$Env:clientId; \"client_secret\"=$Env:clientSecret; \"tenant_name\"=$Env:tenantName; \"source\"=$Env:source; \"management_group_id\"=$Env:managementGroupId} | ConvertTo-Json )"
"scriptContent": "Invoke-WebRequest -SkipCertificateCheck -ContentType \"application/json\" -Method Post -Uri \"https://api.$Env:datadogSite/api/v1/integration/azure\" -Headers @{\"Accept\"=\"application/json\"; \"DD-APPLICATION-KEY\"=$Env:datadogApplicationKey; \"DD-API-KEY\"=$Env:datadogApiKey} -Body (@{\"automute\"=[bool]::Parse($Env:automute); \"resource_collection_enabled\"=[bool]::Parse($Env:resource_collection_enabled); \"cspm_enabled\"=[bool]::Parse($Env:cspm_enabled); \"custom_metrics_enabled\"=[bool]::Parse($Env:custom_metrics_enabled); \"client_id\"=$Env:clientId; \"client_secret\"=$Env:clientSecret; \"tenant_name\"=$Env:tenantName; \"source\"=$Env:source; \"management_group_id\"=$Env:managementGroupId; \"metrics_config\"=@{ \"excluded_resource_providers\" = $Env:excluded_resource_providers}} | ConvertTo-Json )"
}
},
{
Expand Down
13 changes: 12 additions & 1 deletion azure/deploy-to-azure/azure-integration/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@
"description": "Whether or not to use custom metrics"
}
},
"excluded_resource_providers": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "List of Microsoft Resource Provider names to be excluded from metrics collection."
}
},
"datadogSite": {
"type": "String",
"defaultValue": "datadoghq.com",
Expand Down Expand Up @@ -213,6 +220,10 @@
"name": "custom_metrics_enabled",
"value": "[parameters('custom_metrics_enabled')]"
},
{
"name": "excluded_resource_providers",
"value": "[parameters('excluded_resource_providers')]"
},
{
"name": "datadogSite",
"value": "[parameters('datadogSite')]"
Expand All @@ -231,7 +242,7 @@
"containerSettings": {},
"cleanupPreference": "Always",
"azPowerShellVersion": "8.1",
"scriptContent": "Invoke-WebRequest -SkipCertificateCheck -ContentType \"application/json\" -Method Post -Uri \"https://api.$Env:datadogSite/api/v1/integration/azure\" -Headers @{\"Accept\"=\"application/json\"; \"DD-APPLICATION-KEY\"=$Env:datadogApplicationKey; \"DD-API-KEY\"=$Env:datadogApiKey} -Body (@{\"automute\"=[bool]::Parse($Env:automute); \"resource_collection_enabled\"=[bool]::Parse($Env:resource_collection_enabled); \"cspm_enabled\"=[bool]::Parse($Env:cspm_enabled); \"custom_metrics_enabled\"=[bool]::Parse($Env:custom_metrics_enabled); \"client_id\"=$Env:clientId; \"client_secret\"=$Env:clientSecret; \"tenant_name\"=$Env:tenantName; \"source\"=$Env:source; \"subscription_count\"=[int]::Parse($Env:subscription_count)} | ConvertTo-Json )"
"scriptContent": "Invoke-WebRequest -SkipCertificateCheck -ContentType \"application/json\" -Method Post -Uri \"https://api.$Env:datadogSite/api/v1/integration/azure\" -Headers @{\"Accept\"=\"application/json\"; \"DD-APPLICATION-KEY\"=$Env:datadogApplicationKey; \"DD-API-KEY\"=$Env:datadogApiKey} -Body (@{\"automute\"=[bool]::Parse($Env:automute); \"resource_collection_enabled\"=[bool]::Parse($Env:resource_collection_enabled); \"cspm_enabled\"=[bool]::Parse($Env:cspm_enabled); \"custom_metrics_enabled\"=[bool]::Parse($Env:custom_metrics_enabled); \"client_id\"=$Env:clientId; \"client_secret\"=$Env:clientSecret; \"tenant_name\"=$Env:tenantName; \"source\"=$Env:source; \"subscription_count\"=[int]::Parse($Env:subscription_count); \"metrics_config\"=@{ \"excluded_resource_providers\" = $Env:excluded_resource_providers}} | ConvertTo-Json )"
}
},
{
Expand Down

0 comments on commit 0b30c40

Please sign in to comment.