Work in progress
Azure metrics exporter for Prometheus.
Allows for the exporting of metrics from Azure applications using the Azure monitor API.
Note that Azure imposes a 15,000 API read limit so the number of metrics you're querying for should be proportional to your scrape interval.
In order to get all the metric definitions for the resources specified in your configuration file, run the following:
./Azure-metrics-exporter --list.definitions
This will print your resource id's application/service name along with a list of each of the available metric definitions that you can query for for that resource.
azure_resource_id and subscription_id can be found under properties in the Azure portal for your application/service.
tenant_id is found under Azure Active Directory > Properties and is listed as Directory ID.
The client_id and client_secret are obtained by registering an application under 'Azure Active Directory'.
client_id is the application_id of your application and the client_secret is generated by selecting your application/service under Azure Active Directory, selecting 'keys', and generating a new key.
Then for the resource group your application is apart of, create a new IAM reader role for the created app under 'Azure Active Directory'.
credentials:
subscription_id: <secret>
client_id: <secret>
client_secret: <secret>
tenant_id: <secret>
targets:
- resource: "azure_resource_id"
metrics:
- name: "BytesReceived"
- name: "BytesSent"
- resource: "azure_resource_id"
metrics:
- name: "Http2xx"
- name: "Http5xx"
global:
scrape_interval: 60s # Set a high scrape_interval either globally or per-job to avoid hitting Azure Monitor API limits.
scrape_configs:
- job_name: azure
static_configs:
- targets: ['localhost:9276']