Skip to content

Releases: wacken89/hetzner-load-balancer-prometheus-exporter

v1.5.4

29 May 11:24
24c049d

Choose a tag to compare

Robustness and modernization release. Closes #22, #23, #27, #28.

Highlights

  • No more crashes on empty metrics. The exporter used to die with IndexError when Hetzner returned an empty values: [] for any metric (common on freshly-created load balancers with no traffic). Gauges are now safely skipped on missing data instead of crashing the process.
  • No more crashes at startup on empty projects. A missing servers key in the Hetzner API response no longer takes the exporter down with KeyError: 'servers'. The server-name cache degrades gracefully to empty with a warning.
  • Python 3.12. Base image bumped from python:3.8-slim (EOL October 2024) to python:3.12-slim. Dependencies pinned with floors to keep the wheels compatible going forward.

What's new

Bug fixes

  • Fix IndexError: list index out of range on empty metric values (#27). Replaced fragile ["values"][0][1] indexing with a guarded extract_latest_metric_value() helper. When the time series is empty, missing, or malformed, the gauge is skipped for that tick — Prometheus keeps the previous sample via its normal staleness handling.
  • Fix KeyError: 'servers' at startup (#28). get_all_server_names() now tolerates responses without a servers key (empty projects, transient API hiccups) and starts with an empty server-name cache instead of crashing.
  • Fix latest-vs-first datapoint. The previous [0][1] indexing returned the oldest point in the hour-long window. Gauges now report the most recent datapoint, which matches what Prometheus expects.
  • Fix hard-coded version metric. hetzner_load_balancer_info{version="1.2.0"} was stale through every release since v1.2.0. Version is now centralized in a single constant.

Improvements

  • HTTP timeouts on every Hetzner API call. All requests.get() calls now have a 15-second timeout. Previously, a slow or unresponsive Hetzner API could hang the exporter indefinitely with no scrapes happening.
  • Halved bandwidth API calls. bandwidth.in and bandwidth.out come from the same /metrics?type=bandwidth response. The exporter now fetches it once per scrape per load balancer instead of twice — half the API traffic for the bandwidth path, easier on rate limits.
  • Centralized HTTP layer. All Hetzner API calls go through a single _api_get() function with consistent timeout, error handling, and structured logging on failures. Easier to extend and easier to debug.
  • More defensive .get() access. Optional fields (load_balancer, targets, services, health_status) are accessed with .get() defaults throughout, so partial or unexpected API responses produce warnings rather than tracebacks.
  • Stdout flushed immediately. PYTHONUNBUFFERED=1 added to the Dockerfile, so logs show up in kubectl logs and docker logs without buffering delay.

Maintenance

  • Remove unused get_server_info() (#22). Dead code; not referenced anywhere in the repo.

  • Bump base image to python:3.12-slim (#23). Python 3.8 reached end-of-life in October 2024.

  • Pin runtime dependencies to versions compatible with Python 3.12:

    • prometheus_client>=0.20.0,<1.0.0
    • requests>=2.32.0,<3.0.0
    • urllib3>=2.2.0,<3.0.0

    This avoids the ModuleNotFoundError: No module named 'urllib3.packages.six.moves' that appeared when the unpinned old urllib3<1.26 was installed under Python 3.12.

Breaking changes

None. All metric names, label sets, and environment variables are unchanged. Existing Grafana dashboards, alerting rules, and Helm values.yaml files continue to work without modification.

Behavior change worth noting

When Hetzner returns no data for a metric (e.g., a brand-new load balancer with zero traffic), the corresponding gauge is no longer set for that scrape cycle. Prometheus will report the previous value as stale after its normal staleness window (5 minutes by default) instead of 0 or a crash. This is the standard exporter pattern and matches node_exporter / kube-state-metrics behavior.

Upgrading

docker pull wacken/hetzner-load-balancer-prometheus-exporter:v1.5.4

Or in kubernetes.yaml / Helm values.yaml:

image:
  repository: wacken/hetzner-load-balancer-prometheus-exporter
  tag: v1.5.4

No configuration changes required.

Container

  • wacken/hetzner-load-balancer-prometheus-exporter:v1.5.4
  • wacken/hetzner-load-balancer-prometheus-exporter:latest
  • Base: python:3.12-slim

Contributors

Full changelog

v1.5.3...v1.5.4

v1.5.3

11 Jul 12:09
37336db

Choose a tag to compare

Fixes

Docker Images

  • docker pull wacken/hetzner-load-balancer-prometheus-exporter:v1.5.3

v1.5.2

10 Jul 15:24
8b922ef

Choose a tag to compare

Fixes

  • Hetzner API metrics fetch now uses query parameters instead of JSON body (#25 by @mbirchdk )

Docker Images

  • docker pull wacken/hetzner-load-balancer-prometheus-exporter:v1.5.2

v1.5.1

13 Mar 15:08
cdc8318

Choose a tag to compare

Features

  • Fix load balancer type detection for HTTP and HTTPS protocols (#24 by @dmitryint )

Docker Images

  • docker pull wacken/hetzner-load-balancer-prometheus-exporter:v1.5.1

hetzner-load-balancer-exporter-1.5.0

04 Oct 15:12
e51e280

Choose a tag to compare

Hetzner Load Balancer Prometheus Exporter

v1.5.0

04 Oct 14:59
fd4aa3d

Choose a tag to compare

Features

Docker Images

  • docker pull wacken/hetzner-load-balancer-prometheus-exporter:v1.5.0

hetzner-load-balancer-exporter-1.3.0

28 Jun 13:57
2301fcc

Choose a tag to compare

Hetzner Load Balancer Prometheus Exporter

v1.4.1

14 Mar 08:58
c8d8034

Choose a tag to compare

Features

Docker Images

  • docker pull wacken/hetzner-load-balancer-prometheus-exporter:v1.4.1

v1.4.0

19 Aug 07:16
6f9e410

Choose a tag to compare

Features

  • Added support for getting health metrics for load balancers with “label” targets (#17 by @dunkelbraun )

Docker Images

  • docker pull wacken/hetzner-load-balancer-prometheus-exporter:v1.4.0

v1.3.1

05 Aug 10:02
2681ef0

Choose a tag to compare

Enhancements

Docker Image Support for ARM64 Architecture (#16 by @hegerdes )

Docker Images

  • docker pull wacken/hetzner-load-balancer-prometheus-exporter:v1.3.1