All the Azure Monitor metrics that needs to be scraped are consolidated in one YAML file. This configuration defines the Azure metadata and all the metrics.
azureMetadata.tenantId- The id of the Azure tenant that will be queried.
azureMetadata.subscriptionId- The id of the default subscription to query.
azureMetadata.resourceGroupName- The name of the default resource group to query.
metricDefaults.scraping.schedule- [REQUIRED] A cron expression that controls the fequency in which all the configured metrics will be scraped from Azure Monitor. You can use crontab-generator.org to generate a cron that fits your needs.
metricDefaults.aggregation.interval- The default interval which defines over what period measurements of a metric should be aggregated.
Every metric that is being declared needs to define the following fields:
name- Name of the metric that will be exposed in the scrape endpoint for Prometheus
description- Description for the metric that will be exposed in the scrape endpoint for Prometheus
resourceType- Defines what type of resource needs to be queried.
azureMetricConfiguration.metricName- The name of the metric in Azure Monitor to query
azureMetricConfiguration.aggregation.type- The aggregation that needs to be used when querying Azure Monitor
azureMetricConfiguration.aggregation.interval- Overrides the default aggregation interval defined in
metricDefaults.aggregation.intervalwith a new interval
Additionally, the following fields are optional:
resourceGroupName- The resource group to scrape for this metric. This allows you to specify a different resource group from the one configured in
azureMetadata, enabling you to scrape multiple resource groups with one single configuration.
scraping.schedule- A scraping schedule for the individual metric; overrides the the one specified in
Here is an example of how you can scrape two Azure Service Bus queues in different resource groups, one in the
promitor resource group and one on the
promitor-dev resource group:
azureMetadata: tenantId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx subscriptionId: yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy resourceGroupName: promitor metricDefaults: aggregation: interval: 00:05:00 scraping: # Every minute schedule: "0 * * ? * *" metrics: - name: demo_queue_size description: "Amount of active messages of the 'myqueue' queue" resourceType: ServiceBusQueue namespace: promitor-messaging queueName: orders scraping: # Every 2 minutes schedule: "0 */2 * ? * *" azureMetricConfiguration: metricName: ActiveMessages aggregation: type: Total interval: 00:15:00 - name: demo_queue_dev_size description: "Amount of active messages of the 'myqueue-dev' queue" resourceType: ServiceBusQueue namespace: promitor-messaging-dev queueName: orders resourceGroupName: promitor-dev azureMetricConfiguration: metricName: ActiveMessages aggregation: type: Total interval: 00:15:00
Supported Azure Services
Generic Azure Resource allows you to scrape every Azure service supported by Azure Monitor.
We also provide a simplified way to scrape the following Azure resources:
- Azure Container Instances
- Azure Container Registry
- Azure Service Bus Queue
- Azure Network Interface
- Azure Virtual Machine
- Azure Storage Queue
- Azure Cosmos DB
Want to help out? Create an issue and contribute a new scraper.