camptocamp / grafana-prometheus-alertmanager-datasource

Grafana Datasource for the Prometheus Alertmanager
Apache License 2.0
287 stars 57 forks source link

Add Link to Alertmanager #99

Open f-booh opened 3 years ago

f-booh commented 3 years ago

It would be very helpful to have a link to Alertmanager to silence an alert directly from the dashboard.

You have to add all labels to the link, and need a way to configure the public url of alertmanager, e.g.

https://alertmanager.mydomain.org/#/silences/new?filter=%7Balertname%3D%22SomeAlert%22%2C%20instance%3D%22myserver%22

For silenced alerts, a link to expire a silence would be helpful.

cryptobioz commented 3 years ago

Indeed, it would be cool! However, I may not have time to implement this feature. Please, feel free to open a PR :)

dj-holgie commented 3 years ago

Weve realized this directly in grafana with overrides -> data links and data fields variables.

Matt-labor commented 2 years ago

Weve realized this directly in grafana with overrides -> data links and data fields variables.

Wow, I've tried this before, but I didn't figure out how to use the data variable in data links to silence or delete different alerts. Can you be more specific, please?

dj-holgie commented 2 years ago

This is how we do it

Table Options -> Override Fields with Name -> Data Links

https://alertmanager.xxx.net/#/silences/new?filter={alertname%3D"${__data.fields.alertname}"%2C severity%3D"${data.fields.severity}"%2C hostname%3D"${data.fields.hostname}"}

Matt-labor commented 2 years ago

This is how we do it

Table Options -> Override Fields with Name -> Data Links

https://alertmanager.xxx.net/#/silences/new?filter={alertname%3D"${__data.fields.alertname}"%2C severity%3D"${data.fields.severity}"%2C hostname%3D"${data.fields.hostname}"}

Thanks, this works. It jumps to the alertmanager silencing page of this alert. And also I'm trying to create such a silencing rule with just one click. Which may use the alertmanager api v2?