Metrics

Traefik provides metrics in the OpenTelemetry format as well as the following vendor specific backends:

Traefik Proxy hosts an official Grafana dashboard for both on-premises and Kubernetes deployments.

Common Options

addInternals

Optional, Default=”false”

Enables metrics for internal resources (e.g.: ping@internals).

File (YAML)

  1. metrics:
  2. addInternals: true

File (TOML)

  1. [metrics]
  2. addInternals = true

CLI

  1. --metrics.addinternals

Global Metrics

MetricTypeLabelsDescription
Config reload totalCountThe total count of configuration reloads.
Config reload last successGaugeThe timestamp of the last configuration reload success.
Open connectionsGaugeentrypoint, protocolThe current count of open connections, by entrypoint and protocol.
TLS certificates not afterGaugeThe expiration date of certificates.

OpenTelemetry

  1. traefik_config_reloads_total
  2. traefik_config_last_reload_success
  3. traefik_open_connections
  4. traefik_tls_certs_not_after

Prometheus

  1. traefik_config_reloads_total
  2. traefik_config_last_reload_success
  3. traefik_open_connections
  4. traefik_tls_certs_not_after

Datadog

  1. config.reload.total
  2. config.reload.lastSuccessTimestamp
  3. open.connections
  4. tls.certs.notAfterTimestamp

InfluxDB2

  1. traefik.config.reload.total
  2. traefik.config.reload.lastSuccessTimestamp
  3. traefik.open.connections
  4. traefik.tls.certs.notAfterTimestamp

StatsD

  1. # Default prefix: "traefik"
  2. {prefix}.config.reload.total
  3. {prefix}.config.reload.lastSuccessTimestamp
  4. {prefix}.open.connections
  5. {prefix}.tls.certs.notAfterTimestamp

Labels

Here is a comprehensive list of labels that are provided by the global metrics:

LabelDescriptionexample
entrypointEntrypoint that handled the connection“example_entrypoint”
protocolConnection protocol“TCP”

OpenTelemetry Semantic Conventions

Traefik Proxy follows official OpenTelemetry semantic conventions v1.23.1.

HTTP Server

MetricTypeLabelsDescription
http.server.request.durationHistogramerror.type, http.request.method, http.response.status_code, network.protocol.name, server.address, server.port, url.schemeDuration of HTTP server requests

Labels

Here is a comprehensive list of labels that are provided by the metrics:

LabelDescriptionexample
error.typeDescribes a class of error the operation ended with“500”
http.request.methodHTTP request method“GET”
http.response.status_codeHTTP response status code“200”
network.protocol.nameOSI application layer or non-OSI equivalent“http/1.1”
network.protocol.versionVersion of the protocol specified in network.protocol.name“1.1”
server.addressName of the local HTTP server that received the request“example.com”
server.portPort of the local HTTP server that received the request“80”
url.schemeThe URI scheme component identifying the used protocol“http”

HTTP Client

MetricTypeLabelsDescription
http.client.request.durationHistogramerror.type, http.request.method, http.response.status_code, network.protocol.name, server.address, server.port, url.schemeDuration of HTTP client requests

Labels

Here is a comprehensive list of labels that are provided by the metrics:

LabelDescriptionexample
error.typeDescribes a class of error the operation ended with“500”
http.request.methodHTTP request method“GET”
http.response.status_codeHTTP response status code“200”
network.protocol.nameOSI application layer or non-OSI equivalent“http/1.1”
network.protocol.versionVersion of the protocol specified in network.protocol.name“1.1”
server.addressName of the local HTTP server that received the request“example.com”
server.portPort of the local HTTP server that received the request“80”
url.schemeThe 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

MetricTypeLabelsDescription
Requests totalCountcode, method, protocol, entrypointThe total count of HTTP requests received by an entrypoint.
Requests TLS totalCounttls_version, tls_cipher, entrypointThe total count of HTTPS requests received by an entrypoint.
Request durationHistogramcode, method, protocol, entrypointRequest processing duration histogram on an entrypoint.
Requests bytes totalCountcode, method, protocol, entrypointThe total size of HTTP requests in bytes handled by an entrypoint.
Responses bytes totalCountcode, method, protocol, entrypointThe total size of HTTP responses in bytes handled by an entrypoint.

OpenTelemetry

  1. traefik_entrypoint_requests_total
  2. traefik_entrypoint_requests_tls_total
  3. traefik_entrypoint_request_duration_seconds
  4. traefik_entrypoint_requests_bytes_total
  5. traefik_entrypoint_responses_bytes_total

Prometheus

  1. traefik_entrypoint_requests_total
  2. traefik_entrypoint_requests_tls_total
  3. traefik_entrypoint_request_duration_seconds
  4. traefik_entrypoint_requests_bytes_total
  5. traefik_entrypoint_responses_bytes_total

Datadog

  1. entrypoint.request.total
  2. entrypoint.request.tls.total
  3. entrypoint.request.duration
  4. entrypoint.requests.bytes.total
  5. entrypoint.responses.bytes.total

