metalmatze / alertmanager-bot

[deprecated] Bot for Prometheus' Alertmanager
MIT License
661 stars 148 forks source link

Support description annotation which is used by newer alerts #113

Closed runningman84 closed 4 years ago

runningman84 commented 4 years ago

I am not 100% sure if this works please double check...

The current template lacks description support and the duration could also be hidden if there is no end date? In my tests it is "-" until the event is solved.

metalmatze commented 4 years ago

Thanks for taking a look at this. Maybe for completeness we could also add summary too?

It was summary & description in Prometheus for a fair amount of time then we pivoted towards simply using message, as summary and description more than often were super similar.

runningman84 commented 4 years ago

I have added the summary too...

Btw. do you know why the duration is - until it is closed?

metalmatze commented 4 years ago

Thanks!

optimistic5 commented 4 years ago

Hi @metalmatze Could you please, update docker image, probably it is outdated from current master.

I use 0.4.2 and have the same massage like here: https://github.com/metalmatze/alertmanager-bot/issues/79#issue-497849793

metalmatze commented 4 years ago

I need to cut another release for a docker image to be built and pushed. :)

runningman84 commented 4 years ago

any news here?

tcassaert commented 4 years ago

While you're waiting for the release, you can easily add the template yourself with the TEMPLATE_PATHS environment variable. Create a directory with the template and mount it in your docker container, then set the value of the TEMPLATE_PATHS environment variable to that directory.

vidocq1102 commented 3 years ago

hi, tcassaert How to create template, please send me the guide to create template.

tcassaert commented 3 years ago

@nguyencuong1990 you create a file for your template, let's say /opt/template.tmpl. The content of that file is an adapted version of https://github.com/metalmatze/alertmanager-bot/blob/master/default.tmpl, according to your needs.

Then when you start the telegram-bot, you can pass an environment variable TEMPLATE_PATHS=/opt/template.tmpl.

vidocq1102 commented 3 years ago

hi @tcassaert I was read https://github.com/metalmatze/alertmanager-bot/blob/master/default.tmpl I want monitor my Vmware vcenter system. But only show FIRING on telegram group. The rule apply of my case: https://gitlab.com/Danny_Pham/toivietblog/-/raw/master/Monitoring/Prometheus%20+%20Grafana/prometheus%20rules/vcenter.yml?inline=false image Thanks for reply

tcassaert commented 3 years ago

@nguyencuong1990, in your rules file, your annotation Summary is written with a capital S, while the template is looking for a summary with a regular s. That's probably why it's not included in the alert message.

vidocq1102 commented 3 years ago

Hi @tcassaert When I add template.paths --template.paths=/data/default.tmpl image Thank you so much!