How to add a template value to the Dashboard URL on unified alerts

  • What Grafana version and what operating system are you using?
    grafana v8.3.4 on Red Hat Enterprise Linux release 8.3

  • What are you trying to achieve?
    I want to add an alert label from a multidimensional rule to the DashboardURL alert field

  • How are you trying to achieve it?
    Setting the string below to the Dashboard UID:

NG-8Ioank/simpledashboard?orgId=1&var-PlatformVar={{ $labels.platform }}

image

  • What happened?
    The ? character is escaped to the hex (%3F) value on the alert so the address is changed to a wrong parameterized URL:
NG-8Ioank/simpledashboard%3ForgId=1&var-PlatformVar=Platform1
  • What did you expect to happen?
    I expected to have the parameterized URL inside the DashboardURL

I also tried to use the DashboardURL variable inside the alarm RunBook URL info, so I can use the autogenerated Dashboard URL, but that variable is not expanded on the alert:

{{ DashboardURL }}/simpledashboard?orgId=1&var-PlatformVar={{ $labels.platform }}

image

image

I can set the full URL into Runbook URL instead of using the DashboardURL but then I have to know the URL where grafana is running on.

Looks like you’ve done pretty thorough research on this @togarha

I might make a GH issue about this and share your reseach:

Created already:

1 Like