Revision be8b10f5ee295cfa072da9666a8f0c9f6ee6f694 authored by Matthew Jacobson on 08 June 2023, 22:59:54 UTC, committed by Santiago on 28 June 2023, 19:50:49 UTC
* Alerting: Repurpose rule testing endpoint to return potential alerts

This feature replaces the existing no-longer in-use grafana ruler testing API endpoint /api/v1/rule/test/grafana. The new endpoint returns a list of potential alerts created by the given alert rule, including built-in + interpolated labels and annotations.

The key priority of this endpoint is that it is intended to be as true as possible to what would be generated by the ruler except that the resulting alerts are not filtered to only Resolved / Firing and ready to be sent.

This means that the endpoint will, among other things:

- Attach static annotations and labels from the rule configuration to the alert instances.
- Attach dynamic annotations from the datasource to the alert instances.
- Attach built-in labels and annotations created by the Grafana Ruler (such as alertname and grafana_folder) to the alert instances.
- Interpolate templated annotations / labels and accept allowed template functions.

(cherry picked from commit ba3994d33877049909819add70cc3d1bf1033cc7)
1 parent e250d51
History

back to top