Caution
Grafana Alloy is the new name for our distribution of the OTel collector. Grafana Agent has been deprecated and is in Long-Term Support (LTS) through October 31, 2025. Grafana Agent will reach an End-of-Life (EOL) on November 1, 2025. Read more about why we recommend migrating to Grafana Alloy.
azure_exporter_config
Overview
The azure_exporter_config
block configures the azure_exporter
integration, an embedded version of
azure-metrics-exporter
, used to
collect metrics from Azure Monitor.
The exporter offers the following two options for gathering metrics.
- (Default) Use an Azure Resource Graph query to identify resources for gathering metrics.
- This query will make one API call per resource identified.
- Subscriptions with a reasonable amount of resources can hit the 12000 requests per hour rate limit Azure enforces.
- Set the regions to gather metrics from and get metrics for all resources across those regions.
- This option will make one API call per subscription, dramatically reducing the number of API calls.
- This approach does not work with all resource types, and Azure does not document which resource types do or do not work.
- A resource type that is not supported produces errors that look like
Resource type: microsoft.containerservice/managedclusters not enabled for Cross Resource metrics
. - If you encounter one of these errors you must use the default Azure Resource Graph based option to gather metrics.
List of Supported Services and Metrics
The exporter supports all metrics defined by Azure Monitor. The complete list of available metrics can be found in the Azure Monitor documentation.
Metrics for this integration are exposed with the template azure_{type}_{metric}_{aggregation}_{unit}
. As an example,
the Egress metric for BlobService would be exported as azure_microsoft_storage_storageaccounts_blobservices_egress_total_bytes
.
Authentication
The agent must be running in an environment with access to Azure. The exporter uses the Azure SDK for go and supports authentication via https://learn.microsoft.com/en-us/azure/developer/go/azure-sdk-authentication?tabs=bash#2-authenticate-with-azure.
The account used by Grafana Agent needs:
- Read access to the resources that will be queried by Resource Graph
- Permissions to call the Microsoft.Insights Metrics API which should be the
Microsoft.Insights/Metrics/Read
permission
Configuration
Config Reference
Examples
Azure Kubernetes Service Node Metrics
azure_exporter:
enabled: true
scrape_interval: 60s
subscriptions:
- <subscription_id>
resource_type: microsoft.containerservice/managedclusters
metrics:
- node_cpu_usage_millicores
- node_cpu_usage_percentage
- node_disk_usage_bytes
- node_disk_usage_percentage
- node_memory_rss_bytes
- node_memory_rss_percentage
- node_memory_working_set_bytes
- node_memory_working_set_percentage
- node_network_in_bytes
- node_network_out_bytes
included_resource_tags:
- environment
included_dimensions:
- node
- nodepool
- device
Blob Storage Metrics
azure_exporter:
enabled: true
scrape_interval: 60s
subscriptions:
- <subscription_id>
resource_type: Microsoft.Storage/storageAccounts
metric_namespace: Microsoft.Storage/storageAccounts/blobServices
regions:
- westeurope
metrics:
- Availability
- BlobCapacity
- BlobCount
- ContainerCount
- Egress
- IndexCapacity
- Ingress
- SuccessE2ELatency
- SuccessServerLatency
- Transactions
included_dimensions:
- ApiName
- TransactionType
timespan: PT1H
Multiple Azure Services in a single config
The Azure Metrics API has rather strict limitations on the number of parameters which can be supplied. Due to this, you cannot
gather metrics from multiple resource_types
in the same azure_exporter
instance. If you need metrics from multiple resources,
you can enable integration-next
or configure Agent to expose the exporter via the azure_exporter
config with data configured through metrics scrape_configs. The following example configuration combines the two examples above in a single Agent configuration.
Note: This is not a complete configuration; blocks have been removed for simplicity.
In this example, all azure_exporter
-specific configuration settings have been moved to the scrape_config
. This method supports all available configuration options except azure_cloud_environment
, which must be configured on the azure_exporter
. For this method, if a field supports a singular value like resource_graph_query_filter
, you
must be put it into an array, for example, resource_graph_query_filter: ["where location == 'westeurope'"]
.