Web / Traefik Interview questions
How does Traefik expose metrics for Prometheus scraping?
When the Prometheus metrics provider is enabled in the static configuration, Traefik exposes a /metrics endpoint (served on a dedicated entrypoint, by default) in the Prometheus exposition format.
metrics: prometheus: entryPoint: metrics addEntryPointsLabels: true addServicesLabels: true
The exposed metrics cover request counts and durations by router, service, and entrypoint (traefik_router_requests_total, traefik_service_request_duration_seconds, and similar), open connections, TLS certificate expiry, and Traefik's own configuration reload counters.
A Prometheus server then scrapes that endpoint on an interval, and because the metric labels include the specific router and service names, an operator can build dashboards that break down latency or error rate per individual route rather than only seeing an aggregate across the whole proxy.
Traefik also supports StatsD, Datadog, and InfluxDB as alternative metrics backends configured the same way, so teams that haven't standardized on Prometheus can still get equivalent visibility without changing how routers or services are defined.
More Related questions...