Metrics¶
Traefik provides metrics in the OpenTelemetry format as well as the following vendor specific backends:
Traefik Proxy has an official Grafana dashboard for both on-premises and Kubernetes deployments.
Open Telemetry¶
Default protocol
The OpenTelemetry exporter will export metrics to the collector using HTTP by default to https://localhost:4318.
Configuration Example¶
To enable the OpenTelemetry metrics:
metrics:
otlp: {}[metrics]
[metrics.otlp]--metrics.otlp=true# values.yaml
metrics:
# Disable Prometheus (enabled by default)
prometheus: null
# Enable providing OTel metrics
otlp:
enabled: true
http:
enabled: trueHelm Chart Configuration
Traefik can be configured to provide metrics in the OpenTelemetry format using the Helm Chart values.
To know more about the Helm Chart options, refer to the Helm Chart (Find options metrics.otlp).
Configuration Options¶
| Field | Description | Default | Required |
|---|---|---|---|
metrics.addInternals |
Enables metrics for internal resources (e.g.: ping@internal). |
false | No |
metrics.otlp.serviceName |
Defines the service name resource attribute. | "traefik" | No |
metrics.otlp.resourceAttributes |
Defines additional resource attributes to be sent to the collector. See resourceAttributes for details. | [] | No |
metrics.otlp.addEntryPointsLabels |
Enable metrics on entry points. | true | No |
metrics.otlp.addRoutersLabels |
Enable metrics on routers. | false | No |
metrics.otlp.addServicesLabels |
Enable metrics on services. | true | No |
metrics.otlp.enableTCPRouterMetrics |
Enable metrics on the connections handled by TCP routers. | false | No |
metrics.otlp.explicitBoundaries |
Explicit boundaries for Histogram data points. Only applies to explicit bucket histogram exports. |
".005, .01, .025, .05, .075, .1, .25, .5, .75, 1, 2.5, 5, 7.5, 10" | No |
metrics.otlp.pushInterval |
Interval at which metrics are sent to the OpenTelemetry Collector. | 10s | No |
metrics.otlp.http |
This instructs the exporter to send the metrics to the OpenTelemetry Collector using HTTP. Setting the sub-options with their default values. |
null/false | No |
metrics.otlp.http.endpoint |
URL of the OpenTelemetry Collector to send metrics to. Format=" <scheme>://<host>:<port><path>" |
"https://localhost:4318" | Yes |
metrics.otlp.http.headers |
Additional headers sent with metrics by the exporter to the OpenTelemetry Collector. | - | No |
metrics.otlp.http.tls.ca |
Path to the certificate authority used for the secure connection to the OpenTelemetry Collector, it defaults to the system bundle. |
"" | No |
metrics.otlp.http.tls.cert |
Path to the public certificate used for the secure connection to the OpenTelemetry Collector. When using this option, setting the key option is required. |
"" | No |
metrics.otlp.http.tls.key |
Defines the path to the private key used for the TLS connection. | "" | No |
metrics.otlp.http.tls.insecureskipverify |
Allow the TLS connection to the OpenTelemetry Collector accepts any certificate presented by the server regardless of the hostnames it covers. | false | Yes |
metrics.otlp.grpc |
This instructs the exporter to send metrics to the OpenTelemetry Collector using gRPC. | null/false | No |
metrics.otlp.grpc.endpoint |
Address of the OpenTelemetry Collector to send metrics to. Format=" <host>:<port>" |
"localhost:4317" | Yes |
metrics.otlp.grpc.headers |
Additional headers sent with metrics by the exporter to the OpenTelemetry Collector. | - | No |
metrics.otlp.grpc.insecure |
Allows exporter to send metrics to the OpenTelemetry Collector without using a secured protocol. | false | Yes |
metrics.otlp.grpc.tls.ca |
Path to the certificate authority used for the secure connection to the OpenTelemetry Collector, it defaults to the system bundle. |
- | No |
metrics.otlp.grpc.tls.cert |
Path to the public certificate used for the secure connection to the OpenTelemetry Collector. When using this option, setting the key option is required. |
- | No |
metrics.otlp.grpc.tls.key |
Defines the path to the private key used for the TLS connection. | - | No |
metrics.otlp.grpc.tls.insecureskipverify |
Allow the TLS connection to the OpenTelemetry Collector accepts any certificate presented by the server regardless of the hostnames it covers. | false | Yes |
resourceAttributes¶
The resourceAttributes option allows setting the resource attributes sent along the traces.
Traefik also supports the OTEL_RESOURCE_ATTRIBUTES env variable to set up the resource attributes.
Kubernetes Resource Attributes Detection
Additionally, Traefik automatically discovers the following Kubernetes resource attributes when running in a Kubernetes cluster:
k8s.namespace.namek8s.pod.uidk8s.pod.name
Note that this automatic detection can fail, like if the Traefik pod is running in host network mode. In this case, you should provide the attributes with the option or the env variable.
Vendors¶
Datadog¶
Configuration Example¶
To enable the Datadog:
metrics:
datadog: {}[metrics]
[metrics.datadog]--metrics.datadog=trueConfiguration Options¶
| Field | Description | Default | Required |
|---|---|---|---|
metrics.addInternals |
Enables metrics for internal resources (e.g.: ping@internal). |
false | No |
datadog.address |
Defines the address for the exporter to send metrics to datadog-agent. More information here | localhost:8125 |
Yes |
datadog.addEntryPointsLabels |
Enable metrics on entry points. | true | No |
datadog.addRoutersLabels |
Enable metrics on routers. | false | No |
datadog.addServicesLabels |
Enable metrics on services. | true | No |
datadog.enableTCPRouterMetrics |
Enable metrics on the connections handled by TCP routers. | false | No |
datadog.pushInterval |
Defines the interval used by the exporter to push metrics to datadog-agent. | 10s | No |
datadog.prefix |
Defines the prefix to use for metrics collection. | "traefik" | No |
address¶
Address instructs exporter to send metrics to datadog-agent at this address.
This address can be a Unix Domain Socket (UDS) in the following format: unix:///path/to/datadog.socket.
When the prefix is set to unix, the socket type will be automatically determined.
To explicitly define the socket type and avoid automatic detection, you can use the prefixes unixgram for SOCK_DGRAM (datagram sockets) and unixstream for SOCK_STREAM (stream sockets), respectively.
metrics:
datadog:
address: localhost:8125[metrics]
[metrics.datadog]
address = "localhost:8125"--metrics.datadog.address=localhost:8125InfluxDB v2¶
Configuration Example¶
To enable the InfluxDB2:
metrics:
influxDB2:
address: http://localhost:8086[metrics]
[metrics.influxDB2]
address = "http://localhost:8086"--metrics.influxdb2=trueConfiguration Options¶
| Field | Description | Default | Required |
|---|---|---|---|
metrics.addInternals |
Enables metrics for internal resources (e.g.: ping@internal). |
false | No |
metrics.influxDB2.addEntryPointsLabels |
Enable metrics on entry points. | true | No |
metrics.influxDB2.addRoutersLabels |
Enable metrics on routers. | false | No |
metrics.influxDB2.addServicesLabels |
Enable metrics on services. | true | No |
metrics.influxDB2.enableTCPRouterMetrics |
Enable metrics on the connections handled by TCP routers. | false | No |
metrics.influxDB2.additionalLabels |
Additional labels (InfluxDB tags) on all metrics. | - | No |
metrics.influxDB2.pushInterval |
The interval used by the exporter to push metrics to InfluxDB server. | 10s | No |
metrics.influxDB2.address |
Address of the InfluxDB v2 instance. | "http://localhost:8086" | Yes |
metrics.influxDB2.token |
Token with which to connect to InfluxDB v2. | - | Yes |
metrics.influxDB2.org |
Organisation where metrics will be stored. | - | Yes |
metrics.influxDB2.bucket |
Bucket where metrics will be stored. | - | Yes |
Prometheus¶
Configuration Example¶
To enable the Prometheus:
metrics:
prometheus:
buckets:
- 0.1
- 0.3
- 1.2
- 5.0[metrics]
[metrics.prometheus]
buckets = [0.1, 0.3, 1.2, 5.0]--metrics.prometheus=trueConfiguration Options¶
| Field | Description | Default | Required |
|---|---|---|---|
metrics.addInternals |
Enables metrics for internal resources (e.g.: ping@internals). |
false | No |
metrics.prometheus.addEntryPointsLabels |
Enable metrics on entry points. | true | No |
metrics.prometheus.addRoutersLabels |
Enable metrics on routers. | false | No |
metrics.prometheus.addServicesLabels |
Enable metrics on services. | true | No |
metrics.prometheus.enableTCPRouterMetrics |
Enable metrics on the connections handled by TCP routers. | false | No |
metrics.prometheus.buckets |
Buckets for latency metrics. | "0.100000, 0.300000, 1.200000, 5.000000" | No |
metrics.prometheus.manualRouting |
Set to true, it disables the default internal router in order to allow creating a custom router for the prometheus@internal service. |
false | No |
metrics.prometheus.entryPoint |
Traefik Entrypoint name used to expose metrics. | "traefik" | No |
metrics.prometheus.headerLabels |
Defines extra labels extracted from request headers for the requests_total metrics.More information here. |
Yes |
headerLabels¶
Defines the extra labels for the requests_total metrics, and for each of them, the request header containing the value for this label.
If the header is not present in the request it will be added nonetheless with an empty value.
The label must be a valid label name for Prometheus metrics, otherwise, the Prometheus metrics provider will fail to serve any Traefik-related metric.
How to provide the Host header value
The Host header is never present in the Header map of a request, as per go documentation says:
// For incoming requests, the Host header is promoted to the
// Request.Host field and removed from the Header map.
As a workaround, to obtain the Host of a request as a label, use instead the X-Forwarded-Host header.
Configuration Example¶
Here is an example of the entryPoint requests_total metric with an additional "useragent" label.
When configuring the label in Static Configuration:
# static_configuration.yaml
metrics:
prometheus:
headerLabels:
useragent: User-Agentcurl -H "User-Agent: foobar" http://localhosttraefik_entrypoint_requests_total\{code="200",entrypoint="web",method="GET",protocol="http",useragent="foobar"\} 1StatsD¶
Configuration Example¶
To enable the Statsd:
metrics:
statsD:
address: localhost:8125[metrics]
[metrics.statsD]
address = "localhost:8125"--metrics.statsd=trueConfiguration Options¶
| Field | Description | Default | Required |
|---|---|---|---|
metrics.addInternals |
Enables metrics for internal resources (e.g.: ping@internals). |
false | No |
metrics.statsD.addEntryPointsLabels |
Enable metrics on entry points. | true | No |
metrics.statsD.addRoutersLabels |
Enable metrics on routers. | false | No |
metrics.statsD.addServicesLabels |
Enable metrics on services. | true | No |
metrics.statsD.enableTCPRouterMetrics |
Enable metrics on the connections handled by TCP routers. | false | No |
metrics.statsD.pushInterval |
The interval used by the exporter to push metrics to StatsD server. | 10s | No |
metrics.statsD.address |
Address instructs exporter to send metrics to statsd at this address. | "localhost:8125" | Yes |
metrics.statsD.prefix |
The prefix to use for metrics collection. | "traefik" | No |
Metrics Provided¶
Global Metrics¶
| Metric | Type | Labels | Description |
|---|---|---|---|
traefik_config_reloads_total |
Count | The total count of configuration reloads. | |
traefik_config_last_reload_success |
Gauge | The timestamp of the last configuration reload success. | |
traefik_open_connections |
Gauge | entrypoint, protocol |
The current count of open connections, by entrypoint and protocol. |
traefik_tls_certs_not_after |
Gauge | The expiration date of certificates. |
| Metric | Type | Labels | Description |
|---|---|---|---|
traefik_config_reloads_total |
Count | The total count of configuration reloads. | |
traefik_config_last_reload_success |
Gauge | The timestamp of the last configuration reload success. | |
traefik_open_connections |
Gauge | entrypoint, protocol |
The current count of open connections, by entrypoint and protocol. |
traefik_tls_certs_not_after |
Gauge | The expiration date of certificates. |
| Metric | Type | Labels | Description |
|---|---|---|---|
config.reload.total |
Count | The total count of configuration reloads. | |
config.reload.lastSuccessTimestamp |
Gauge | The timestamp of the last configuration reload success. | |
open.connections |
Gauge | entrypoint, protocol |
The current count of open connections, by entrypoint and protocol. |
tls.certs.notAfterTimestamp |
Gauge | The expiration date of certificates. |
| Metric | Type | Labels | Description |
|---|---|---|---|
traefik.config.reload.total |
Count | The total count of configuration reloads. | |
traefik.config.reload.lastSuccessTimestamp |
Gauge | The timestamp of the last configuration reload success. | |
traefik.open.connections |
Gauge | entrypoint, protocol |
The current count of open connections, by entrypoint and protocol. |
traefik.tls.certs.notAfterTimestamp |
Gauge | The expiration date of certificates. |
| Metric | Type | Labels | Description |
|---|---|---|---|
{prefix}.config.reload.total |
Count | The total count of configuration reloads. | |
{prefix}.config.reload.lastSuccessTimestamp |
Gauge | The timestamp of the last configuration reload success. | |
{prefix}.open.connections |
Gauge | The current count of open connections, over all the entrypoints. | |
{prefix}.tls.certs.notAfterTimestamp |
Gauge | The expiration date of certificates. |
{prefix} Default Value
By default, {prefix} value is traefik.
Labels¶
Here is a comprehensive list of labels that are provided by the global metrics:
| Label | Description | example |
|---|---|---|
entrypoint |
Entrypoint that handled the connection | "example_entrypoint" |
protocol |
Transport protocol of the entrypoint, TCP for all the connections of a TCP entrypoint, HTTP ones included |
"TCP" |
OpenTelemetry Semantic Conventions¶
Traefik Proxy follows official OpenTelemetry semantic conventions v1.23.1.
HTTP Server¶
| Metric | Type | Labels | Description |
|---|---|---|---|
http.server.request.duration |
Histogram | error.type, http.request.method, http.response.status_code, network.protocol.name, server.address, server.port, url.scheme |
Duration of HTTP server requests |
Labels¶
Here is a comprehensive list of labels that are provided by the metrics:
| Label | Description | example |
|---|---|---|
error.type |
Describes a class of error the operation ended with | "500" |
http.request.method |
HTTP request method | "GET" |
http.response.status_code |
HTTP response status code | "200" |
network.protocol.name |
OSI application layer or non-OSI equivalent | "http/1.1" |
network.protocol.version |
Version of the protocol specified in network.protocol.name |
"1.1" |
server.address |
Name of the local HTTP server that received the request | "example.com" |
server.port |
Port of the local HTTP server that received the request | "80" |
url.scheme |
The URI scheme component identifying the used protocol | "http" |
HTTP Client¶
| Metric | Type | Labels | Description |
|---|---|---|---|
http.client.request.duration |
Histogram | error.type, http.request.method, http.response.status_code, network.protocol.name, server.address, server.port, url.scheme |
Duration of HTTP client requests |
Labels¶
Here is a comprehensive list of labels that are provided by the metrics:
| Label | Description | example |
|---|---|---|
error.type |
Describes a class of error the operation ended with | "500" |
http.request.method |
HTTP request method | "GET" |
http.response.status_code |
HTTP response status code | "200" |
network.protocol.name |
OSI application layer or non-OSI equivalent | "http/1.1" |
network.protocol.version |
Version of the protocol specified in network.protocol.name |
"1.1" |
server.address |
Name of the local HTTP server that received the request | "example.com" |
server.port |
Port of the local HTTP server that received the request | "80" |
url.scheme |
The URI scheme component identifying the used protocol | "http" |
HTTP Metrics¶
On top of the official OpenTelemetry semantic conventions, Traefik provides its own metrics to monitor the incoming traffic.
EntryPoint Metrics¶
| Metric | Type | Labels | Description |
|---|---|---|---|
traefik_entrypoint_requests_total |
Count | code, method, protocol, entrypoint |
The total count of HTTP requests received by an entrypoint. |
traefik_entrypoint_requests_tls_total |
Count | tls_version, tls_cipher, entrypoint |
The total count of HTTPS requests received by an entrypoint. |
traefik_entrypoint_request_duration_seconds |
Histogram | code, method, protocol, entrypoint |
Request processing duration histogram on an entrypoint. |
traefik_entrypoint_requests_bytes_total |
Count | code, method, protocol, entrypoint |
The total size of HTTP requests in bytes handled by an entrypoint. |
traefik_entrypoint_responses_bytes_total |
Count | code, method, protocol, entrypoint |
The total size of HTTP responses in bytes handled by an entrypoint. |
| Metric | Type | Labels | Description |
|---|---|---|---|
traefik_entrypoint_requests_total |
Count | code, method, protocol, entrypoint |
The total count of HTTP requests received by an entrypoint. |
traefik_entrypoint_requests_tls_total |
Count | tls_version, tls_cipher, entrypoint |
The total count of HTTPS requests received by an entrypoint. |
traefik_entrypoint_request_duration_seconds |
Histogram | code, method, protocol, entrypoint |
Request processing duration histogram on an entrypoint. |
traefik_entrypoint_requests_bytes_total |
Count | code, method, protocol, entrypoint |
The total size of HTTP requests in bytes handled by an entrypoint. |
traefik_entrypoint_responses_bytes_total |
Count | code, method, protocol, entrypoint |
The total size of HTTP responses in bytes handled by an entrypoint. |
| Metric | Type | Labels | Description |
|---|---|---|---|
entrypoint.requests.total |
Count | code, method, protocol, entrypoint |
The total count of HTTP requests received by an entrypoint. |
entrypoint.requests.tls.total |
Count | tls_version, tls_cipher, entrypoint |
The total count of HTTPS requests received by an entrypoint. |
entrypoint.request.duration.seconds |
Histogram | code, method, protocol, entrypoint |
Request processing duration histogram on an entrypoint. |
entrypoint.requests.bytes.total |
Count | code, method, protocol, entrypoint |
The total size of HTTP requests in bytes handled by an entrypoint. |
entrypoint.responses.bytes.total |
Count | code, method, protocol, entrypoint |
The total size of HTTP responses in bytes handled by an entrypoint. |
| Metric | Type | Labels | Description |
|---|---|---|---|
traefik.entrypoint.requests.total |
Count | code, method, protocol, entrypoint |
The total count of HTTP requests received by an entrypoint. |
traefik.entrypoint.requests.tls.total |
Count | tls_version, tls_cipher, entrypoint |
The total count of HTTPS requests received by an entrypoint. |
traefik.entrypoint.request.duration.seconds |
Histogram | code, method, protocol, entrypoint |
Request processing duration histogram on an entrypoint. |
traefik.entrypoint.requests.bytes.total |
Count | code, method, protocol, entrypoint |
The total size of HTTP requests in bytes handled by an entrypoint. |
traefik.entrypoint.responses.bytes.total |
Count | code, method, protocol, entrypoint |
The total size of HTTP responses in bytes handled by an entrypoint. |
| Metric | Type | Labels | Description |
|---|---|---|---|
{prefix}.entrypoint.requests.total |
Count | code, method, protocol, entrypoint |
The total count of HTTP requests received by an entrypoint. |
{prefix}.entrypoint.requests.tls.total |
Count | tls_version, tls_cipher, entrypoint |
The total count of HTTPS requests received by an entrypoint. |
{prefix}.entrypoint.request.duration.seconds |
Histogram | code, method, protocol, entrypoint |
Request processing duration histogram on an entrypoint. |
{prefix}.entrypoint.requests.bytes.total |
Count | code, method, protocol, entrypoint |
The total size of HTTP requests in bytes handled by an entrypoint. |
{prefix}.entrypoint.responses.bytes.total |
Count | code, method, protocol, entrypoint |
The total size of HTTP responses in bytes handled by an entrypoint. |
{prefix} Default Value
By default, {prefix} value is traefik.
Router Metrics¶
| Metric | Type | Labels | Description |
|---|---|---|---|
traefik_router_requests_total |
Count | code, method, protocol, router, service |
The total count of HTTP requests handled by a router. |
traefik_router_requests_tls_total |
Count | tls_version, tls_cipher, router, service |
The total count of HTTPS requests handled by a router. |
traefik_router_request_duration_seconds |
Histogram | code, method, protocol, router, service |
Request processing duration histogram on a router. |
traefik_router_requests_bytes_total |
Count | code, method, protocol, router, service |
The total size of HTTP requests in bytes handled by a router. |
traefik_router_responses_bytes_total |
Count | code, method, protocol, router, service |
The total size of HTTP responses in bytes handled by a router. |
| Metric | Type | Labels | Description |
|---|---|---|---|
traefik_router_requests_total |
Count | code, method, protocol, router, service |
The total count of HTTP requests handled by a router. |
traefik_router_requests_tls_total |
Count | tls_version, tls_cipher, router, service |
The total count of HTTPS requests handled by a router. |
traefik_router_request_duration_seconds |
Histogram | code, method, protocol, router, service |
Request processing duration histogram on a router. |
traefik_router_requests_bytes_total |
Count | code, method, protocol, router, service |
The total size of HTTP requests in bytes handled by a router. |
traefik_router_responses_bytes_total |
Count | code, method, protocol, router, service |
The total size of HTTP responses in bytes handled by a router. |
| Metric | Type | Labels | Description |
|---|---|---|---|
router.requests.total |
Count | code, method, protocol, router, service |
The total count of HTTP requests handled by a router. |
router.requests.tls.total |
Count | tls_version, tls_cipher, router, service |
The total count of HTTPS requests handled by a router. |
router.request.duration.seconds |
Histogram | code, method, protocol, router, service |
Request processing duration histogram on a router. |
router.requests.bytes.total |
Count | code, method, protocol, router, service |
The total size of HTTP requests in bytes handled by a router. |
router.responses.bytes.total |
Count | code, method, protocol, router, service |
The total size of HTTP responses in bytes handled by a router. |
| Metric | Type | Labels | Description |
|---|---|---|---|
traefik.router.requests.total |
Count | code, method, protocol, router, service |
The total count of HTTP requests handled by a router. |
traefik.router.requests.tls.total |
Count | tls_version, tls_cipher, router, service |
The total count of HTTPS requests handled by a router. |
traefik.router.request.duration.seconds |
Histogram | code, method, protocol, router, service |
Request processing duration histogram on a router. |
traefik.router.requests.bytes.total |
Count | code, method, protocol, router, service |
The total size of HTTP requests in bytes handled by a router. |
traefik.router.responses.bytes.total |
Count | code, method, protocol, router, service |
The total size of HTTP responses in bytes handled by a router. |
| Metric | Type | Labels | Description |
|---|---|---|---|
{prefix}.router.requests.total |
Count | code, method, protocol, router, service |
The total count of HTTP requests handled by a router. |
{prefix}.router.requests.tls.total |
Count | tls_version, tls_cipher, router, service |
The total count of HTTPS requests handled by a router. |
{prefix}.router.request.duration.seconds |
Histogram | code, method, protocol, router, service |
Request processing duration histogram on a router. |
{prefix}.router.requests.bytes.total |
Count | code, method, protocol, router, service |
The total size of HTTP requests in bytes handled by a router. |
{prefix}.router.responses.bytes.total |
Count | code, method, protocol, router, service |
The total size of HTTP responses in bytes handled by a router. |
{prefix} Default Value
By default, {prefix} value is traefik.
Service Metrics¶
| Metric | Type | Labels | Description |
|---|---|---|---|
traefik_service_requests_total |
Count | code, method, protocol, service |
The total count of HTTP requests processed on a service. |
traefik_service_requests_tls_total |
Count | tls_version, tls_cipher, service |
The total count of HTTPS requests processed on a service. |
traefik_service_request_duration_seconds |
Histogram | code, method, protocol, service |
Request processing duration histogram on a service. |
traefik_service_retries_total |
Count | service |
The count of requests retries on a service. |
traefik_service_server_up |
Gauge | service, url |
Current service's server status, 0 for a down or 1 for up. Only for services configured with healthcheck. |
traefik_service_requests_bytes_total |
Count | code, method, protocol, service |
The total size of requests in bytes received by a service. |
traefik_service_responses_bytes_total |
Count | code, method, protocol, service |
The total size of responses in bytes returned by a service. |
| Metric | Type | Labels | Description |
|---|---|---|---|
traefik_service_requests_total |
Count | code, method, protocol, service |
The total count of HTTP requests processed on a service. |
traefik_service_requests_tls_total |
Count | tls_version, tls_cipher, service |
The total count of HTTPS requests processed on a service. |
traefik_service_request_duration_seconds |
Histogram | code, method, protocol, service |
Request processing duration histogram on a service. |
traefik_service_retries_total |
Count | service |
The count of requests retries on a service. |
traefik_service_server_up |
Gauge | service, url |
Current service's server status, 0 for a down or 1 for up. Only for services configured with healthcheck. |
traefik_service_requests_bytes_total |
Count | code, method, protocol, service |
The total size of requests in bytes received by a service. |
traefik_service_responses_bytes_total |
Count | code, method, protocol, service |
The total size of responses in bytes returned by a service. |
| Metric | Type | Labels | Description |
|---|---|---|---|
service.requests.total |
Count | code, method, protocol, service |
The total count of HTTP requests processed on a service. |
router.service.tls.total |
Count | tls_version, tls_cipher, service |
The total count of HTTPS requests processed on a service. |
service.request.duration.seconds |
Histogram | code, method, protocol, service |
Request processing duration histogram on a service. |
service.retries.total |
Count | service |
The count of requests retries on a service. |
service.server.up |
Gauge | service, url |
Current service's server status, 0 for a down or 1 for up. Only for services configured with healthcheck. |
service.requests.bytes.total |
Count | code, method, protocol, service |
The total size of requests in bytes received by a service. |
service.responses.bytes.total |
Count | code, method, protocol, service |
The total size of responses in bytes returned by a service. |
| Metric | Type | Labels | Description |
|---|---|---|---|
traefik.service.requests.total |
Count | code, method, protocol, service |
The total count of HTTP requests processed on a service. |
traefik.service.requests.tls.total |
Count | tls_version, tls_cipher, service |
The total count of HTTPS requests processed on a service. |
traefik.service.request.duration.seconds |
Histogram | code, method, protocol, service |
Request processing duration histogram on a service. |
traefik.service.retries.total |
Count | service |
The count of requests retries on a service. |
traefik.service.server.up |
Gauge | service, url |
Current service's server status, 0 for a down or 1 for up. Only for services configured with healthcheck. |
traefik.service.requests.bytes.total |
Count | code, method, protocol, service |
The total size of requests in bytes received by a service. |
traefik.service.responses.bytes.total |
Count | code, method, protocol, service |
The total size of responses in bytes returned by a service. |
| Metric | Type | Labels | Description |
|---|---|---|---|
{prefix}.service.requests.total |
Count | code, method, protocol, service |
The total count of HTTP requests processed on a service. |
{prefix}.service.requests.tls.total |
Count | tls_version, tls_cipher, service |
The total count of HTTPS requests processed on a service. |
{prefix}.service.request.duration.seconds |
Histogram | code, method, protocol, service |
Request processing duration histogram on a service. |
{prefix}.service.retries.total |
Count | service |
The count of requests retries on a service. |
{prefix}.service.server.up |
Gauge | service, url |
Current service's server status, 0 for a down or 1 for up. Only for services configured with healthcheck. |
{prefix}.service.requests.bytes.total |
Count | code, method, protocol, service |
The total size of requests in bytes received by a service. |
{prefix}.service.responses.bytes.total |
Count | code, method, protocol, service |
The total size of responses in bytes returned by a service. |
{prefix} Default Value
By default, {prefix} value is traefik.
Labels¶
Here is a comprehensive list of labels that are provided by the metrics:
| Label | Description | example |
|---|---|---|
cn |
Certificate Common Name | "example.com" |
code |
Request code | "200" |
entrypoint |
Entrypoint that handled the request | "example_entrypoint" |
method |
Request Method | "GET" |
protocol |
Request protocol | "http" |
router |
Router that handled the request | "example_router" |
sans |
Certificate Subject Alternative NameS | "example.com" |
serial |
Certificate Serial Number | "123..." |
service |
Service that handled the request | "example_service@provider" |
tls_cipher |
TLS cipher used for the request | "TLS_FALLBACK_SCSV" |
tls_version |
TLS version used for the request | "1.0" |
url |
Service server url | "http://example.com" |
method label value
If the HTTP method verb on a request is not one defined in the set of common methods for HTTP/1.1
or the PRI verb (for HTTP/2),
then the value for the method label becomes EXTENSION_METHOD.
TCP Metrics¶
Traefik also provides metrics to monitor the connections handled by TCP routers.
The connections handled by HTTP routers are not counted by these metrics,
even though HTTP runs over TCP.
The open_connections global metric counts all the open connections of an entrypoint,
HTTP ones included.
TCP Router Metrics¶
The TCP router metrics are disabled by default.
Enable them with the enableTCPRouterMetrics option of the metrics exporter.
| Metric | Type | Labels | Description |
|---|---|---|---|
traefik.router.tcp.open_connections |
UpDownCounter | traefik.entrypoint.name, traefik.router.name, traefik.service.name, traefik.tls.mode, network.type |
The current count of open connections on a TCP router. |
traefik.router.tcp.tls.open_connections |
UpDownCounter | traefik.entrypoint.name, traefik.router.name, traefik.service.name, network.type, tls.protocol.version, tls.cipher |
The current count of open TLS connections on a TCP router. |
| Metric | Type | Labels | Description |
|---|---|---|---|
traefik_router_tcp_open_connections |
Gauge | traefik.entrypoint.name, traefik.router.name, traefik.service.name, traefik.tls.mode, network.type |
The current count of open connections on a TCP router. |
traefik_router_tcp_tls_open_connections |
Gauge | traefik.entrypoint.name, traefik.router.name, traefik.service.name, network.type, tls.protocol.version, tls.cipher |
The current count of open TLS connections on a TCP router. |
| Metric | Type | Labels | Description |
|---|---|---|---|
router.tcp.open.connections |
Gauge | traefik.entrypoint.name, traefik.router.name, traefik.service.name, traefik.tls.mode, network.type |
The current count of open connections on a TCP router. |
router.tcp.tls.open.connections |
Gauge | traefik.entrypoint.name, traefik.router.name, traefik.service.name, network.type, tls.protocol.version, tls.cipher |
The current count of open TLS connections on a TCP router. |
| Metric | Type | Labels | Description |
|---|---|---|---|
traefik.router.tcp.open.connections |
Gauge | traefik.entrypoint.name, traefik.router.name, traefik.service.name, traefik.tls.mode, network.type |
The current count of open connections on a TCP router. |
traefik.router.tcp.tls.open.connections |
Gauge | traefik.entrypoint.name, traefik.router.name, traefik.service.name, network.type, tls.protocol.version, tls.cipher |
The current count of open TLS connections on a TCP router. |
| Metric | Type | Labels | Description |
|---|---|---|---|
{prefix}.router.tcp.open.connections |
Gauge | The current count of open connections, over all the TCP routers. | |
{prefix}.router.tcp.tls.open.connections |
Gauge | The current count of open TLS connections, over all the TCP routers. |
{prefix} Default Value
By default, {prefix} value is traefik.
TLS connections
The TLS connections metric only counts the connections whose TLS is terminated by Traefik, once the TLS handshake is done. These connections are also counted by the open connections metric. The connections of a router with TLS passthrough are only counted by the open connections metric, because Traefik forwards them without knowing the negotiated TLS version and cipher.
Labels¶
Here is a comprehensive list of labels that are provided by the TCP router metrics:
| Label | Description | example |
|---|---|---|
traefik.entrypoint.name |
Entrypoint the connection was received on | "websecure" |
traefik.router.name |
TCP router that handled the connection | "example_router@provider" |
traefik.service.name |
TCP service the connection is routed to | "example_service@provider" |
traefik.tls.mode |
TLS mode of the TCP router: none without TLS, terminated when Traefik terminates the TLS, passthrough when the TLS connection is forwarded as is |
"terminated" |
network.type |
Network layer protocol of the connection, ipv4 or ipv6 |
"ipv4" |
tls.protocol.version |
TLS version negotiated for the connection | "1.3" |
tls.cipher |
TLS cipher negotiated for the connection | "TLS_AES_128_GCM_SHA256" |
Labels names
The router and service labels are named after the attributes of the tracing spans,
and the other ones after the OpenTelemetry semantic conventions attributes.
With Prometheus, the dots are replaced by underscores (e.g. traefik_router_name)
when the scraper does not support UTF-8 label names.
StatsD does not support labels.