docs(metrics): add README section, testData, and a scrape example

The metrics feature shipped in code only: no README section, no
metrics block in .traefik.yml testData, nothing under examples/. The
Go doc comments were the entire manual for a human operator or a
config-generating assistant.

Add a README Metrics section covering the served path, both auth
modes (admin bearer token, optional CIDR allowlist), the CIDR-sizing
warning with the live-reproduced SNAT failure mode, the modelLabel
cardinality trade-off, the exposed metric families, the cross-replica
aggregation contract, label escaping, and store-outage behaviour. Add
a MetricsConfig reference table matching the existing AdminConfig
one, and a metrics row in the top-level Config table.

Add metrics: {enabled: true} to .traefik.yml's testData, the
catalog-facing smoke-test config, deliberately without allowedCIDRs
so a copy-pasted example never skips the README's own sizing
guidance.

Add a metrics block to the Kubernetes Middleware example and a
VMServiceScrape resource: the target cluster runs VictoriaMetrics, not
Prometheus, so the CRD differs even though the exposition format does
not. Verified the VMServiceScrape shape (apiVersion, selector,
endpoints, path) against the victoriametrics/operator documentation
rather than assuming it. Notes that /metrics is served by Traefik
itself, not by any backend service, since this middleware intercepts
the path before a backend is ever reached.
This commit is contained in:
2026-08-23 00:59:13 +01:00
parent 244dd6185f
commit 935df1a3f0
3 changed files with 204 additions and 0 deletions
+7
View File
@@ -28,3 +28,10 @@ testData:
- name: tester
group: default
apiKey: test-user-key
# Prometheus text-exposition endpoint — see README.md#metrics. No
# allowedCIDRs here deliberately: this is the catalog-facing smoke-test
# config, and README.md#metrics has the full CIDR-sizing guidance
# (narrowest block only, never a whole RFC1918 range) that a
# copy-pasted example here would risk skipping past.
metrics:
enabled: true