Define link on Grafana Template

Hi Team,

I am defining panel link on Grafana message template but it is showing up as normal text

But I want something like this on the message.

This is my code:

{{- define “slack.text” -}}
{{- range .Alerts -}}
{{ if gt (len .Annotations) 0 }}
Summary: {{ .Annotations.summary}}

Description: {{ .Annotations.description }}

Go to dashboard: {{ .DashboardURL }}
{{ end }}
{{ end }}
{{ end }}

Can anybody please assist me on this.

Regards,
Zeeshan Khan

Is this Microsoft Teams? If so, links need to be formatted as Markdown links with [link name](link url).

1 Like

[Go to dashboard]: {{ (.DashboardURL) }}

Do i need to write on this way?

More like:

Go to Dashboard: [{{ .DashboardURL }}]({{ .DashboardURL }})
1 Like

It worked. Thank You :slightly_smiling_face:

You’re welcome! I’m not sure if that works in Slack, so you might need to create a separate template for Microsoft Teams and Slack.

1 Like

Hi, Im trying to do the same for Slack but it is not working, do you know what would be the way for sending this to Slack, please?