Skip to main content

Per-Router Observability

Traefik Hub's observability features include logs, access logs, metrics, and tracing. You can configure these options globally or at more specific levels, such as per router or per entry point.

The default router observability configuration is inherited from the attached EntryPoints and can be configured with the observability options). However, a router defining its own observability configuration will opt-out from these defaults.

info

To enable router-level observability, you must first enable access-logs, tracing, and metrics.

AddInternals option

By default, and for any type of signals (access-logs, metrics and tracing), Traefik disables observability for internal resources. The observability options described below cannot interfere with the AddInternals ones, and will be ignored.

For instance, if a router exposes the api@internal service and metrics.AddInternals is false, it will never produces metrics, even if the router observability configuration enables metrics.

Configuration Options

FieldDescriptionDefaultRequired
accessLogsThe accessLogs option controls whether the router will produce access-logs.trueNo
metricsThe metrics option controls whether the router will produce metrics. See here for additional informationtrueNo
tracingThe tracing option controls whether the router will produce traces.trueNo

Metrics

The metrics option controls whether the router will produce metrics.

Metrics layers

When metrics layers are not enabled with the addEntryPointsLabels, addRoutersLabels and/or addServicesLabels options, enabling metrics for a router will not enable them.

http:
routers:
my-router:
rule: "Path(`/foo`)"
service: service-foo
observability:
metrics: false