pyctuator
pyctuator copied to clipboard
Support for Apache Cassandra in DB Health
Hi - it would be helpful to a project I am on to support Apache Cassandra. If someone could give me an overview or some documentation on how this might be best implemented I would be happy to develop it.
Thanks.
Hi, sorry for the late response. Will send you example later this week.
@millerjp it would be great if you can send a PR with a "cassandra health indicator".
Before you begin, you need to decide:
- What's the criteria for the health-check to report that the DB is up
- What additional info do you want to include in the DB status
For example, Spring's CassandraHealthIndicator:
- Reports
UPif the state of at least one node in the cql-session isUP - Includes the version of the Cassandra in one of the nodes
In Pyctuator, health indicators extend HealthProvider and are registered with Pyctuator as demonstrated in advanced_example_app.py.
Two important notes:
- Pyctuator's dependencies are always optional, so anyone using it isn't forced to include modules they don't need.
- We require that every component in Pyctuator will be tested.
- Components that require external dependencies can be tested using gitlab's "services" as can be seen in python_package_build.yml
- Such tests should be skipped if the external resource isn't available which is done based on if the resource's module is installed or not, see test_redis_health_provider.py