Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana/latest/ai-tools/grafana-cli/gcx/resources/linter-rules/dashboard/target-valid-promql.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana/latest/ai-tools/grafana-cli/gcx/resources/linter-rules/dashboard/target-valid-promql/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
target-valid-promql
Checks that each Prometheus target on each panel uses a valid PromQL query.
Queries that reference a datasource variable use its configured plugin to select
the query language: the variable’s query field in v1 dashboards and
DatasourceVariable.spec.pluginId in v2 dashboards. This takes precedence over
the target’s saved datasource type (v1) or query group (v2). References in $name,
${name}, and legacy [[name]] forms are supported. Direct datasource references
and unresolved variables keep their saved type or group.
Non-Prometheus queries are skipped. Violations include the panel identifier and
query reference ID in their details.
Was this page helpful?
Related resources from Grafana Labs


