Scrape traefik gateway metrics into VictoriaMetrics #397

Merged
benvin merged 1 commits from benvin/traefik-scrape into main 2026-08-23 12:41:58 +10:00
Member

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

  • Adds apps/base/observability/vmpodscrape-traefik.yaml: scrapes port metrics /metrics on app.kubernetes.io/name: traefik pods in traefik-system, relabeling app.kubernetes.io/instance to a stable traefik_instance label to split internal vs external series
  • Registers the new CR in the observability base kustomization
  • Enables metrics.prometheus.addEntryPointsLabels and addRoutersLabels in 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.

## 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 - Adds `apps/base/observability/vmpodscrape-traefik.yaml`: scrapes port `metrics` /metrics on `app.kubernetes.io/name: traefik` pods in traefik-system, relabeling `app.kubernetes.io/instance` to a stable `traefik_instance` label to split internal vs external series - Registers the new CR in the observability base kustomization - Enables `metrics.prometheus.addEntryPointsLabels` and `addRoutersLabels` in 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.
unkin-agent added 1 commit 2026-08-23 12:35:43 +10:00
Scrape traefik gateway metrics into VictoriaMetrics
ci/woodpecker/pr/vector-test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/kubeconform Pipeline was successful
644b42206f
Both traefik instances already expose prometheus metrics on :9100 but
nothing scrapes them. Adds a VMPodScrape for traefik-system and enables
entrypoint/router labels for per-route dashboards.
benvin merged commit ba71bd1a35 into main 2026-08-23 12:41:58 +10:00
benvin deleted branch benvin/traefik-scrape 2026-08-23 12:41:58 +10:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/argocd-apps#397