Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Why Your Grafana Dashboard Shows No Data (When Prometheus Is Fine)

说明与用途

Grafana 面板显示“无数据”,但 Prometheus 正常。问题在于自引用变量未返回值。修正变量并保存显式默认值后,面板恢复显示数据。

问题

Grafana dashboards display “No data” even though Prometheus has healthy metrics.

结果

The dashboard now renders correctly on all hosts; empty panels are intentional and documented.

工作流

  • 1. Verify target scraping via Prometheus API
  • 2. Check metric existence directly with Prometheus query
  • 3. Test panel expression manually
  • 4. Identify variable layer causing empty results
  • 5. Remove self-referencing variable and set explicit defaults
  • 6. Save current values for variables
  • 7. Verify Grafana’s saved variable values via API
  • 8. Resolve $__all sentinel to allValue before expanding

证据

All three were green: 7 targets up, 25k series ingested, and the panel's raw expression returned data when I ran it by hand.

来源

The dashboard had a host picker. Two variables chained: $nodename and $node. The definition of the first one was: # BROKEN — the variable filters on its own value label_values(node_uname_info{job="unraid-host", nodename=~"$nodename"}, nodename)

来源

The fix is to stop the self-reference and give each variable an explicit saved default: # FIXED — no self-reference, one hop per variable # $nodename label_values(node_uname_info{job="unraid-host"}, nodename) # $node label_values(node_uname_info{job="unraid-host", nodename="$nodename"}, instance)

来源

  • 记录日期: 2026-11-01T07:59:19.560Z