Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding telegram support #2827

Merged
merged 20 commits into from
Feb 22, 2022
Merged

Conversation

timmilesdw
Copy link
Contributor

@timmilesdw timmilesdw commented Feb 4, 2022

Added telegram integration

Features:

  • Custom API URL
  • Disable Notifications
  • Message templating

image

Signed-off-by: timmilesdw <[email protected]>
@timmilesdw timmilesdw changed the title Telegram support Adding telegram support Feb 4, 2022
@timmilesdw
Copy link
Contributor Author

@w0rm

@w0rm
Copy link
Member

w0rm commented Feb 4, 2022

@timmilesdw @SuperQ sorry folks, I can’t review the go code! Happy to review the UI anytime though 😅

@timmilesdw
Copy link
Contributor Author

Oh, sorry, i had no clue about it. @SuperQ can you please revoke review request from w0rm? I should probably mention @simonpasquier instead

@SuperQ SuperQ requested review from gouthamve and matthiasr and removed request for w0rm February 6, 2022 11:11
config/notifiers.go Outdated Show resolved Hide resolved
docs/configuration.md Show resolved Hide resolved
notify/telegram/telegram.go Outdated Show resolved Hide resolved
notify/telegram/telegram.go Show resolved Hide resolved
notify/telegram/telegram.go Show resolved Hide resolved
@timmilesdw
Copy link
Contributor Author

the test is failing, but i don't see that i affect the TestClusterDeduplication test, maybe someone could rerun tests?

@metalmatze
Copy link
Member

This looks amazing and I'd love to see this being added to alertmanager itself!
Since the alertmanager-bot only ever supported Telegram and only few of the chat commands really are used, I'd be happy to sunset/deprecate the bot in-favor if this implementation.

cmd/alertmanager/main.go Outdated Show resolved Hide resolved
config/notifiers.go Show resolved Hide resolved
config/notifiers.go Outdated Show resolved Hide resolved
docs/configuration.md Show resolved Hide resolved
@timmilesdw
Copy link
Contributor Author

Could someone rerun frontend test? Failed because it can't pull image from dockerhub

@metalmatze
Copy link
Member

Anything left to do here in order to merge? Amazing work!

@timmilesdw
Copy link
Contributor Author

Anything left to do here in order to merge? Amazing work!

Thanks! @simonpasquier any updates?

@timmilesdw
Copy link
Contributor Author

Comment for activity, waiting for merge or re-review

@simonpasquier
Copy link
Member

Chatted offline with @metalmatze who's willing to help with maintaining this integration so this is a 👍 for me too.

@simonpasquier simonpasquier merged commit 1138a08 into prometheus:main Feb 22, 2022
@simonpasquier
Copy link
Member

Thanks!

@timmilesdw
Copy link
Contributor Author

Great! Thank you too!

@chanyshev
Copy link

chanyshev commented May 7, 2022

I have chat_id negative number and I see this error
"Notify attempt failed, will retry later" attempts=1 err="telegram: Bad Request: can't parse entities: Character '-' is reserved and must be escaped with the preceding '\\' (400)"
udp:
The problem turned out to be in the parameter parse_mode:
I changed to HTML and the messages started coming.
How to use parse_mode: MarkdownV2 ?

@tazhate
Copy link

tazhate commented May 19, 2022

HOLY MOLY! Thanks a lot for this MR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants