-
Notifications
You must be signed in to change notification settings - Fork 11.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alerting: /api/prometheus/grafana/api/v1/alerts
uses invalid state names
#52453
Comments
After looking at this a bit longer I think it's by design, and this endpoint is only inspired by Alert Generator spec, and doesn't try to follow it |
Thanks for reaching out @piotrp, we already run the alert generator spec against grafana alerting and we are not fully compliant yet. Our goal is to become eventually compliant. I will keep this issue open to track this part of the effort. |
Thank you, it's good to know where this is going. I'm writing custom integration that puts all active alerts into a table and sends it via email, so I'm looking closely at what is available in current APIs, and what can be inferred by looking at available annotations/labels. |
Small update, for completeness sake:
For my use it would be ideal to have additional Grafana-specific information present in additional attributes (or private annotations?):
|
This issue has been automatically marked as stale because it has not had activity in the last year. It will be closed in 30 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions! |
/api/prometheus/grafana/api/v1/alerts
endpoints returns alert's state as Normal/Pending/Alerting, instead of inactive/pending/firing as required by https://github.com/prometheus/compliance/blob/main/alert_generator/specification.md.Looks like Grafana passes string value of its internal alert state, without any translation:
grafana/pkg/services/ngalert/api/api_prometheus.go
Line 61 in 623255c
grafana/pkg/services/ngalert/eval/eval.go
Lines 111 to 134 in 623255c
Tested on Grafana 8.5.6.
The text was updated successfully, but these errors were encountered: