-
Notifications
You must be signed in to change notification settings - Fork 6k
Add healtcheck endpoint #1622
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
Add healtcheck endpoint #1622
Conversation
ec33cf5 to
6a9d2e5
Compare
* User option to define custom healthchecks * Example checking for communication errors with telegram api Fixes python-telegram-bot#1438
|
Hey, thanks for your PR. Before you continue developing it though, I have to tell you that we really, really don't like adding requirements to our project. While it might make things easier, the exact same result could be achieved with tornado. So I don't think me or the other maintainers can approve this. I am sorry :( |
|
Hey @Poolitzer, no worry, I did not expect this PR to be accepted. At least not the way it is now. I intended to start exactly this discussion. What are the requirements for doing this? The first would be "not adding any requirements" which I don't think is necessary. This kind of requirement might be worth documenting in a guide for contributing to the project. My PR is just a quick shot at what could be done without reinventing the wheel. One more requirement that I think should apply: 2.) Now what should these health checks do? In my example I implemented a possibility to check if the registered web hook is the one that the bot has set and it was not overwritten by another instance of the bot started somewhere else. Now this is the external view of the bots health. What would be an appropriate check within the bot to tell if it is functioning as expected? What kind of health check would apply when not run with a web hook? |
|
Hey. I am so sorry, I have no idea why your reply went by me. Let me comment now, an in depth reply will be guaranteed by this sunday :)
I do think so though. We are very hesitant with requirements. It add a potential of bugs out of our control. And a health checkpoint should be perfectly doable with Tornado.
Yes. Agreed.
looks like too much for me for a simple health check as suggested by the issue
The original idea was very simple: Check if the bot is running. Imo that would mean that I call an URL from an external app and get a 200 response. Thats it. I like where you went though.
I would say we leave this up to the endusers, kind of like you did. I would expect a very simple set-to-True argument to the dispatcher though, where you can either set it to True or to a custom URL, then use this URL (or get a generated one from PTB from the logs) and use that for the 200 check. And then users could implement their own healthchecks on top of it, kinda like your example did. Just to underline this: This is my personal, spontaneous view on this matter. We will talk about this whole issue as the maintainers and give you a proper, longer response on what we as a group can agree on :D |
|
@reimarstier Are you still persuing this pr? |
|
Closing due to inactivity |
Fixes #1438