0

I have Grafana 9.5.7 version, which was set up by Hilm chart. I also have alerting rules, policies and contact points. When I tying to put my template into file, It seems like Grafana is ignoring it.

alerting:
  rules.yaml:
    apiVersion: 1
    templates:
    - orgId: 1
      name: slack
      template: |
        `{{ define "slack.print_alert" -}}
          [{{.Status}}] {{ .Labels.alertname }}
          Labels:
          {{ range .Labels.SortedPairs -}}
          - {{ .Name }}: {{ .Value }}
          {{ end -}}
          {{ if .Annotations -}}
          Annotations:
          {{ range .Annotations.SortedPairs -}}
          - {{ .Name }}: {{ .Value }}
          {{ end -}}
          {{ end -}}
          {{ if .SilenceURL -}}
            Silence: {{ .SilenceURL }}
          {{ end -}}
          {{ if .DashboardURL -}}
            Go to dashboard: {{ .DashboardURL }}
          {{- end }}
        {{- end }}`
    groups:
      - orgId: 1
        name: cpu-seed-sale
        folder: creafans
        interval: 1m
        rules: {}
          

On grafana dashboard I see only name of template without code. Why? What is wrong with it? enter image description here

annn
  • 63
  • 5
  • I _guess_ this is a template so you should try running a [helm lint](https://helm.sh/docs/chart_template_guide/debugging/) on your file first and give the output in your question first (if it doesn't solve your problem). – Tensibai Aug 29 '23 at 12:40

0 Answers0