All the Azure Monitor metrics that need to be scraped are consolidated in one YAML file. This configuration defines the Azure metadata and all the metrics.
General Declaration
As Promitor evolves we need to change the structure of our metrics declaration.
version: {version} - [REQUIRED] Version of declaration that is used. Allowed
values are v1.
Azure
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.azureMetadata.cloud- The name of the Azure cloud to use. Options areGlobal(default),China,UsGov&Germany.
Metric Defaults
metricDefaults.scraping.schedule- [REQUIRED] A cron expression that controls the frequency of 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. a cron that fits your needs.
Metrics
Every metric that is being declared needs to define the following fields:
name- Name of the metric that will be reported.description- Description for the metric that will be reported.resourceType- Defines what type of resource needs to be queried.azureMetricConfiguration.metricName- The name of the metric in Azure Monitor to queryazureMetricConfiguration.aggregation.type- The aggregation that needs to be used when querying Azure MonitorazureMetricConfiguration.aggregation.interval- Overrides the default aggregation interval defined inmetricDefaults.aggregation.intervalwith a new intervalresources- An array of one or more resources to get metrics for. The fields required vary depending on theresourceTypebeing created, and are documented for each resource.
All resources provide the capability to override the default Azure metadata:
subscriptionId- Changes the subscription id to which the resource belongs. (OverridesazureMetadata.subscriptionId)resourceGroupName- Changes the resource group that contains resource. (OverridesazureMetadata.resourceGroupName)
Additionally, the following fields are optional:
azureMetricConfiguration.dimension.Name- The name of the dimension that should be used to scrape a multi-dimensional metric in Azure Monitor.- ☝ Promitor simply acts as a proxy and will not validate if it’s supported or not, we recommend verifying that the dimension is supported in the official documentation
 
labels- Defines a set of custom labels to include for a given metric.scraping.schedule- A scraping schedule for the individual metric; overrides the the one specified inmetricDefaults
Example
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:
version: v1
azureMetadata:
  tenantId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  subscriptionId: yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
  resourceGroupName: promitor
  cloud: China
metricDefaults:
  aggregation:
    interval: 00:05:00
  scraping:
    # Every minute
    schedule: "0 * * ? * *"
  labels:
    geo: china
    environment: dev
metrics:
  - name: azure_service_bus_active_messages
    description: "The number of active messages on a service bus queue."
    resourceType: ServiceBusQueue
    labels:
      app: promitor
      tier: messaging
    scraping:
      # Every 2 minutes
      schedule: "0 */2 * ? * *"
    azureMetricConfiguration:
      metricName: ActiveMessages
      dimension:
        name: <dimension-name>
      aggregation:
        type: Total
        interval: 00:15:00
    resources:
      - namespace: promitor-messaging
        queueName: orders
      - namespace: promitor-messaging-dev
        queueName: orders
        resourceGroupName: promitor-dev
        subscriptionId: ABC
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 API Management
 - Azure App Plan
 - Azure Cache for Redis
 - Azure Container Instances
 - Azure Container Registry
 - Azure Cosmos DB
 - Azure Database for PostgreSQL
 - Azure Function App
 - Azure IoT Hub
 - Azure IoT Hub Device Provisioning Service (DPS)
 - Azure Key Vault
 - Azure Network Interface
 - Azure Service Bus Queue
 - Azure SQL Database
 - Azure SQL Managed Instance
 - Azure SQL Server
 - Azure Storage (Account)
 - Azure Storage (Blob)
 - Azure Storage (Files)
 - Azure Storage (Queue)
 - Azure Virtual Machine
 - Azure Virtual Machine Scale Set (VMSS)
 - Azure Web App
 
Want to help out? Create an issue and contribute a new scraper.