You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FAQ] HW4: provisioned Grafana alert rule stays Normal while 5xx are live — masked evaluator build error (reduce/threshold missing expression: input) #440
Symptom: observability/alerts.yaml provisioned rule (Prometheus query → reduce →
threshold) shows State Normal, Health ok, "Next evaluation in a few seconds",
while the dashboard panel for the very same expression (sum(rate(http_server_requests_total{http_status_code=~"5.."}[5m]))) clearly shows >0 and /api/v1/query returns a positive value. Re-firing the trigger and restarting Grafana do not help.
Cause: in Grafana 10/11 provisioning, every expression node must declare its input
explicitly: the reduce node needs expression: <refId of the query> and the threshold node needs expression: <refId of the reduce> (the legacy conditions[].query.params alone is not enough). Without them the scheduler fails
every tick with Failed to build rule evaluator: failed to parse expression 'B': no expression ID is specified to reduce / 'C': no variable specified to reference,
and because the rule sets execErrState: OK (a sensible choice to hide transient
query errors), the UI masks the broken evaluator as a healthy Normal — exactly
the state you'd expect during a quiet period.
- refId: BdatasourceUid: __expr__model:
refId: Btype: reducereducer: lastexpression: A # ← input of the reduce
- refId: CdatasourceUid: __expr__model:
refId: Ctype: thresholdexpression: B # ← input of the thresholdconditions:
- evaluator: {type: gt, params: [0]}operator: {type: and}query: {params: ["B"]}reducer: {type: last, params: []}type: query
then sudo docker compose restart grafana (provisioning re-reads at boot). Pending
appears within one evaluation interval, Firing after for: elapses.
Prevention: after deploying provisioned alerting, assert evaluation, not health —
grep the ngalert scheduler log for Failed to build rule evaluator, or check the
rule's State history for real Ok/Alerting entries instead of Normal (Error).
Checklist
I have searched existing FAQs and this question is not already answered
The answer provides accurate, helpful information
I have included any relevant code examples or links
Activity
github-actions commentedon Oct 6, 2026
❌ FAQ Bot encountered an error processing this proposal.
Please check the workflow run for details.
A maintainer will review this manually.
alexeygrigorev commentedon Oct 14, 2026
Thanks! Added to the FAQ (slightly trimmed): https://github.com/DataTalksClub/faq/blob/main/_questions/ai-dev-tools-zoomcamp/04-devops-homework/003_517f093406_grafana-provisioned-alert-stays-normal-missing-expression.md