Package: health-ping
HealthPingTable of ContentsIntroductionFeaturesTechnologiesSetupTeamContributingOthersIntroductionHealthPingis a lightweight python package that allows users to easily include liveness monitoring in their applications. If you've got a python program running (such as a telegram bot) and find yourself wondering from time to time about its liveness, then this is the package for you! HealthPing abstracts away the task of sending request to monitoring endpoints, managing timezones and retries - offering all these in as short as two lines of code:from health_ping import HealthPing
HealthPing(url="https://hc-ping.com/<id>", timezone="UTC+08:00", schedule="1 * * * *").start()HealthPingessentially adopts the "deadman switch" approach, where it regularly sends a "heartbeat" to a monitoring service such asHealthchecks.io. If a "heartbeat" does not arrive within a scheduled period, the service is assumed dead and an alert (e.g. email notification) is then sent out to the service owner.HealthPingis published onpypiand can be easily installed with:python3 -m pip install health_pingDetails on the usage of the package can be found on thewiki page.FeaturesAs a lightweight utility package, HealthPing serves to carry out a single yet important purpose - notify the monitoring service that your application is still healthy and running. In order to assist you with that, HealthPing comes equipped with the following parameters for configuration:urlmethodheadersbodytimezonescheduleretriespre_firepost_firelog_filedebugFor most of the use cases, specifying theurl,timezoneandschedulewill be enough! Details on each parameter such as their default values and usage are described in thewiki page.TechnologiesTechnologies used by HealthPing are as below:Done with:PythonProject Repositoryhttps://github.com/tjtanjin/health_pingSetupThis section will walk you through setting up a development environment if you wish to make modifications or contributions to the project.First,cdto the directory of where you wish to store the project and clone this repository. An example is provided below:cd /home/user/exampleuser/projects/
git clone https://github.com/tjtanjin/health_ping.gitOnce the project has been cloned,cdinto it and install required dependencies with the following command:python3 -m pip install --no-cache-dir -r requirements.txt requirements-dev.txtFollowing which, create (or copy) a.envfile at the root of the project using the provided.env.template. In order to run tests, you need to replace theTEST_URLvariable within the.envfile with any valid URL of your choice.Proceed to make changes to the project (you may also wish to add test cases if necessary) and when ready, run tests with:python3 -m pytest ./tests/test.pyShould you wish to build this into a package, you may run the following commands within the project root directory:python3 -m buildTeamTan JinNote: Special thanks toAvery Khoofor bouncing ideas and sharing knowledge!ContributingIf you have code to contribute to the project, open a pull request and describe clearly the changes and what they are intended to do (enhancement, bug fixes etc).Alternatively, you may contact me viadiscordor simply raise bugs or suggestions by opening anissue.OthersFor any questions regarding the implementation of the project, you may also reach out ondiscordor drop an email to:cjtanjin@gmail.com.