Customize Grafana alert emails

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ธ.ค. 2024

ความคิดเห็น • 22

  • @johnsimpledimple
    @johnsimpledimple หลายเดือนก่อน +2

    Thanks for making these--there is not great documentation on this tool and its a great tool.

  • @multiplewaya-qk7uq
    @multiplewaya-qk7uq 3 หลายเดือนก่อน +2

    one of the best video on this topic

    • @learningsoftwareskills
      @learningsoftwareskills  3 หลายเดือนก่อน

      @@multiplewaya-qk7uq thank you for the awesome feedback 👍🙏

  • @koushik4531
    @koushik4531 6 หลายเดือนก่อน +1

    Hey Thanks for this awsome video.
    I had scenario where we need to customize an email subject. So that if an eler had triggered it should display FIRED:. If elert got resolved then in email it should display RESOLVED:
    I was trying since long time but no luck I was getting output like after certain time during triggering It was giving complete set like "RESOLVED: test-rule2 FIRED: test-rule2 RESOLVED: test-rule2 RESOLVED: test-rule2 FIRED: test-rule2 FIRED: test-rule2 "

    • @learningsoftwareskills
      @learningsoftwareskills  5 หลายเดือนก่อน

      Hi, you can customize the subject as
      {{ .Status | toUpper}} : {{ (index .Alerts 0).Labels.alertname}}
      Here I am using only the first alert assuming one alert is fired every time.
      Hope this helps, cheers 👍
      Links:
      grafana.com/docs/grafana/latest/alerting/configure-notifications/template-notifications/create-notification-templates/#template-the-subject-of-an-email

  • @shyam8999
    @shyam8999 3 หลายเดือนก่อน +1

    Thanks for this video.

  • @lokeshvenkatesan
    @lokeshvenkatesan 2 หลายเดือนก่อน +2

    Guess what, I have been searching for this kind of explainer for almost an year now.

  • @PurimetlaAkhil
    @PurimetlaAkhil 2 หลายเดือนก่อน

    Hi @learningsoftware
    Can you please share the customise email template file which you have removed logo and buttons it would really helpful for me. I checked in your blog haven’t found it. Please can you share the template. Thanks in advance

  • @saiteja-td1zk
    @saiteja-td1zk 6 หลายเดือนก่อน +1

    Hey, thank you so much for creating this video, it was very helpful 😊
    I have few questions though,
    1.If we use docker or kubernetes how can we customize the html file
    2. Is there anyway to create notification template and directly use that in contact point instead of pasting the content in message field of contact point

    • @learningsoftwareskills
      @learningsoftwareskills  6 หลายเดือนก่อน

      Hi, thanks for the feedback.
      1. Grafana does not officially want you to change the ng_alert_notification.html in grafana\public\emails\ folder location. So, using a Dockerfile you can build an image on top of grafana-oss docker image and replace the ng_alert_notification.html file at the required folder location, since the docker image is just an alpine Linux instance with a file system under the hood.
      2. I understand that you do not want to automate the contact point message field. There might be a way to do that using some official Grafana APIs, but I suggest using the approach mentioned in point 1, which can make automation way much easy.
      Write back when u solve this issue.
      Hope this helps, cheers 👍

  • @shrikantdhumal1505
    @shrikantdhumal1505 6 หลายเดือนก่อน +1

    Can I use the same template for Microsoft Teams notifications?

    • @learningsoftwareskills
      @learningsoftwareskills  6 หลายเดือนก่อน

      Hi, i will try to find out and revert back, cheers 👍

    • @shrikantdhumal1505
      @shrikantdhumal1505 6 หลายเดือนก่อน +1

      @@learningsoftwareskills HI, Thanks for the response. Please let me know.

  • @CSEBHARATHS
    @CSEBHARATHS 5 หลายเดือนก่อน +1

    hey dude, I trying to alert the error my project , My doubt is that can i customize that too ? I mean i need to add the log itself in the Alert. How can i do that ?

    • @learningsoftwareskills
      @learningsoftwareskills  5 หลายเดือนก่อน

      Hii, as far as I know, only numeric values can be added in the alert messages.
      So, I think you can't render a log in the alert.

    • @CSEBHARATHS
      @CSEBHARATHS 5 หลายเดือนก่อน

      @@learningsoftwareskills Thanks Bro, But can i Access a some filed of my log by referring the label name ?

    • @CSEBHARATHS
      @CSEBHARATHS 5 หลายเดือนก่อน

      @@learningsoftwareskills
      {{ range .Alerts }}
      Status: {{ .Status }}
      Starts at: {{ .StartsAt }}
      Name: {{ .Labels.alertname }}

      Values:
      start
      Case ID: {{ .Annotations.caseidvalue }}
      Service Name: {{ .Annotations.servicenamevalue }}
      {{ range $refID, $value := .Values }}
      inside
      {{ $refID }}={{ $value }}
      {{ end }}
      {{ $labels }}
      end
      {{ end }}
      This is Try to do
      but i cannot get the value of "caseidvalue" and "servicenamevalue"
      Are you have any idea on this ?

    • @CSEBHARATHS
      @CSEBHARATHS 5 หลายเดือนก่อน

      @@learningsoftwareskillsThis is i try to do
      {{ range .Alerts }}
      Status: {{ .Status }}
      Starts at: {{ .StartsAt }}
      Name: {{ .Labels.alertname }}

      Values:
      start
      Case ID: {{ .Annotations.caseidvalue }}
      Service Name: {{ .Annotations.servicenamevalue }}
      {{ range $refID, $value := .Values }}
      inside
      {{ $refID }}={{ $value }}
      {{ end }}
      {{ $labels }}
      end
      {{ end }}
      To fetch the value form live logs of caseidvalue,servicenamevalue
      can i do it ?

  • @hamdijedidi6375
    @hamdijedidi6375 4 หลายเดือนก่อน

    hello sir
    hello please could u help me
    I'm customizing a Grafana template and I want to include the alert value in the description field. I tried using the following code, but it doesn’t seem to work:
    {{ range .Alerts }}
    Name: {{ .Labels.alertname }}
    Status: {{ .Status }}
    Description: The {{ .Labels.alertname }} = {{ $value }}
    {{ end }}