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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for kafka_healthcheck-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e81882d339cee74d7c346f43153d018d8948d2e494edd7a662bc25edafa49c82 |
|
MD5 | 7ebb7a57652adca669b89f7d9cda48d7 |
|
BLAKE2b-256 | da489fdb8b4745e7c1ebb59cf00ae8f11369b77d1603e97841e8af93d2ee15db |