diff options
| author | Denys Fedoryshchenko <denys.f@collabora.com> | 2026-05-14 01:55:59 +0300 |
|---|---|---|
| committer | Denys Fedoryshchenko <denys.f@collabora.com> | 2026-05-14 10:04:56 +0300 |
| commit | a0985c42f307e5137f9afa57edae219f7300211b (patch) | |
| tree | a9472b9bdbf31036857ae7d9798299fdec8761ed | |
| parent | 5358369d7b7965deda010267076b25e25c4c044a (diff) | |
| download | accel-ppp-a0985c42f307e5137f9afa57edae219f7300211b.tar.gz accel-ppp-a0985c42f307e5137f9afa57edae219f7300211b.zip | |
metrics: document module in conf, manpage, and CHANGELOG
Add a commented `[metrics]` block to the example accel-ppp.conf and a
matching `#metrics` entry in the [modules] list so operators see the
feature when reading the sample config. Document the section in
accel-ppp.conf(5) next to [connlimit]: the format/address/allowed_ips
options, the path/method behaviour, and how the ACL accepts either
the bracketed or bare comma-separated form. Add an Unreleased entry
to CHANGELOG.md announcing the module.
Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
| -rw-r--r-- | CHANGELOG.md | 5 | ||||
| -rw-r--r-- | accel-pppd/accel-ppp.conf | 8 | ||||
| -rw-r--r-- | accel-pppd/accel-ppp.conf.5 | 35 |
3 files changed, 48 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index dca711a8..cbce9ec7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Unreleased + +### Features +- New `metrics` module: HTTP endpoint exposing the same numbers as `accel-cmd show stat` at `/metrics`, in either Prometheus exposition or JSON format. Configurable listen address and optional IPv4 CIDR allow-list. + ## 1.14.0 - 2026-01-24 ### Breaking / Compatibility diff --git a/accel-pppd/accel-ppp.conf b/accel-pppd/accel-ppp.conf index 329c3adc..f9c5245b 100644 --- a/accel-pppd/accel-ppp.conf +++ b/accel-pppd/accel-ppp.conf @@ -27,6 +27,7 @@ pppd_compat #shaper #net-snmp #logwtmp +#metrics #ipv6_nd @@ -317,6 +318,13 @@ limit=10/min burst=3 timeout=60 +#[metrics] +# Exposes daemon statistics over HTTP. Same numbers as "accel-cmd show stat". +# Enable by adding "metrics" to [modules] above. +#format=prometheus +#address=127.0.0.1:8080 +#allowed_ips=["127.0.0.1/32"] + [ipv6-pool] #gw-ip6-address=fc00:0:1::1 #vendor= diff --git a/accel-pppd/accel-ppp.conf.5 b/accel-pppd/accel-ppp.conf.5 index cefc74ed..feb9214e 100644 --- a/accel-pppd/accel-ppp.conf.5 +++ b/accel-pppd/accel-ppp.conf.5 @@ -1293,6 +1293,41 @@ Specifies which Radius attribute contains stateful address pool name. .TP .BI "vendor=" vendor If attribute is vendor-specific then specify vendor name in this option. +.SH [metrics] +.br +Exposes daemon statistics over HTTP. Requires the +.B metrics +module to be listed in the +.B [modules] +section. The same numbers shown by +.B "accel-cmd show stat" +are returned for every GET on +.B /metrics +\&. Any other path responds with 404, and any method other than GET +responds with 405. +.TP +.BI "format=" prometheus|json +Selects the body format. Defaults to +.BR prometheus . +.TP +.BI "address=" host:port +IPv4 listen address. Required. Use +.BR 0.0.0.0:8080 +to listen on all interfaces. +.TP +.BI "allowed_ips=" cidr_list +Optional comma-separated list of IPv4 CIDR entries permitted to fetch +metrics. The bracketed form +.RB "\fBallowed_ips = [\(dq" "1.2.3.4/32" "\(dq, \(dq" "5.6.7.0/24" "\(dq]\fR" +and the bare form +.B "1.2.3.4/32,5.6.7.0/24" +are both accepted. A bare address without a prefix length is treated +as +.BR /32 . +When the option is missing or empty, all peers are allowed. Peers +that do not match a CIDR have their connection closed immediately +after +.BR accept (2). .SH [connlimit] .br This module limits connection rate from single source. |
