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

Customize "OPEN IN GRAFANA" widget in Google Chat #209

Open
williancolognesitrimble opened this issue Jun 19, 2024 · 2 comments
Open

Customize "OPEN IN GRAFANA" widget in Google Chat #209

williancolognesitrimble opened this issue Jun 19, 2024 · 2 comments

Comments

@williancolognesitrimble

Hello,

I recently upgrade Grafana to version 9.x and previously the button "OPEN IN GRAFANA" used to have a link to the panel where it's alert comes from.

But now it always send to "alert list page" that isn't useful to analyse the alert itself because alert list do not show the metrics.

I'd like to request a way to customize this button maybe from template or something like that.

Thanks.

@JacobsonMT
Copy link
Member

This change is likely caused by the automatic upgrade to Unified Alerting in 9.x. It should be possible to template the direct link to the alert by using the {{ .GeneratorURL }} field of an individual alert. Something like:

{{ range .Alerts }}
{{ .GeneratorURL }}
{{ end }}

Or if you know the alerts are all from the same rule you can just use the first one:

{{ (index .Alerts 0).GeneratorURL }}

You can find more information here: https://grafana.com/docs/grafana/latest/alerting/configure-notifications/template-notifications/

If this isn't enough we can consider creating a feature request to have this value in the default template similar to Slack.

@williancolognesitrimble
Copy link
Author

williancolognesitrimble commented Jun 27, 2024

This change is likely caused by the automatic upgrade to Unified Alerting in 9.x. It should be possible to template the direct link to the alert by using the {{ .GeneratorURL }} field of an individual alert. Something like:

I'm talking about the button that's currently hardcoded in Google Chat receiver https://github.com/grafana/alerting/blob/main/receivers/googlechat/googlechat.go#L67

The workaround to put a link in the alert message is ok, but having a way to customize the button url would be better (to keep the previous behaviour)

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

No branches or pull requests

2 participants