azure-monitor-exporter
⭐ Don't forget to star this repository! ⭐
About
azure-monitor-exporter is a Prometheus exporter for Azure Monitor. It collects metrics from Azure Monitor and exposes
them in a format that Prometheus can scrape.
Features
Authentication
azure-monitor-exporter supports all authentication supported by Azure SDK for Go.
Service principal with a secret
Variable name |
Value |
AZURE_CLIENT_ID |
Application ID of an Azure service principal |
AZURE_TENANT_ID |
ID of the application's Azure AD tenant |
AZURE_CLIENT_SECRET |
Password of the Azure service principal |
Service principal with certificate
Variable name |
Value |
AZURE_CLIENT_ID |
Application ID of an Azure service principal |
AZURE_TENANT_ID |
ID of the application's Azure AD tenant |
AZURE_CLIENT_CERTIFICATE_PATH |
Path to a certificate file including private key (without password protection) |
Use a managed identity
Variable name |
Value |
AZURE_CLIENT_ID |
User-assigned managed client id. Can be avoid, if a system assign identity is used |
AZURE_TENANT_ID |
ID of the application's Azure AD tenant |
Use a workload identity
Refer to the workload identity documentation for more information.
Probe Configuration
HTTP endpoint: /probe
The probe configuration is done via the HTTP GET parameters. The following parameters are supported:
Parameter name |
Format |
Description |
Default |
resourceType |
single string |
resource type of resources to scrape |
none (required value) |
metricName |
single string |
metric names to scrape |
none (required value) |
query |
single string |
kusto query used against ResourceGraph to get target resources |
Resources |
subscriptionID |
comma separated string or multiple values |
SubscriptionIDs in scope |
all accessible |
aggregation |
comma separated string or multiple values |
Azure Monitor metric aggregation value (minimum, maximum, average, total, count, multiple possible separated with ,) |
all available |
interval |
ISO 8601 time interval |
Azure Monitor metric interval |
none |
timespan |
ISO 8601 time interval |
Azure Monitor metric timespan |
1 hour |
filter |
single string |
Azure Monitor metric filter |
none |
To identify the correct metricName
, you can use the Azure documentation and search for Name in REST API
.
Prometheus configuration examples
Redis
Click to expand
- job_name: azure-metrics-redis
scrape_interval: 1m
metrics_path: /probe
params:
resourceType:
- Microsoft.Cache/Redis"
metricName:
- connectedclients
- totalcommandsprocessed
- cachehits
- cachemisses
- getcommands
- setcommands
- operationsPerSecond
- evictedkeys
- totalkeys
- expiredkeys
- usedmemory
- usedmemorypercentage
- usedmemoryRss
- serverLoad
- cacheWrite
- cacheRead
- percentProcessorTime
- cacheLatency
- errors
interval: ["PT1M"]
timespan: ["PT1M"]
aggregation:
- average
- total
static_configs:
- targets: ["azure-metrics-exporter:8080"]