Skip to main content

Export Kea Metrics in the Prometheus Exposition Format

Project description

GitHub license GitHub tag (latest SemVer)

kea-exporter

Prometheus Exporter for the ISC Kea DHCP Server.

From v0.4.0 on Kea >=1.3.0 is required, as the configuration, specifically subnet information, will be read from the control socket.

Installation

Package versions via repology.org

The latest stable version can always be installed from PyPi:

$ pip install kea-exporter

and upgraded with:

$ pip install --upgrade kea-exporter

Docker

A docker image is available and can be configured with environment variables see usage section

$ docker pull ghcr.io/mweinelt/kea-exporter

Features

  • DHCP4 & DHCP6 Metrics (tested against Kea 2.4.1)

  • Configuration and statistics via control socket or http api

Currently not working:

  • Automatic config reload (through inotify)

Known Limitations

The following features are not supported yet, help is welcome.

  • Shared Networks

  • Custom Subnet Identifiers

Usage

Usage: kea-exporter [OPTIONS] [SOCKETS]...

Options:
-m, --mode [socket|http]  Select mode.
-a, --address TEXT        Specify the address to bind against.
-p, --port INTEGER        Specify the port on which to listen.
-i, --interval INTEGER    Minimal interval between two queries to Kea in seconds.
-t, --target TEXT         Target address and port of Kea server, e.g.
                           http://kea.example.com:8080.
--client-cert TEXT        Client certificate file path used in HTTP mode
                           with mTLS
--client-key TEXT         Client key file path used in HTTP mode with mTLS
--version                 Show the version and exit.
--help                    Show this message and exit.

You can also configure the exporter using environment variables:

export MODE="http"
export ADDRESS="0.0.0.0"
export PORT="9547"
export INTERVAL="7.5"
export TARGET="http://kea"
export CLIENT_CERT="/etc/kea-exporter/client.crt"
export CLIENT_KEY="/etc/kea-exporter/client.key"

Configure Control Socket

The exporter uses Kea’s control socket to request both configuration and statistics. Consult the documentation on how to set up the control socket:

HTTPS

If you need to validate a self-signed certificate on a Kea instance, you can set REQUESTS_CA_BUNDLE environment variable to a bundle CA path.

Permissions

Kea Exporter needs to be able to read and write on the socket, hence it’s permissions might need to be modified accordingly.

Grafana-Dashboard

A dashboard for this exporter is available at https://grafana.com/grafana/dashboards/12688.

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

kea_exporter-0.6.2.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

kea_exporter-0.6.2-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file kea_exporter-0.6.2.tar.gz.

File metadata

  • Download URL: kea_exporter-0.6.2.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.12.4 CPython/3.10.12

File hashes

Hashes for kea_exporter-0.6.2.tar.gz
Algorithm Hash digest
SHA256 05a9d2a11b12c3244ca8575f75fc74b14ba6e8c53bb9ba5a8603d57eafc096af
MD5 27b1662706141fae500c4a9ae7978439
BLAKE2b-256 e292309bcd366a6b84a5cc2e36e42f0f168b85dacf71026dcb93a8f6e83ef4d4

See more details on using hashes here.

File details

Details for the file kea_exporter-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: kea_exporter-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.12.4 CPython/3.10.12

File hashes

Hashes for kea_exporter-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 02c73da3b6917fe631063395063e58b9b9c0f758f09a44139277b966710515e3
MD5 20f42137c777a3b5b614cc86280f46ca
BLAKE2b-256 e04b25daae241b1bb0ac7c053283604c4109bfc128d222b5fdbb991df69722f8

See more details on using hashes here.

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