Plugins 〉Azure Monitor Managed Service for Prometheus


Developer

Grafana Labs

Sign up to receive occasional product news and updates:


Grafana Cloud
Grafana Cloud
  • Grafana, of course
  • 10k series Prometheus metrics
  • 50 GB logs
  • 50 GB traces
  • 2,232 app o11y host hours
  • ...and more
Create free account

No credit card needed, ever.


Data Source
grafana

Azure Monitor Managed Service for Prometheus

  • Overview
  • Installation
  • Change log
  • Related content

Compatibility

Azure Monitor Managed Service for Prometheus is not compatible with Grafana<11.5.0 If you are running version 11.4.x and lower, please use plugin the core Prometheus plugin instead.

Azure Monitor Managed Service for Prometheus Data Source

Azure Monitor Managed Service for Prometheus is a Prometheus-compatible service that monitors and provides alerts on containerized applications and infrastructure at scale.

Read more about it here: Azure Monitor and Prometheus

Add the data source

To configure Azure authentication see Configure Azure Active Directory (AD) authentication.

In Grafana Enterprise, update the .ini configuration file: Configure Grafana. Depending on your setup, the .ini file is located here. Add the following setting in the [auth] section :

[auth]
azure_auth_enabled = true

Note

If you are using Azure authentication settings do not enable Forward OAuth identity. Both use the same HTTP authorization headers. Azure settings will get overwritten by the OAuth token.

Migrate from core Prometheus to Azure Monitor Managed Service for Prometheus plugin

Azure AD authentication is deprecated in the core Prometheus plugin. You will need to do the following to migrate your Prometheus plugin using Azure AD to the Azure Monitor Managed Service for Prometheus plugin.

  1. Get the UID for Prometheus using Azure Authentication and get the UID for your new Azure Monitor Managed Service for Prometheus.

    • Navigate to the configuration page for your new data source.
    • Find the UID in the url.
      • Example: “connections/datasources/edit/<DATA SOURCE UID>”
    • Copy the UID for both the old and new data sources.
      • "<Prom AD UID>"
      • "<AMP UID>"
  2. Update dashboards with the new datasource UID

    • Navigate to the dashboard that contains your old Prometheus data source.
    • Click on Dashboard settings.
    • Select the JSON model in the tabs.
    • Search for the "<Prom AD UID>".
      • Example: "uid": "<Prom AD UID>"
      • Change the UID to <AMP UID>
      • Change the type to grafana-azureprometheus-datasource (the old type is prometheus)
      • Example for changing type and UID:
        "type": "prometheus",
        "uid": "<Prom AD UID>"
      

      // can be change to

      “type”: “grafana-azureprometheus-datasource”, “uid”: “<AMP UID>”

    • Confirm the "datasource" change for all of the following categories in the JSON model.
      • annotations
      • panels
      • targets
      • templating
    • Click “Save changes” in the bottom left side of the JSON model UI.

Save your dashboard.

  1. Update alert rules by exporting provisioning files and updating the data source in the model or create new alert rules.

    • Alert rule data sources cannot be changed without wiping out the query.
    • There are two ways to migrate alert rules.
      • First, edit the rule by exporting to a provisioned file documentation here.
        • Navigate to the Alert rules page.
        • Identify the alert rule that uses the Prom AD data source.
        • Select “Export rule.”
        • Export the rule in your choice of JSON, YAML or Terraform.
        • Search the exported rule for the "<Prom AD UID>".
        • Change the UID and the type in the exported rule.
        "type": "prometheus",
        "uid": "<Prom AD UID>"
      

      // can be change to

      “type”: “grafana-azureprometheus-datasource”, “uid”: “<AMP UID>”

      • Rename the rule and update the name field in the exported rule.
      • Delete the old rule.
      • OR second, Create a new alert rule documentation here.
        • Copy the fields from the Prom AD rule.
        • Create a new alert rule and select your AMP data source.
        • Add the fields from the old rule to the new rule.
        • Delete the old rule.
  2. Recreate correlations that are using your old Prometheus data source using your new Prometheus data source.

    • Create a new correlation, see documentation here.
    • Identify the correlation that uses the old Prom AD data source.
    • Copy the fields from your correlation.
    • Create a brand new correlation using the new AMP data source.
    • Add the fields from the old correlation to the new correlation.
    • Delete the old correlation.
  3. Recreate recorded queries that are using your old Prometheus data source using your new Prometheus data source.

    • Only available in Grafana Enterprise and Grafana Cloud.
    • Create a new recorded query, see documentation here.
    • Identify the recorded query that uses the old Prom AD data source.
    • Copy the fields from your recorded query.
    • Create a brand new recorded query using the new AMP data source.
    • Add the fields from the old recorded query to the new recorded query.
    • Delete the old recorded query.

Installing Azure Monitor Managed Service for Prometheus on Grafana Cloud:

For more information, visit the docs on plugin installation.

Installing on a local Grafana:

For local instances, plugins are installed and updated via a simple CLI command. Plugins are not updated automatically, however you will be notified when updates are available right within your Grafana.

1. Install the Data Source

Use the grafana-cli tool to install Azure Monitor Managed Service for Prometheus from the commandline:

grafana-cli plugins install 

The plugin will be installed into your grafana plugins directory; the default is /var/lib/grafana/plugins. More information on the cli tool.

2. Configure the Data Source

Accessed from the Grafana main menu, newly installed data sources can be added immediately within the Data Sources section.

Next, click the Add data source button in the upper right. The data source will be available for selection in the Type select box.

To see a list of installed data sources, click the Plugins item in the main menu. Both core data sources and installed data sources will appear.

Changelog

0.0.3-preview

  • Data source name changed to Azure Monitor Managed Service for Prometheus

0.0.2-preview

  • Added migration documentation.
  • Release to the Grafana plugin catalog.

0.0.1-preview

  • Initial release.