feat(traefik): scrape every Traefik replica behind the metrics URL and add them up (#5844)
Through one address Steward read whichever replica answered, and with host-mode ports behind a keepalived VIP that can be the replica serving nothing: since the 18:43 restart every scrape landed on Docker03's idle Traefik, which has no traefik_service_* series, so no router was stored. A metrics_url host name that resolves to several addresses (a swarm service's tasks.<service>, a Kubernetes headless Service, round-robin DNS) is now scraped address by address, with the original Host header and TLS name. Answers from one process are kept once; a replica that doesn't answer is skipped with a warning. Requests, bytes and latency buckets are summed over the replicas that have a baseline, so the sum's rise is the sum of each one's own rise; certificates are listed once; Traefik's own figures add connections and memory and keep the newest reload. A name with one address is one scrape, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,9 @@ tags:
|
||||
- access-log
|
||||
|
||||
config:
|
||||
# A host name that resolves to several Traefiks (a swarm service's
|
||||
# tasks.<service>, a Kubernetes headless Service) is scraped address by
|
||||
# address and added up, so every replica's traffic counts.
|
||||
metrics_url: "http://localhost:8080/metrics"
|
||||
# Traefik's API, for which hosts each router serves (so a certificate's
|
||||
# expiry shows on its router). Empty: /api on the metrics URL's host.
|
||||
|
||||
Reference in New Issue
Block a user