Burrow icon indicating copy to clipboard operation
Burrow copied to clipboard

Not able to attach custom headers to the notifier email

Open neha-194 opened this issue 3 years ago • 1 comments

Hi, We are using this burrow template to trigger alert emails, but we are not able to attach custom headers to the email. We have tried the below option: Notifier email : The link mentions that we can specify additional mail headers before the blank line before body part. We have followed the same but the lines that are supposed to be the headers are being shown as a part of body. The email template and config are as below:

Template file:

Subject: Lag Alert: [prod][{{.Result.Cluster}}] for {{.Result.Group}} X-ACCOUNT-ID: 1; X-ORG-ID: 1; X-EMAIL-TYPE: NOTIFICATION X-ACCOUNT-TYPE: ACTIVE X-SOURCE: MONITORING

The Kafka consumer groups you are monitoring are currently showing problems. The following groups are in a problem state (groups not listed are OK):

Cluster: {{.Result.Cluster}} Group: {{.Result.Group}} Status: {{if eq 1 .Result.Status}}OK{{else if eq 1 .Result.Status}}WARNING{{else if eq 2 .Result.Status}}ERROR{{end}} Complete: {{.Result.Complete}} TotalLag: {{.Result.TotalLag}} MaxLag: {{jsonencoder .Result.Maxlag}} Errors: {{len .Result.Partitions}} partitions have problems {{range .Result.Partitions}} {{if eq 1 .Status}} OK{{if eq 2 .Status}} WARN{{else if eq 2 .Status}} ERR{{else if eq 3 .Status}} STOP{{else if eq 4 .Status}}STALL{{end}} {{.Topic}}:{{.Partition}} ({{.Start.Timestamp}}, {{.Start.Offset}}, {{.Start.Lag}}) -> ({{.End.Timestamp}}, {{.End.Offset}}, {{.End.Lag}}) {{end}}{{end}}

Config:

class-name="email" interval=300 threshold=2 group-allowlist="^example.*$" send-close=true server="example.com" port=587 auth-type="plain" username="example_username" password="example_password" enable=true from="some_email_id" to="some_email_id" template-open="lag-alert-email.tmpl" template-close="lag-ok-email.tmpl" noverify=true

Please look at the issue on how to pass the custom headers to the notifier email using the burrow template.

Thanks.

neha-194 avatar Nov 16 '21 06:11 neha-194

Hi @neha-194 Did you create the file - lag-alert-email.tmpl ? I am new to Burrow . And I am using the version Burrow 1.3.8 from docker . I could not find any default email template .

anishma83 avatar Feb 08 '22 22:02 anishma83