SolarEdgeTech/pyctuator

Support for Apache Cassandra in DB Health

millerjp opened this issue · 2 comments

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:

  1. What's the criteria for the health-check to report that the DB is up
  2. What additional info do you want to include in the DB status

For example, Spring's CassandraHealthIndicator:

  1. Reports UP if the state of at least one node in the cql-session is UP
  2. 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:

  1. Pyctuator's dependencies are always optional, so anyone using it isn't forced to include modules they don't need.
  2. We require that every component in Pyctuator will be tested.
    1. Components that require external dependencies can be tested using gitlab's "services" as can be seen in python_package_build.yml
    2. 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