“No data” in Grafana is not a crash but a statement about the query: it returned no time series. For an error rate that is often the good case – there simply were no errors.
Symptom
sum(job:notes_http_requests:rate5m{code=~"5.."})
/ sum(job:notes_http_requests:rate5m)
The “Fehlerquote” (error rate) panel in the course dashboard uses this query. Without a fault it shows No data.
Diagnosis
Trigger a fault and watch whether the panel reacts.
kubectl -n app set env deploy/notes-api NOTES_ERROR_RATE=0.1
Causes
code=~"5.."There simply are no errors
A counter with the label code="500" only exists after the first 5xx response. Before that the selector finds nothing and the division returns nothing.
~9 instead of 10 %The denominator counts more than the faulty requests
With the fault the line rises to about 9 percent, not 10: /healthz and /metrics never fail and count in the denominator.
Fix
kubectl -n app set env deploy/notes-api NOTES_ERROR_RATE-
Don't: Append or vector(0) blindly – the panel then shows 0 even when notes-api is not scraped at all.
Observability hands-on, Day 5: Grafana with data sources, panels, variables and your own dashboard.
Go to day 5 →
FAQ
How do I tell “no errors” from “no data”?
Also check that requests are counted at all (the denominator) or that up is 1 for the job. If the denominator is there and the numerator is empty, there were no errors.
Should I avoid No data in dashboards?
Only on purpose. An empty panel is honest; a 0 from or vector(0) can hide a scrape outage.