wg-portal/docs/documentation/monitoring/prometheus.md
Dmytro Bondar 043d25a08f
[docs] big bang update (#348)
* [docs] big bang update

* Simplified polluted README.md by moving parts to the documentation
* Removed duplicates with `pymdownx.snippets` extension
* Enabled code copy
* Extended "Getting Started"
* Added "Monitoring" page
* Separated "Upgrade" page
* Added default config yaml to docs

Signed-off-by: Dmytro Bondar <git@bonddim.dev>

* Update sources.md

Co-authored-by: h44z <christoph.h@sprinternet.at>

---------

Signed-off-by: Dmytro Bondar <git@bonddim.dev>
Co-authored-by: h44z <christoph.h@sprinternet.at>
2025-01-23 08:06:55 +01:00

1.5 KiB

By default WG-Portal exposes Prometheus metrics on port 8787 if interface/peer statistic data collection is enabled.

Exposed Metrics

Metric Type Description
wireguard_interface_received_bytes_total gauge Bytes received through the interface.
wireguard_interface_sent_bytes_total gauge Bytes sent through the interface.
wireguard_peer_last_handshake_seconds gauge Seconds from the last handshake with the peer.
wireguard_peer_received_bytes_total gauge Bytes received from the peer.
wireguard_peer_sent_bytes_total gauge Bytes sent to the peer.
wireguard_peer_up gauge Peer connection state (boolean: 1/0).

Prometheus Config

Add following scrape job to your Prometheus config file:

# prometheus.yaml
scrape_configs:
  - job_name: wg-portal
    scrape_interval: 60s
    static_configs:
      - targets:
          - localhost:8787 # Change localhost to IP Address or hostname with WG-Portal

Grafana Dashboard

You may import dashboard.json into your Grafana instance.

Dashboard