Open
Description
Workspace
grafana
📜 Description
This issue has to do with the EntityGrafanaAlertsCard
component and the UnifiedAlertingGrafanaApiClient.alertsForSelector
method.
When the following is true:
EntityGrafanaAlertsCard
is present on the Entity page- the entity has
grafana/alert-label-selector: 'label=value'
- there is a rule on the connected Grafana instance which matched
label
andvalue
- BUT there are no instances which match
label
andvalue
then
alertsResponse
is {"status":"success","data":{"alerts":null}}
and this line causes Cannot read properties of null (reading 'filter')
:

👍 Expected behavior
It should show "No Alerts" or similar
👎 Actual Behavior with Screenshots
Described above.
👟 Reproduction steps
Described above.
📃 Provide the context for the Bug.
Trying to set up Grafana plugin on a test backstage app.
👀 Have you spent some time to check if this bug has been raised before?
- I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- I have read the Code of Conduct
Are you willing to submit PR?
Yes I am willing to submit a PR!