Skip to main content

A simple healthcheck wrapper to monitor kafka with kafkacat.

Project description

kafka-healthcheck

A simple healthcheck wrapper to monitor Kafka.

Kafka Healthcheck is a simple server that provides a singular API endpoint to determine the health of a Kafka instance. This can be used to alert or take action on unhealthy Kafka instances.

The service checks the health by sending kafkacat about that kafkacat

This project is a copy "devshawn" whit modifications for use kafkacat

Usage

Kafka Healthcheck can be installed via pip. Both python and pip are required, as well as kafkacat.

Command-Line

Install kafka-healthcheck via pip:

pip install kafka-healthcheck

To start the healthcheck server, run:

kafka-healthcheck

The server will now be running on localhost:9290.

Configuration

Kafka Healthcheck can be configured via command-line arguments or by environment variables.

Port

The port for the kafka-healthcheck API.

Usage Value
Environment Variable HEALTHCHECK_PORT
Command-Line Argument --port
Default Value 9290

Kafka Host

The host of the Kafka instance to run the health check against. This is used with kafkacat.

Usage Value
Environment Variable HEALTHCHECK_KAFKA_HOST
Command-Line Argument --kafka-host
Default Value localhost

Kafka Port

The port of the Kafka instance to run the health check against. This is used with kafkacat.

Usage Value
Environment Variable HEALTHCHECK_KAFKA_PORT
Command-Line Argument --kafka-port
Default Value 9092

Log Level

The level of logs to be shown by the application.

Usage Value
Environment Variable HEALTHCHECK_LOG_LEVEL
Command-Line Argument --log-level
Default Value INFO
Valid Values DEBUG, INFO, WARNING, ERROR

All healthy responses are logged at DEBUG. Unhealthy responses are logged at WARNING. Any unexpected errors are logged at ERROR.

License

Copyright (c) 2019 Shawn Seymour.

Extended Copyright (c) 2022 Rodrigo Garcia.

Licensed under the Apache 2.0 license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kafka-healthcheck-0.0.1.tar.gz (8.8 kB view hashes)

Uploaded Source

Built Distribution

kafka_healthcheck-0.0.1-py3-none-any.whl (11.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page