Scrape traefik gateway metrics into VictoriaMetrics #397
Reference in New Issue
Block a user
Delete Branch "benvin/traefik-scrape"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Both traefik instances (traefik-internal/traefik-external, chart 40.0.0, image v3.7.0) already expose prometheus metrics on container port
metrics(9100), but nothing scrapes them — VictoriaMetrics has no traefik series (verified empty). The observability VMAgent runs with selectAllByDefault and consumes VM*Scrape CRs only, so a VMPodScrape is all that is needed.Changes
apps/base/observability/vmpodscrape-traefik.yaml: scrapes portmetrics/metrics onapp.kubernetes.io/name: traefikpods in traefik-system, relabelingapp.kubernetes.io/instanceto a stabletraefik_instancelabel to split internal vs external seriesmetrics.prometheus.addEntryPointsLabelsandaddRoutersLabelsin both au-syd1 traefik values files for per-entrypoint/per-route dashboards (pods restart on rollout — acceptable)Validated with
kustomize build(observability base + overlay, traefik-system overlay with --enable-helm) and kubeconform (unknown CRDs skipped); rendered deployments carry the new metric flags and the VMPodScrape renders in the overlay.