Scrape traefik gateway metrics into VictoriaMetrics
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.
This commit is contained in:
@@ -9,3 +9,4 @@ resources:
|
||||
- gateway.yaml
|
||||
- httproute.yaml
|
||||
- vmpodscrape-cnpg.yaml
|
||||
- vmpodscrape-traefik.yaml
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
# Scrape metrics (:9100) from the traefik-internal and traefik-external gateway
|
||||
# pods. Picked up by the observability VMAgent (selectAllByDefault). The
|
||||
# app.kubernetes.io/instance pod label is kept as traefik_instance so series
|
||||
# from the two releases stay distinguishable.
|
||||
apiVersion: operator.victoriametrics.com/v1beta1
|
||||
kind: VMPodScrape
|
||||
metadata:
|
||||
name: traefik
|
||||
namespace: observability
|
||||
spec:
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- traefik-system
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: traefik
|
||||
podMetricsEndpoints:
|
||||
- port: metrics
|
||||
path: /metrics
|
||||
relabelConfigs:
|
||||
- sourceLabels: [__meta_kubernetes_pod_label_app_kubernetes_io_instance]
|
||||
targetLabel: traefik_instance
|
||||
@@ -29,6 +29,11 @@ providers:
|
||||
nativeLBByDefault: false
|
||||
labelSelector: "traefik.io/instance=external"
|
||||
|
||||
metrics:
|
||||
prometheus:
|
||||
addEntryPointsLabels: true
|
||||
addRoutersLabels: true
|
||||
|
||||
logs:
|
||||
access:
|
||||
enabled: true
|
||||
|
||||
@@ -29,6 +29,11 @@ providers:
|
||||
nativeLBByDefault: false
|
||||
labelSelector: "traefik.io/instance=internal"
|
||||
|
||||
metrics:
|
||||
prometheus:
|
||||
addEntryPointsLabels: true
|
||||
addRoutersLabels: true
|
||||
|
||||
logs:
|
||||
access:
|
||||
enabled: true
|
||||
|
||||
Reference in New Issue
Block a user