Alerting: Support AWS and Azure Managed Prometheus data sources in alert rule import/conversion
#123144 opened on Apr 21, 2026
Description
Summary
When importing/converting data-source-managed Prometheus alert rules to Grafana-managed alert rules, the conversion fails if the selected data source is AWS Managed Prometheus (grafana-amazonprometheus-datasource) or Azure Managed Prometheus (grafana-azureprometheus-datasource). Only native prometheus and loki types are currently accepted by the converter.
Steps to Reproduce
- Have an AWS Managed Prometheus or Azure Managed Prometheus data source configured.
- Navigate to Alerting → Alert rules and use the import/convert feature (data-source-managed → Grafana-managed).
- Select the AWS or Azure Prometheus data source.
- Attempt to import a valid Prometheus rules YAML.
Expected Behavior
The import should succeed. AWS Managed Prometheus and Azure Managed Prometheus are Prometheus-compatible data sources and their rule format is identical to native Prometheus. The converter should recognize and support them.
Actual Behavior
The conversion fails with:
Failed to create Prometheus converter
error="[alerting.invalidDatasourceType] invalid datasource type: grafana-amazonprometheus-datasource, must be prometheus or loki"
Failed to convert Prometheus rules to Grafana rules
error="[alerting.invalidDatasourceType] invalid datasource type: grafana-azureprometheus-datasource, must be prometheus or loki"
The same YAML imports successfully when a native prometheus type data source is selected.
Proposed Fix
Expand the datasource type allowlist in the Prometheus converter to include:
grafana-amazonprometheus-datasourcegrafana-azureprometheus-datasource
These datasources expose the same Prometheus-compatible rule format and their inclusion is a natural extension of the existing logic.
Additional Context
- Grafana version:
13.0.0-23772453380 - Affected datasource types:
grafana-amazonprometheus-datasource,grafana-azureprometheus-datasource - Unaffected: native
prometheusdatasource type