slok / alertgram

Easy and simple prometheus alertmanager alerts on telegram

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error while parsing alarm

thenextfreelancer opened this issue · comments

Hi,

I tried my best but I am not able to find out why some alerts are not coming in telegram. In logs, I see this error:
{"alertGroupID":"{}/{}:{alertname=\"MY_Alert\", category=\"Saturation\", instance=\"sadf-sdfsdf-sdfsdf\", knowId=\"SAT-NDE-0001\", level=\"Node\", node=\"ip-0-32-23-23-23.internal\", pod=\"N/A\", severity=\"minor\"}","chatID":"","level":"error","msg":"could not notify alert group: could not format the alerts to message: error rendering alerts to template: error rendering template: template: tpl:1:7: executing \"tpl\" at \u003c.HasFiring\u003e: can't evaluate field HasFiring in type*model.AlertGroup","notifier":"telegram","service":"forward.Service","time":"2021-03-05T20:29:11Z","version":"v0.3.1"}
`

I only get this error in kubernetes environment. When I test same template and same input json locally via test, it runs fine.

Can anybody help me with some clue?

Hi,

I tried my best but I am not able to find out why some alerts are not coming in telegram. In logs, I see this error:
{"alertGroupID":"{}/{}:{alertname=\"MY_Alert\", category=\"Saturation\", instance=\"sadf-sdfsdf-sdfsdf\", knowId=\"SAT-NDE-0001\", level=\"Node\", node=\"ip-0-32-23-23-23.internal\", pod=\"N/A\", severity=\"minor\"}","chatID":"","level":"error","msg":"could not notify alert group: could not format the alerts to message: error rendering alerts to template: error rendering template: template: tpl:1:7: executing \"tpl\" at \u003c.HasFiring\u003e: can't evaluate field HasFiring in type*model.AlertGroup","notifier":"telegram","service":"forward.Service","time":"2021-03-05T20:29:11Z","version":"v0.3.1"}
`

I only get this error in kubernetes environment. When I test same template and same input json locally via test, it runs fine.

Can anybody help me with some clue?

Sorry, issue resolved by updating version from v0.3.1 to v0.3.2 . If you find sometime, assign latest tag with v0.3.2 . Thanks.

Hi!

Seems that you solved the issue :)

The latest tag is already pointing to 1e21aa57b9e2 that is v0.3.2. So maybe the problem you had is related to cached images.

I see this on project page where latest is tagged to v0.3.1

image

Oh! you are right, I was referring to docker images. I'll fix it, many thanks!