Azure Monitor Receiver
This receiver scrapes Azure Monitor API for resources metrics.
Configuration
The following settings are required:
The following settings are optional:
auth
(default = service_principal): Specifies the used authentication method. Supported values are service_principal
, workload_identity
, managed_identity
, default_credentials
.
resource_groups
(default = none): Filter metrics for specific resource groups, not setting a value will scrape metrics for all resources in the subscription.
services
(default = none): Filter metrics for specific services, not setting a value will scrape metrics for all services integrated with Azure Monitor.
cache_resources
(default = 86400): List of resources will be cached for the provided amount of time in seconds.
cache_resources_definitions
(default = 86400): List of metrics definitions will be cached for the provided amount of time in seconds.
maximum_number_of_metrics_in_a_call
(default = 20): Maximum number of metrics to fetch in per API call, current limit in Azure is 20 (as of 03/27/2023).
maximum_number_of_records_per_resource
(default = 10): Maximum number of records to fetch per resource.
initial_delay
(default = 1s
): defines how long this receiver waits before starting.
cloud
(default = AzureCloud
): defines which Azure cloud to use. Valid values: AzureCloud
, AzureUSGovernment
, AzureChinaCloud
.
Authenticating using service principal requires following additional settings:
tenant_id
client_id
client_secret
Authenticating using workload identities requires following additional settings:
tenant_id
client_id
federate_token_file
Authenticating using managed identities has the following optional settings:
Example Configurations
Using Service Principal for authentication:
receivers:
azuremonitor:
subscription_id: "${subscription_id}"
tenant_id: "${tenant_id}"
client_id: "${client_id}"
client_secret: "${env:CLIENT_SECRET}"
cloud: AzureUSGovernment
resource_groups:
- "${resource_group1}"
- "${resource_group2}"
services:
- "${service1}"
- "${service2}"
collection_interval: 60s
initial_delay: 1s
Using Azure Workload Identity for authentication:
receivers:
azuremonitor:
subscription_id: "${subscription_id}"
auth: "workload_identity"
tenant_id: "${env:AZURE_TENANT_ID}"
client_id: "${env:AZURE_CLIENT_ID}"
federated_token_file: "${env:AZURE_FEDERATED_TOKEN_FILE}"
Using Managed Identity for authentication:
receivers:
azuremonitor:
subscription_id: "${subscription_id}"
auth: "managed_identity"
client_id: "${env:AZURE_CLIENT_ID}"
Using Environment Variables for authentication:
receivers:
azuremonitor:
subscription_id: "${subscription_id}"
auth: "default_credentials"
Metrics
Details about the metrics scraped by this receiver can be found in Supported metrics with Azure Monitor. This receiver adds the prefix "azure_" to all scraped metrics.