Add Traefik Grafana dashboard #407

Merged
benvin merged 1 commits from benvin/traefik-dashboard into main 2026-08-23 21:56:45 +10:00
Member

Why

Traefik metrics (traefik_entrypoint_requests_total, traefik_service_*, etc.) are now flowing into VictoriaMetrics with the relabeled traefik_instance label, but there is no dashboard to view them.

Changes

  • Add apps/base/grafana/dashboards/traefik.yaml: GrafanaDashboard CR mirroring the redis.yaml sibling (gzipJson embed, instanceSelector dashboards: grafana, resyncPeriod: 5m, allowCrossNamespaceImport: false)
  • Embed the official Traefik Standalone dashboard (grafana.com ID 17346, revision 9), adapted:
    • strip __inputs/__requires/__elements and the DS_PROMETHEUS datasource variable
    • rewrite all prometheus datasource uids to the estate VictoriaMetrics uid det2y55dac4jkc
    • add an instance template variable over traefik_instance and filter every query with traefik_instance=~"$instance" so traefik-internal / traefik-external are switchable
    • chain the entrypoint/service variable queries through the instance filter
  • Register the dashboard in apps/base/grafana/kustomization.yaml

Validated: gzipJson decode roundtrip, kustomize build, kubeconform.

## Why Traefik metrics (traefik_entrypoint_requests_total, traefik_service_*, etc.) are now flowing into VictoriaMetrics with the relabeled `traefik_instance` label, but there is no dashboard to view them. ## Changes - Add `apps/base/grafana/dashboards/traefik.yaml`: GrafanaDashboard CR mirroring the redis.yaml sibling (gzipJson embed, `instanceSelector dashboards: grafana`, `resyncPeriod: 5m`, `allowCrossNamespaceImport: false`) - Embed the official Traefik Standalone dashboard (grafana.com ID 17346, revision 9), adapted: - strip `__inputs`/`__requires`/`__elements` and the `DS_PROMETHEUS` datasource variable - rewrite all prometheus datasource uids to the estate VictoriaMetrics uid `det2y55dac4jkc` - add an `instance` template variable over `traefik_instance` and filter every query with `traefik_instance=~"$instance"` so traefik-internal / traefik-external are switchable - chain the entrypoint/service variable queries through the instance filter - Register the dashboard in `apps/base/grafana/kustomization.yaml` Validated: gzipJson decode roundtrip, `kustomize build`, kubeconform.
unkin-agent added 1 commit 2026-08-23 21:49:24 +10:00
Add Traefik Grafana dashboard
ci/woodpecker/pr/vector-test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/kubeconform Pipeline was successful
a36dfe2c21
Official Traefik standalone dashboard (grafana.com 17346 rev 9) adapted
for the estate: datasource rewritten to VictoriaMetrics, all queries
filtered by the relabeled traefik_instance label so internal/external
proxies are switchable via a template variable.
Author
Member

Reviewed on its own merits (diff + body).

  • Atomic: yes — only apps/base/grafana/dashboards/traefik.yaml (new) + one added line in apps/base/grafana/kustomization.yaml.
  • CR shell: matches redis.yaml exactly (apiVersion, instanceSelector.matchLabels.dashboards: "grafana", resyncPeriod: 5m, allowCrossNamespaceImport: false); only metadata.name differs, as expected.
  • gzipJson: decoded (base64 + gunzip) to valid JSON. No __inputs/__requires/__elements, no leftover DS_PROMETHEUS/${DS_*} references. All datasource uids are det2y55dac4jkc (the only other uid present is the built-in -- Grafana -- annotations datasource, which is standard/expected).
  • instance variable: present (label_values(traefik_entrypoint_requests_total, traefik_instance)), and all 14 panel-target exprs contain traefik_instance=~"$instance". The entrypoint/service chained variables are also filtered through traefik_instance=~"$instance".
  • Metric names: all traefik v3-style (traefik_entrypoint_requests_total, traefik_entrypoint_request_duration_seconds_{bucket,count}, traefik_service_requests_total, traefik_service_request_duration_seconds_{bucket,count,sum}, traefik_service_requests_bytes_total, traefik_service_responses_bytes_total, traefik_open_connections, traefik_config_reloads_total).
  • kustomize build: kustomize build apps/base/grafana succeeds cleanly on the branch; new resource renders in the output; new line is correctly alphabetized in the resources list.
  • CI: latest commit statuses are all success (kubeconform, pre-commit, vector-test), matching the PR's own "CI: ✓ ✓ ✓".

VERDICT: CLEAN

Reviewed on its own merits (diff + body). - **Atomic**: yes — only `apps/base/grafana/dashboards/traefik.yaml` (new) + one added line in `apps/base/grafana/kustomization.yaml`. - **CR shell**: matches `redis.yaml` exactly (apiVersion, `instanceSelector.matchLabels.dashboards: "grafana"`, `resyncPeriod: 5m`, `allowCrossNamespaceImport: false`); only `metadata.name` differs, as expected. - **gzipJson**: decoded (base64 + gunzip) to valid JSON. No `__inputs`/`__requires`/`__elements`, no leftover `DS_PROMETHEUS`/`${DS_*}` references. All datasource uids are `det2y55dac4jkc` (the only other uid present is the built-in `-- Grafana --` annotations datasource, which is standard/expected). - **`instance` variable**: present (`label_values(traefik_entrypoint_requests_total, traefik_instance)`), and all 14 panel-target exprs contain `traefik_instance=~"$instance"`. The `entrypoint`/`service` chained variables are also filtered through `traefik_instance=~"$instance"`. - **Metric names**: all traefik v3-style (`traefik_entrypoint_requests_total`, `traefik_entrypoint_request_duration_seconds_{bucket,count}`, `traefik_service_requests_total`, `traefik_service_request_duration_seconds_{bucket,count,sum}`, `traefik_service_requests_bytes_total`, `traefik_service_responses_bytes_total`, `traefik_open_connections`, `traefik_config_reloads_total`). - **kustomize build**: `kustomize build apps/base/grafana` succeeds cleanly on the branch; new resource renders in the output; new line is correctly alphabetized in the resources list. - **CI**: latest commit statuses are all `success` (kubeconform, pre-commit, vector-test), matching the PR's own "CI: ✓ ✓ ✓". VERDICT: CLEAN
benvin merged commit 61b5a7f695 into main 2026-08-23 21:56:45 +10:00
benvin deleted branch benvin/traefik-dashboard 2026-08-23 21:56:45 +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#407