Skip to main content

Monitoring Traefik

Traefik is recognised by its process and read through the API it already serves on the host. The agent checks that Traefik answers, reads how many HTTP routers and services it currently runs, and records the version. Nothing is installed and nothing in the Traefik configuration is touched.

How Traefik is recognised​

The traefik definition matches a running process named traefik. Every 60 seconds the agent calls three endpoints on the loopback API, http://127.0.0.1:8080/ping, /api/overview and /api/version, and reads each answer with a regular expression. The ping is the liveness check; the overview yields the router and service totals; the version endpoint yields the version fact. A host with the binary installed but not running does not match.

What is collected​

Liveness. The /ping check has to answer. Its result is the check you see on the host page, with the response time of the call.

Configuration size. The total number of HTTP routers and HTTP services Traefik has loaded, from /api/overview. A drop to zero after a deploy means the provider stopped feeding routes; a jump tells you a batch of new services registered.

Facts shown on the host page: version.

SignalMetric
HTTP routers loadedsvc.traefik.http_routers
HTTP services loadedsvc.traefik.http_services

Names, tags and units are in the metrics reference.

No log-shipping definition ships for Traefik.

Alerts out of the box​

No alert rule ships for Traefik's metrics. The one rule every service shares still applies: when the probes have not produced a successful check for six hours, the incident "monitoring cannot collect from a service" opens, so a Traefik whose API stopped answering is not silently forgotten. Either metric above can drive a custom rule in the console (for example svc.traefik.http_routers == 0 held for a few minutes), see alert rules and the rules catalog.

Limitations​

  • The probes talk to 127.0.0.1:8080. If Traefik does not expose its API and ping on that address, the checks fail and no metrics arrive; the API has to be reachable there without authentication for the calls to succeed.
  • Only the HTTP router and service totals are read. Request rates, latencies and per-router health are not collected from Traefik; its own metrics endpoint is not scraped by this definition.
  • TCP and UDP routers are not counted.
  • Traefik's logs are not shipped by the agent.
  • A Traefik running inside a container is not matched by this definition, because containers are excluded from host discovery. Container-based Traefik deployments are visible through Docker and Kubernetes monitoring at the container level.