Skip to content

AIO sample Grafana dashboard shows no data: unresolved ${DS_MANAGED_PROMETHEUS_INSTANCE} datasource on import #673

Description

@bindsi

Summary

The AIO sample dashboard imported by the observability component renders all panels empty with the error:

Datasource ${DS_MANAGED_PROMETHEUS_INSTANCE} was not found

Details

src/000-cloud/020-observability/scripts/import-grafana-dashboards.sh imports the AIO sample dashboard directly from the upstream source:

https://raw.githubusercontent.com/Azure/azure-iot-operations/refs/heads/main/samples/grafana-dashboard/aio.sample.json

That dashboard is a Grafana export: every panel (and the cluster template variable) references its datasource through the __inputs placeholder "uid": "${DS_MANAGED_PROMETHEUS_INSTANCE}".

az grafana dashboard import only auto-binds a datasource __input when a matching Prometheus datasource is Grafana's default. In Azure Managed Grafana the auto-provisioned managed Prometheus datasource (from the Azure Monitor Workspace integration) is not the default, so the placeholder is imported literally and no panel can resolve its datasource.

Upstream change that surfaced this

The behavior tracks the 2510-release refresh of the sample dashboard in the source repo: Azure/azure-iot-operations#80. That update:

  • renamed the datasource plugin input to Microsoft Prometheus (Preview), and
  • reset the prometheus datasource template variable's current to {} (previously it shipped pre-bound), while panels still hardcode the raw ${DS_MANAGED_PROMETHEUS_INSTANCE} input rather than the ${prometheus} variable.

Impact

Fresh deployments of src/000-cloud/020-observability get an AIO sample dashboard with no data until the datasource is bound manually.

Fix

In the import script, resolve the managed Prometheus datasource uid (by Azure Monitor Workspace name, falling back to the first prometheus-type datasource) and bind every ${DS_MANAGED_PROMETHEUS_INSTANCE} reference before importing (and drop __inputs). Pass the monitor workspace name from Terraform so the correct datasource is selected.

Repro

  1. Deploy the observability component so the AIO sample dashboard is imported.
  2. Open AIO Sample Dashboard in Azure Managed Grafana.
  3. Observe the Datasource ${DS_MANAGED_PROMETHEUS_INSTANCE} was not found error and empty panels.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions