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

Alerts are not getting closed for alerts from Grafana8 #2077

Closed
kiran3394 opened this issue Dec 30, 2021 · 2 comments · Fixed by #2087
Closed

Alerts are not getting closed for alerts from Grafana8 #2077

kiran3394 opened this issue Dec 30, 2021 · 2 comments · Fixed by #2087
Labels
bug Something isn't working

Comments

@kiran3394
Copy link

Describe the Bug:
Alerts are not getting closed in goalert even after resolving in Grafana8.

Steps to Reproduce:

  1. Create an alert rule in Grafana (8.1.2) and corresponding notification policy with contact point as goalert incoming webhook.
  2. When alert rule goes to alerting state, we get alert in goalert.
  3. When the alert get resolved in Grafana, alert is not getting closed in goalert.

Expected Behavior:
Alerts should be closed after it get resolved in Grafana (8.1.2)

Observed Behavior:
Alerts are not getting closed in goalert even after resolving in Grafana8.

Application Version:
Grafana - 8.1.2
Goalert- v0.29.0

@kiran3394 kiran3394 added the bug Something isn't working label Dec 30, 2021
@kiran3394
Copy link
Author

We have done patching to fix it:
In grafana.go

// To handle closing of alerts coming from Grafana-8
		enable_grafana8 := os.Getenv("ENABLE_GRAFANA8")
		if strings.EqualFold(enable_grafana8, "true") {
			g.Message = strings.ReplaceAll(g.Message, "**Firing**", "")
			g.Message = strings.ReplaceAll(g.Message, "**Resolved**", "")
		}

@mastercactapus
Copy link
Member

Just working on the review of a PR fixing this, it looks like Grafana's new payload includes a version number so once merged & released it should work automatically with no ENV var required. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants