A very simple tool to expose information about specific Wireguard interfaces as Prometheus metrics.
wgexporter -i [ifname] -i [ifname]Additionally, the following environment variables may be specified:
METRICS_PORT- Expose Prometheus metrics on this port. Default:9000.POLL_INTERVAL_MS- Poll interfaces for information everyxmilliseconds. Default:1000.PING_TIMEOUT_MS- Timeout for tunnel/endpoint pings. Default:1000.
You can run wgexporter in Docker or Kubernetes, but the container must either be
run as --privileged or granted the NET_ADMIN capability, and must have access to
the interface(s) you wish to monitor (e.g. by running on the host network).
For example:
docker run --cap-add NET_ADMIN --net=host ghcr.io/tehlordvortex/wgexporter -i wg0See main.rs for information about the metrics exposed.