-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: Add support for Prometheus AlertManager #89
feat: Add support for Prometheus AlertManager #89
Conversation
ad84607
to
a7bb438
Compare
Hi, @LexLuthr, this pr is ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good!
I would ask if you could add a doc like https://github.com/filecoin-project/curio/blob/main/harmony/harmonytask/doc.go detailing how to add new plugins? I think it would be really helpful for others who might want to add another one.
Also, can you please test this and attach screenshots of prometheus alert?
5125b90
to
644d09e
Compare
cfg := config.PrometheusAlertManagerConfig{
Enable: true,
AlertManagerURL: "http://10.122.6.17:9093/api/v2/alerts",
}
ap := plugin.NewPrometheusAlertManager(cfg)
err := ap.SendAlert(&plugin.AlertPayload{
Time: time.Now(),
Severity: "critical",
Source: "curio",
Summary: "Curio Alert",
Details: map[string]interface{}{
"test": "test",
},
}) In Prometheus Alertmanager: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job!! Thank you for the contribution.
#83
Added support for the Prometheus AlertManager, resulting in a change to the configuration file format:
Previously:
Now: