Skip to content

Instantly share code, notes, and snippets.

@MarieKirya
MarieKirya / grafana-discord-components.tpl
Created January 19, 2026 07:16
Grafana Discord Component Custom Webhook Implementation
{{- /* Create a custom webhook, and point it to your Discord webhook, make sure you append ?with_components=true to your webhook */ -}}
{{ define "__discord_values_list" }}{{ if len .Values }}{{ $first := true }}{{ range $refID, $value := .Values -}}
{{ if $first }}{{ $first = false }}{{ else }}, {{ end }}{{ $refID }}={{ $value }}{{ end -}}
{{ else }}[no value]{{ end }}{{ end }}
{{ define "__discord_labels_list" }}{{ if len .Values }}{{ $first := true }}{{ range $refID, $value := .Labels -}}
{{ if $first }}{{ $first = false }}{{ else }}, {{ end }}{{ $refID }}={{ $value }}{{ end -}}
{{ else }}[no value]{{ end }}{{ end }}
int plus = 2;
int gpin = 0;
int rpin = 1;
int bpin = 4;
float red = 0;
float green = 0;
float blue = 0;
int stage = 0;