Menu
Grafana Cloud

Configure Azure Metrics

Complete the following steps to configure Azure Metrics as shown in the following diagram.

Installation steps for Azure Metrics
Installation steps for Azure Metrics

Select your platform

Select the platform from the drop-down menu.

Install Grafana Alloy

Grafana Alloy includes an embedded exporter to gather and send metrics to Grafana Cloud.

  1. If you have not already installed Alloy where you intend to run Azure Metrics, click Run Grafana Alloy.
  2. At the Alloy configuration screen, either create a token or use an existing token.
    1. To create a token, enter a token name, then click Create token. The token displays on the screen and is added to the command for running Alloy. Copy the command and paste it into the terminal.
    2. To use an existing token, paste it into the token field, then click Proceed to install integration.
  3. Copy the command and paste it into the terminal.
  4. Click Proceed to install integration.

Set up Azure Metrics

Configure authentication with Azure.

  1. Click Setup instructions.

  2. At the Configure authentication with Azure screen, follow the information and links to enable read access and permissions for Alloy. Grafana Alloy needs these Azure credentials:

    • Read access to the resources to be queried by Resource Graph
    • Permissions to call the Microsoft.Insights Metrics API, which should be the Microsoft.Insights/Metrics/Read permission

    Grafana Alloy uses:

  3. Click Close to close the authentication instruction screen and return to the next set step.

Configure Alloy

Set up Grafana Alloy to get metrics from Azure Metrics.

  1. Navigate to the configuration file for your Alloy instance.

  2. Copy and append the following to your Alloy configuration file so that Grafana Alloy can scrape your Azure Metrics instances. The prometheus.exporter.azure component generates metrics from the Azure Metrics instance.

     prometheus.exporter.azure "integrations_azure_exporter" {
       subscriptions = ["<subscription_id>"]
       resource_type = "<resource_type>"
       metrics       = ["<metric>"]
       regions       = ["<region>"]
     }
    
     prometheus.scrape "integrations_azure_exporter" {
       targets    = prometheus.exporter.azure.integrations_azure_exporter.targets
       forward_to = [prometheus.remote_write.metrics_service.receiver]
       job_name   = "integrations/azure_exporter"
     }
  3. Find the value for these properties in Azure and replace them with the required appropriate values in your Alloy configuration file:

    PropertyValue (required)
    subscriptionsThe Azure subscription you want to scrape metrics from. If you need to scrape multiple Azure services, create one exporter for each service.
    resource_typeThe Azure Resource Type you want to scrape metrics from. Find valid values as the heading on Supported Metrics with Azure Monitor. For example: Microsoft.Cache/redis or Microsoft.ContainerService/managedClusters.
    metricsThe metrics to scrape from resources. Find valid values in the Metric column for the resource_type on Supported Metrics with Azure Monitor. For example: node_cpu_usage_millicores for the Microsoft.ContainerService/managedClusters resource type.
    regionsA list of Azure region name strings. With this field, metrics can be gathered for all resources in the subscription from each region listed and bypass Resource Graph. Cannot be used when resource_graph_query_filter is used.
  4. Click Optional properties to add more optional properties.

    PropertyValue (optional)
    included_dimensionsIncludes Dimensions available to a Metric definition on Supported Metrics with Azure Monitor. For example: node and nodepool in the node_cpu_usage_millicores metric, for the resource type of Microsoft.ContainerService/managedClusters.
    included_resource_tagsA list of resource tags to include on the final metrics For example, node.
    resource_graph_query_filterA string containing a Kusto query to further filter data from the resource graph API. Cannot be used when regions is used.

Restart Grafana Alloy

Run the command appropriate for your platform to restart Grafana Alloy so your changes can take effect.

Test connection

Click Test connection to test that Grafana Alloy is collecting data and sending it to Grafana Cloud.

View your dashboards

Azure Metrics comes with prebuilt dashboards to get you up and running quickly.