InfluxDB2

  1. traefik.entrypoint.requests.total
  2. traefik.entrypoint.requests.tls.total
  3. traefik.entrypoint.request.duration
  4. traefik.entrypoint.requests.bytes.total
  5. traefik.entrypoint.responses.bytes.total

StatsD

  1. # Default prefix: "traefik"
  2. {prefix}.entrypoint.request.total
  3. {prefix}.entrypoint.request.tls.total
  4. {prefix}.entrypoint.request.duration
  5. {prefix}.entrypoint.requests.bytes.total
  6. {prefix}.entrypoint.responses.bytes.total

Router Metrics

MetricTypeLabelsDescription
Requests totalCountcode, method, protocol, router, serviceThe total count of HTTP requests handled by a router.
Requests TLS totalCounttls_version, tls_cipher, router, serviceThe total count of HTTPS requests handled by a router.
Request durationHistogramcode, method, protocol, router, serviceRequest processing duration histogram on a router.
Requests bytes totalCountcode, method, protocol, router, serviceThe total size of HTTP requests in bytes handled by a router.
Responses bytes totalCountcode, method, protocol, router, serviceThe total size of HTTP responses in bytes handled by a router.

OpenTelemetry

  1. traefik_router_requests_total
  2. traefik_router_requests_tls_total
  3. traefik_router_request_duration_seconds
  4. traefik_router_requests_bytes_total
  5. traefik_router_responses_bytes_total

Prometheus

  1. traefik_router_requests_total
  2. traefik_router_requests_tls_total
  3. traefik_router_request_duration_seconds
  4. traefik_router_requests_bytes_total
  5. traefik_router_responses_bytes_total

Datadog

  1. router.request.total
  2. router.request.tls.total
  3. router.request.duration
  4. router.requests.bytes.total
  5. router.responses.bytes.total

InfluxDB2

  1. traefik.router.requests.total
  2. traefik.router.requests.tls.total
  3. traefik.router.request.duration
  4. traefik.router.requests.bytes.total
  5. traefik.router.responses.bytes.total

StatsD

  1. # Default prefix: "traefik"
  2. {prefix}.router.request.total
  3. {prefix}.router.request.tls.total
  4. {prefix}.router.request.duration
  5. {prefix}.router.requests.bytes.total
  6. {prefix}.router.responses.bytes.total

Service Metrics

MetricTypeLabelsDescription
Requests totalCountcode, method, protocol, serviceThe total count of HTTP requests processed on a service.
Requests TLS totalCounttls_version, tls_cipher, serviceThe total count of HTTPS requests processed on a service.
Request durationHistogramcode, method, protocol, serviceRequest processing duration histogram on a service.
Retries totalCountserviceThe count of requests retries on a service.
Server UPGaugeservice, urlCurrent service’s server status, 0 for a down or 1 for up.
Requests bytes totalCountcode, method, protocol, serviceThe total size of requests in bytes received by a service.
Responses bytes totalCountcode, method, protocol, serviceThe total size of responses in bytes returned by a service.

OpenTelemetry

  1. traefik_service_requests_total
  2. traefik_service_requests_tls_total
  3. traefik_service_request_duration_seconds
  4. traefik_service_retries_total
  5. traefik_service_server_up
  6. traefik_service_requests_bytes_total
  7. traefik_service_responses_bytes_total

Prometheus

  1. traefik_service_requests_total
  2. traefik_service_requests_tls_total
  3. traefik_service_request_duration_seconds
  4. traefik_service_retries_total
  5. traefik_service_server_up
  6. traefik_service_requests_bytes_total
  7. traefik_service_responses_bytes_total

Datadog

  1. service.request.total
  2. router.service.tls.total
  3. service.request.duration
  4. service.retries.total
  5. service.server.up
  6. service.requests.bytes.total
  7. service.responses.bytes.total

InfluxDB2

  1. traefik.service.requests.total
  2. traefik.service.requests.tls.total
  3. traefik.service.request.duration
  4. traefik.service.retries.total
  5. traefik.service.server.up
  6. traefik.service.requests.bytes.total
  7. traefik.service.responses.bytes.total

StatsD

  1. # Default prefix: "traefik"
  2. {prefix}.service.request.total
  3. {prefix}.service.request.tls.total
  4. {prefix}.service.request.duration
  5. {prefix}.service.retries.total
  6. {prefix}.service.server.up
  7. {prefix}.service.requests.bytes.total
  8. {prefix}.service.responses.bytes.total

Labels

Here is a comprehensive list of labels that are provided by the metrics:

LabelDescriptionexample
cnCertificate Common Name“example.com”
codeRequest code“200”
entrypointEntrypoint that handled the request“example_entrypoint”
methodRequest Method“GET”
protocolRequest protocol“http”
routerRouter that handled the request“example_router”
sansCertificate Subject Alternative NameS“example.com”
serialCertificate Serial Number“123…”
serviceService that handled the request“example_service@provider”
tls_cipherTLS cipher used for the request“TLS_FALLBACK_SCSV”
tls_versionTLS version used for the request“1.0”
urlService server urlhttp://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.