K-Phoen / backstage-plugin-grafana

Grafana plugin for Backstage
Apache License 2.0
53 stars 28 forks source link

Alert state is not surfaced when using Grafana Unified Alerting #53

Open elizabeth-a-hobbs opened 1 year ago

elizabeth-a-hobbs commented 1 year ago

Current Behavior

The alert state is not surfaced on the EntityGrafanaAlertsCard component when using Grafana Unified Alerting.

image

Expected Behavior

We expect that the alert state be surfaced on the EntityGrafanaAlertsCard component when using Grafana Unified Alerting, just as it is for the Grafana Legacy Alerts.

image

Troubleshooting

We identified that the alert state is intentionally disabled when using Grafana Unified Alerting. We suspect this was the case as the API that is currently used to retrieve the alerts (/api/ruler/grafana/api/v1/rules) does not return the alert state.

Can you provide context as to why the /api/ruler/grafana/api/v1/rules endpoint was chosen?

Possible Solutions

The /api/prometheus/grafana/api/v1/alerts endpoint could be called in conjunction with the /api/ruler/grafana/api/v1/rules endpoint to retrieve the alert state.

Alternatively, the /api/prometheus/grafana/api/v1/rules endpoint appears to return the majority of the needed information, however this does not seem to include rule_uid.