Skip to content

lukasmetzner/hetzner-storage-box-prometheus-exporter

Repository files navigation

Hetzner Storage Box Prometheus Exporter

This exporter collects statistics from all Storage Boxes in your Hetzner Cloud project and exposes them as Prometheus metrics.

Exported Metrics

Metric Description Labels
storage_box_status Storage box status (1 = current, 0 = not). Possible status values: initializing, active, locked. storage-box, status
storage_box_stats_size Total size of the storage box (bytes used) storage-box
storage_box_stats_size_data Size of data in the storage box (bytes used) storage-box
storage_box_stats_size_snapshots Size of snapshots in the storage box (bytes used) storage-box
storage_box_type_size Total capacity of the storage box type (bytes used) storage-box

Docker Compose

services:
  storage-box-exporter:
    image: ghcr.io/lukasmetzner/hetzner-storage-box-prometheus-exporter:v0.9.0 # x-releaser-pleaser-version
    ports:
      - 2112:2112
    environment:
      HETZNER_TOKEN: $HETZNER_TOKEN
      SCRAPE_INTERVAL: "30m"
  • Metrics are available at: http://<host>:2112/metrics
  • Requires a valid Hetzner Cloud API token, set via the HETZNER_TOKEN environment variable
  • Configure the scrape interval at the Hetzner API with the environment variable SCRAPE_INTERVAL
    • Accepts values, which can be parsed by Go's time.ParseDuration()
    • Examples: 10s, 5m, 2h45m
    • Default: 30m

Helm

The chart is published as an OCI artifact to GitHub Container Registry.

Prerequisites

Create a Kubernetes Secret containing your Hetzner Cloud API token:

kubectl create secret generic hetzner --from-literal=token=<YOUR_HETZNER_TOKEN>

Install

helm install storage-box-exporter oci://ghcr.io/lukasmetzner/charts/hetzner-storage-box-prometheus-exporter --version 0.9.0 # x-releaser-pleaser-version

Values

Key Description Default
replicaCount Number of replicas 1
image.repository Container image repository ghcr.io/lukasmetzner/hetzner-storage-box-prometheus-exporter
image.tag Image tag (defaults to chart appVersion) ""
image.pullPolicy Image pull policy IfNotPresent
secret.name Name of existing Secret with the Hetzner API token "hetzner"
secret.key Key inside the Secret "token"
scrapeInterval Hetzner API scrape interval "30m"
resources Container resource requests/limits {}
serviceMonitor.enabled Deploy a ServiceMonitor for kube-prometheus-stack false
serviceMonitor.interval Prometheus scrape interval "1m"
serviceMonitor.scrapeTimeout Prometheus scrape timeout "30s"
serviceMonitor.additionalLabels Extra labels on the ServiceMonitor {}

Note

serviceMonitor.enabled: true requires the kube-prometheus-stack CRDs to be installed in your cluster.

About

Prometheus exporter for collecting metrics from all Storage Boxes in a Hetzner Cloud project.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors