Skip to content
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: alerts created via API alert not validated #87606

Open
Tasssadar opened this issue May 10, 2024 · 0 comments
Open

Alerting: alerts created via API alert not validated #87606

Tasssadar opened this issue May 10, 2024 · 0 comments

Comments

@Tasssadar
Copy link

Tasssadar commented May 10, 2024

What happened?

We use the API to manage alerts via code, but unfortunately, the API lacks validation of the alerts. For example, when I create alert with a typo in refId, so the Triggers no longer link together, the Alert is successfuly created.

What's more, it appears as if it works correctly, everything is green:
image

When I try to edit the alert, I get this, so clearly, Grafana is capable of detecting this error.
image

Additionally, one broken Alert like this completely breaks Alert editing via UI - it is not possible to delete or edit any alert when at least one in a dasboard (I don't know the scope, it's more than a dashboard) is broken, we have to use the API to delete them.

What did you expect to happen?

API rejects creation of invalid alerts. UI does not break when one alert has invalid definition.

Did this work before?

How do we reproduce it?

  1. Create alert using the API. Make it somehow invalid, for example add two triggers, but with refId+expression that don't match each other.

Is the bug inside a dashboard panel?

No response

Environment (with versions)?

Grafana: 9.5.15

Grafana platform?

I don't know

Datasource(s)?

Prometheus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant