New Install Reference Documentation
This commit is contained in:
parent
2b35c7e205
commit
47b4df71bf
33 changed files with 4718 additions and 17 deletions
|
@ -0,0 +1,87 @@
|
|||
---
|
||||
title: "Traefik Health Check Documentation"
|
||||
description: "In Traefik Proxy, CLI & Ping lets you check the health of your Traefik instances. Read the technical documentation for configuration examples and options."
|
||||
---
|
||||
|
||||
# CLI & Ping
|
||||
|
||||
Checking the Health of your Traefik Instances
|
||||
{: .subtitle }
|
||||
|
||||
## CLI
|
||||
|
||||
The CLI can be used to make a request to the `/ping` endpoint to check the health of Traefik. Its exit status is `0` if Traefik is healthy and `1` otherwise.
|
||||
|
||||
This can be used with [HEALTHCHECK](https://docs.docker.com/engine/reference/builder/#healthcheck) instruction or any other health check orchestration mechanism.
|
||||
|
||||
### Usage
|
||||
|
||||
```sh
|
||||
traefik healthcheck [command] [flags] [arguments]
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```sh
|
||||
$ traefik healthcheck
|
||||
OK: http://:8082/ping
|
||||
```
|
||||
|
||||
## Ping
|
||||
|
||||
The `/ping` health-check URL is enabled with the command-line `--ping` or config file option `[ping]`.
|
||||
|
||||
The entryPoint where the `/ping` is active can be customized with the `entryPoint` option,
|
||||
whose default value is `traefik` (port `8080`).
|
||||
|
||||
| Path | Method | Description |
|
||||
|---------|---------------|-----------------------------------------------------------------------------------------------------|
|
||||
| `/ping` | `GET`, `HEAD` | An endpoint to check for Traefik process liveness. Return a code `200` with the content: `OK` |
|
||||
|
||||
### Configuration Example
|
||||
|
||||
To enable the API handler:
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
ping: {}
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[ping]
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--ping=true
|
||||
```
|
||||
|
||||
### Configuration Options
|
||||
|
||||
| Field | Description | Default | Required |
|
||||
|:------|:----------------------------------------------------------|:---------------------|:---------|
|
||||
| `ping.entryPoint` | Enables `/ping` on a dedicated EntryPoint. | traefik | No |
|
||||
| `ping.manualRouting` | Disables the default internal router in order to allow one to create a custom router for the `ping@internal` service when set to `true`. | false | No |
|
||||
| `ping.terminatingStatusCode` | Defines the status code for the ping handler during a graceful shut down. See more information [here](#terminatingstatuscode) | 503 | No |
|
||||
|
||||
#### `terminatingStatusCode`
|
||||
|
||||
During the period in which Traefik is gracefully shutting down, the ping handler
|
||||
returns a `503` status code by default.
|
||||
If Traefik is behind, for example a load-balancer
|
||||
doing health checks (such as the Kubernetes LivenessProbe), another code might
|
||||
be expected as the signal for graceful termination.
|
||||
In that case, the terminatingStatusCode can be used to set the code returned by the ping
|
||||
handler during termination.
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
ping:
|
||||
terminatingStatusCode: 204
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[ping]
|
||||
terminatingStatusCode = 204
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--ping.terminatingStatusCode=204
|
||||
```
|
|
@ -0,0 +1,218 @@
|
|||
---
|
||||
title: "Traefik Logs Documentation"
|
||||
description: "Logs are a key part of observability in Traefik Proxy. Read the technical documentation to learn their configurations, rotations, and time zones."
|
||||
---
|
||||
|
||||
## Logs
|
||||
|
||||
Logs concern everything that happens to Traefik itself (startup, configuration, events, shutdown, and so on).
|
||||
|
||||
### Configuration Example
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
log:
|
||||
filePath: "/path/to/log-file.log"
|
||||
format: json
|
||||
level: INFO
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[log]
|
||||
filePath = "/path/to/log-file.log"
|
||||
format = "json"
|
||||
level = "INFO"
|
||||
```
|
||||
|
||||
```sh tab="CLI"
|
||||
--log.filePath=/path/to/log-file.log
|
||||
--log.format=json
|
||||
--log.level=INFO
|
||||
```
|
||||
|
||||
### Configuration Options
|
||||
|
||||
The section below describe how to configure Traefik logs using the static configuration.
|
||||
|
||||
| Field | Description | Default | Required |
|
||||
|:-----------|:----------------------------|:--------|:---------|
|
||||
| `log.filePath` | By default, the logs are written to the standard output.<br />You can configure a file path instead using the `filePath` option.| - | No |
|
||||
| `log.format` | Log format (`common`or `json`).<br /> The fields displayed with the format `common` cannot be customized. | "common" | No |
|
||||
| `log.level` | Log level (`TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL`, and `PANIC`)| ERROR | No |
|
||||
| `log.noColor` | When using the format `common`, disables the colorized output. | false | No |
|
||||
| `log.maxSize` | Maximum size in megabytes of the log file before it gets rotated. | 100MB | No |
|
||||
| `log.maxAge` | Maximum number of days to retain old log files based on the timestamp encoded in their filename.<br /> A day is defined as 24 hours and may not exactly correspond to calendar days due to daylight savings, leap seconds, etc.<br />By default files are not removed based on their age. | 0 | No |
|
||||
| `log.maxBackups` | Maximum number of old log files to retain.<br />The default is to retain all old log files. | 0 | No |
|
||||
| `log.compress` | Compress log files in gzip after rotation. | false | No |
|
||||
|
||||
## AccessLogs
|
||||
|
||||
### Configuration Example
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
accessLog:
|
||||
# JSON format
|
||||
format: json
|
||||
# Filter on status codes, retry attempts and minimal duration
|
||||
filters:
|
||||
statusCodes:
|
||||
- "200"
|
||||
- "300-302"
|
||||
retryAttempts: true
|
||||
minDuration: "10ms"
|
||||
fields:
|
||||
# Keep all the fields by default
|
||||
defaultMode: keep
|
||||
names:
|
||||
# Drop the Field ClientUserName
|
||||
ClientUsername: drop
|
||||
headers:
|
||||
# Keep all the headers by default
|
||||
defaultMode: keep
|
||||
names:
|
||||
# Redact the User-Agent header value
|
||||
User-Agent: redact
|
||||
# Drop the Authorization header value
|
||||
Authorization: drop
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[accessLog]
|
||||
format = "json"
|
||||
|
||||
[accessLog.filters]
|
||||
statusCodes = [ "200", "300-302" ]
|
||||
retryAttempts = true
|
||||
minDuration = "10ms"
|
||||
|
||||
[accessLog.fields]
|
||||
defaultMode = "keep"
|
||||
|
||||
[accessLog.fields.names]
|
||||
ClientUsername = "drop"
|
||||
|
||||
[accessLog.fields.headers]
|
||||
defaultMode = "keep"
|
||||
|
||||
[accessLog.fields.headers.names]
|
||||
User-Agent = "redact"
|
||||
Authorization = "drop"
|
||||
```
|
||||
|
||||
```sh tab="CLI"
|
||||
--accesslog=true
|
||||
--accesslog.format=json
|
||||
--accesslog.filters.statuscodes=200,300-302
|
||||
--accesslog.filters.retryattempts
|
||||
--accesslog.filters.minduration=10ms
|
||||
--accesslog.fields.defaultmode=keep
|
||||
--accesslog.fields.names.ClientUsername=drop
|
||||
--accesslog.fields.headers.defaultmode=keep
|
||||
--accesslog.fields.headers.names.User-Agent=redact
|
||||
--accesslog.fields.headers.names.Authorization=drop
|
||||
```
|
||||
|
||||
### Configuration Options
|
||||
|
||||
The section below describes how to configure Traefik access logs using the static configuration.
|
||||
|
||||
| Field | Description | Default | Required |
|
||||
|:-----------|:--------------------------|:--------|:---------|
|
||||
| `accesslog.filePath` | By default, the access logs are written to the standard output.<br />You can configure a file path instead using the `filePath` option.| | No |
|
||||
| `accesslog.format` | By default, logs are written using the Common Log Format (CLF).<br />To write logs in JSON, use `json` in the `format` option.<br />If the given format is unsupported, the default (CLF) is used instead.<br />More information about CLF fields [here](#clf-format-fields). | "common" | No |
|
||||
| `accesslog.bufferingSize` | To write the logs in an asynchronous fashion, specify a `bufferingSize` option.<br />This option represents the number of log lines Traefik will keep in memory before writing them to the selected output.<br />In some cases, this option can greatly help performances.| 0 | No |
|
||||
| `accesslog.addInternals` | Enables access logs for internal resources (e.g.: `ping@internal`). | false | No |
|
||||
| `accesslog.filters.statusCodes` | Limit the access logs to requests with a status codes in the specified range. | false | No |
|
||||
| `accesslog.filters.retryAttempts` | Keep the access logs when at least one retry has happened. | false | No |
|
||||
| `accesslog.filters.minDuration` | Keep access logs when requests take longer than the specified duration (provided in seconds or as a valid duration format, see [time.ParseDuration](https://golang.org/pkg/time/#ParseDuration)). | 0 | No |
|
||||
| `accesslog.fields.defaultMode` | Mode to apply by default to the access logs fields (`keep`, `redact` or `drop`). | keep | No |
|
||||
| `accesslog.fields.names` | Set the fields list to display in the access logs (format `name:mode`).<br /> Available fields list [here](#available-fields). | - | No |
|
||||
| `accesslog.headers.defaultMode` | Mode to apply by default to the access logs headers (`keep`, `redact` or `drop`). | drop | No |
|
||||
| `accesslog.headers.names` | Set the headers list to display in the access logs (format `name:mode`). | - | No |
|
||||
|
||||
#### CLF format fields
|
||||
|
||||
Below the fields displayed with the CLF format:
|
||||
|
||||
```html
|
||||
<remote_IP_address> - <client_user_name_if_available> [<timestamp>]
|
||||
"<request_method> <request_path> <request_protocol>" <HTTP_status> <content-length>
|
||||
"<request_referrer>" "<request_user_agent>" <number_of_requests_received_since_Traefik_started>
|
||||
"<Traefik_router_name>" "<Traefik_server_URL>" <request_duration_in_ms>ms
|
||||
```
|
||||
|
||||
#### Available Fields
|
||||
|
||||
| Field | Description |
|
||||
|-------------------------|------------------|
|
||||
| `StartUTC` | The time at which request processing started. |
|
||||
| `StartLocal` | The local time at which request processing started. |
|
||||
| `Duration` | The total time taken (in nanoseconds) by processing the response, including the origin server's time but not the log writing time. |
|
||||
| `RouterName` | The name of the Traefik router. |
|
||||
| `ServiceName` | The name of the Traefik backend. |
|
||||
| `ServiceURL` | The URL of the Traefik backend. |
|
||||
| `ServiceAddr` | The IP:port of the Traefik backend (extracted from `ServiceURL`). |
|
||||
| `ClientAddr` | The remote address in its original form (usually IP:port). |
|
||||
| `ClientHost` | The remote IP address from which the client request was received. |
|
||||
| `ClientPort` | The remote TCP port from which the client request was received. |
|
||||
| `ClientUsername` | The username provided in the URL, if present. |
|
||||
| `RequestAddr` | The HTTP Host header (usually IP:port). This is treated as not a header by the Go API. |
|
||||
| `RequestHost` | The HTTP Host server name (not including port). |
|
||||
| `RequestPort` | The TCP port from the HTTP Host. |
|
||||
| `RequestMethod` | The HTTP method. |
|
||||
| `RequestPath` | The HTTP request URI, not including the scheme, host or port. |
|
||||
| `RequestProtocol` | The version of HTTP requested. |
|
||||
| `RequestScheme` | The HTTP scheme requested `http` or `https`. |
|
||||
| `RequestLine` | The `RequestMethod`, + `RequestPath` and `RequestProtocol`. |
|
||||
| `RequestContentSize` | The number of bytes in the request entity (a.k.a. body) sent by the client. |
|
||||
| `OriginDuration` | The time taken (in nanoseconds) by the origin server ('upstream') to return its response. |
|
||||
| `OriginContentSize` | The content length specified by the origin server, or 0 if unspecified. |
|
||||
| `OriginStatus` | The HTTP status code returned by the origin server. If the request was handled by this Traefik instance (e.g. with a redirect), then this value will be absent (0). |
|
||||
| `OriginStatusLine` | `OriginStatus` + Status code explanation |
|
||||
| `DownstreamStatus` | The HTTP status code returned to the client. |
|
||||
| `DownstreamStatusLine` | The `DownstreamStatus` and status code explanation. |
|
||||
| `DownstreamContentSize` | The number of bytes in the response entity returned to the client. This is in addition to the "Content-Length" header, which may be present in the origin response. |
|
||||
| `RequestCount` | The number of requests received since the Traefik instance started. |
|
||||
| `GzipRatio` | The response body compression ratio achieved. |
|
||||
| `Overhead` | The processing time overhead (in nanoseconds) caused by Traefik. |
|
||||
| `RetryAttempts` | The amount of attempts the request was retried. |
|
||||
| `TLSVersion` | The TLS version used by the connection (e.g. `1.2`) (if connection is TLS). |
|
||||
| `TLSCipher` | The TLS cipher used by the connection (e.g. `TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA`) (if connection is TLS). |
|
||||
| `TLSClientSubject` | The string representation of the TLS client certificate's Subject (e.g. `CN=username,O=organization`). |
|
||||
|
||||
#### Log Rotation
|
||||
|
||||
Traefik close and reopen its log files, assuming they're configured, on receipt of a USR1 signal.
|
||||
This allows the logs to be rotated and processed by an external program, such as `logrotate`.
|
||||
|
||||
!!! warning
|
||||
This does not work on Windows due to the lack of USR signals.
|
||||
|
||||
#### Time Zones
|
||||
|
||||
Traefik will timestamp each log line in UTC time by default.
|
||||
|
||||
It is possible to configure the Traefik to timestamp in a specific timezone by ensuring the following configuration has been made in your environment:
|
||||
|
||||
1. Provide time zone data to `/etc/localtime` or `/usr/share/zoneinfo` (based on your distribution) or set the environment variable TZ to the desired timezone.
|
||||
2. Specify the field `StartLocal` by dropping the field named `StartUTC` (available on the default Common Log Format (CLF) as well as JSON): `accesslog.fields.names.StartUTC=drop`.
|
||||
|
||||
Example utilizing Docker Compose:
|
||||
|
||||
```yaml
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
traefik:
|
||||
image: traefik:v3.2
|
||||
environment:
|
||||
- TZ=US/Alaska
|
||||
command:
|
||||
- --accesslog.fields.names.StartUTC=drop
|
||||
- --providers.docker
|
||||
ports:
|
||||
- 80:80
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
```
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
|
@ -0,0 +1,601 @@
|
|||
---
|
||||
title: "Traefik Metrics Overview"
|
||||
description: "Traefik Proxy supports these metrics backend systems: OpenTelemetry, Datadog, InfluxDB 2.X, Prometheus, and StatsD. Read the full documentation to get started."
|
||||
---
|
||||
|
||||
# Metrics
|
||||
|
||||
Traefik provides metrics in the [OpenTelemetry](#open-telemetry) format as well as the following vendor specific backends:
|
||||
|
||||
- [Datadog](#datadog)
|
||||
- [InfluxDB2](#influxdb-v2)
|
||||
- [Prometheus](#prometheus)
|
||||
- [StatsD](#statsd)
|
||||
|
||||
Traefik Proxy has an official Grafana dashboard for both [on-premises](https://grafana.com/grafana/dashboards/17346)
|
||||
and [Kubernetes](https://grafana.com/grafana/dashboards/17347) deployments.
|
||||
|
||||
---
|
||||
|
||||
## Open Telemetry
|
||||
|
||||
!!! info "Default protocol"
|
||||
|
||||
The OpenTelemetry exporter will export metrics to the collector using HTTP by default to https://localhost:4318/v1/metrics.
|
||||
|
||||
### Configuration Example
|
||||
|
||||
To enable the OpenTelemetry metrics:
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
metrics:
|
||||
otlp: {}
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[metrics]
|
||||
[metrics.otlp]
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--metrics.otlp=true
|
||||
```
|
||||
|
||||
```yaml tab="Helm Chart Values"
|
||||
# values.yaml
|
||||
metrics:
|
||||
# Disable Prometheus (enabled by default)
|
||||
prometheus: null
|
||||
# Enable providing OTel metrics
|
||||
otlp:
|
||||
enabled: true
|
||||
http:
|
||||
enabled: true
|
||||
```
|
||||
|
||||
!!! tip "Helm 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](https://github.com/traefik/traefik-helm-chart/blob/master/traefik/VALUES.md) (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.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.explicitBoundaries` | Explicit boundaries for Histogram data points. | ".005, .01, .025, .05, .1, .25, .5, 1, 2.5, 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.<br /> Setting the sub-options with their default values. | null/false | No |
|
||||
| `metrics.otlp.http.endpoint` | URL of the OpenTelemetry Collector to send metrics to.<br /> Format="`<scheme>://<host>:<port><path>`" | "http://localhost:4318/v1/metrics" | 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,<br />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.<br />When using this option, setting the `key` option is required. | "" | No |
|
||||
| `metrics.otlp.http.tls.key` | This instructs the exporter to send the metrics to the OpenTelemetry Collector using HTTP.<br /> Setting the sub-options with their default values. | null/false | 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.<br /> 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.http.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,<br />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.<br />When using this option, setting the `key` option is required. | - | No |
|
||||
| `metrics.otlp.grpc.tls.key` | This instructs the exporter to send the metrics to the OpenTelemetry Collector using HTTP.<br /> Setting the sub-options with their default values. | null/false | 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 |
|
||||
|
||||
## Vendors
|
||||
|
||||
### Datadog
|
||||
|
||||
#### Configuration Example
|
||||
|
||||
To enable the Datadog:
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
metrics:
|
||||
datadog: {}
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[metrics]
|
||||
[metrics.datadog]
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--metrics.datadog=true
|
||||
```
|
||||
|
||||
#### Configuration 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](#address)| `127.0.0.1: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.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.
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
metrics:
|
||||
datadog:
|
||||
address: 127.0.0.1:8125
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[metrics]
|
||||
[metrics.datadog]
|
||||
address = "127.0.0.1:8125"
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--metrics.datadog.address=127.0.0.1:8125
|
||||
```
|
||||
|
||||
### InfluxDB v2
|
||||
|
||||
#### Configuration Example
|
||||
|
||||
To enable the InfluxDB2:
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
metrics:
|
||||
influxDB2:
|
||||
address: http://localhost:8086
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[metrics]
|
||||
[metrics.influxDB2]
|
||||
address: http://localhost:8086
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--metrics.influxdb2=true
|
||||
```
|
||||
|
||||
#### Configuration Options
|
||||
|
||||
| Field | Description | Default | Required |
|
||||
|:-----------|-------------------------|:--------|:---------|
|
||||
| `metrics.addInternal` | 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.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:
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
metrics:
|
||||
prometheus:
|
||||
buckets:
|
||||
- 0.1
|
||||
- 0.3
|
||||
- 1.2
|
||||
- 5.0
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[metrics]
|
||||
[metrics.prometheus]
|
||||
[metrics.prometheus.buckets]
|
||||
- 0.1
|
||||
- 0.3
|
||||
- 1.2
|
||||
- 5.0
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--metrics.prometheus=true
|
||||
```
|
||||
|
||||
#### Configuration Options
|
||||
|
||||
| Field | Description | Default | Required |
|
||||
|:-----------|---------------------|:--------|:---------|
|
||||
| `metrics.prometheus.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.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.<br />More information [here](#headerlabels). | | 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.
|
||||
|
||||
!!! note "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:
|
||||
|
||||
```Golang
|
||||
// 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:
|
||||
|
||||
```yaml tab="Configuration"
|
||||
# static_configuration.yaml
|
||||
metrics:
|
||||
prometheus:
|
||||
headerLabels:
|
||||
useragent: User-Agent
|
||||
```
|
||||
|
||||
```bash tab="Request"
|
||||
curl -H "User-Agent: foobar" http://localhost
|
||||
```
|
||||
|
||||
```bash tab="Metric"
|
||||
traefik_entrypoint_requests_total\{code="200",entrypoint="web",method="GET",protocol="http",useragent="foobar"\} 1
|
||||
```
|
||||
|
||||
### StatsD
|
||||
|
||||
#### Configuration Example
|
||||
|
||||
To enable the Statsd:
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
metrics:
|
||||
statsD:
|
||||
address: localhost:8125
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[metrics]
|
||||
[metrics.statsD]
|
||||
address: localhost:8125
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--metrics.statsd=true
|
||||
```
|
||||
|
||||
#### Configuration 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.pushInterval` | The interval used by the exporter to push metrics to DataDog server. | 10s | No |
|
||||
| `metrics.statsD.address` | Address instructs exporter to send metrics to statsd at this address. | "127.0.0.1:8125" | Yes |
|
||||
| `metrics.statsD.prefix` | The prefix to use for metrics collection. | "traefik" | No |
|
||||
|
||||
## Metrics Provided
|
||||
|
||||
### Global Metrics
|
||||
|
||||
=== "OpenTelemetry"
|
||||
| Metric | Type | [Labels](#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. |
|
||||
|
||||
=== "Prometheus"
|
||||
| Metric | Type | [Labels](#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. |
|
||||
|
||||
=== "Datadog"
|
||||
| Metric | Type | [Labels](#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. |
|
||||
|
||||
=== "InfluxDB2"
|
||||
| Metric | Type | [Labels](#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. |
|
||||
|
||||
=== "StatsD"
|
||||
| Metric | Type | [Labels](#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 | `entrypoint`, `protocol` | The current count of open connections, by entrypoint and protocol. |
|
||||
| `{prefix}.tls.certs.notAfterTimestamp` | Gauge | | The expiration date of certificates. |
|
||||
|
||||
!!! note "\{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` | Connection protocol | "TCP" |
|
||||
|
||||
### OpenTelemetry Semantic Conventions
|
||||
|
||||
Traefik Proxy follows [official OpenTelemetry semantic conventions v1.23.1](https://github.com/open-telemetry/semantic-conventions/blob/v1.23.1/docs/http/http-metrics.md).
|
||||
|
||||
#### HTTP Server
|
||||
|
||||
| Metric | Type | [Labels](#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](#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
|
||||
|
||||
=== "OpenTelemetry"
|
||||
|
||||
| Metric | Type | [Labels](#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. |
|
||||
|
||||
=== "Prometheus"
|
||||
|
||||
| Metric | Type | [Labels](#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. |
|
||||
|
||||
=== "Datadog"
|
||||
|
||||
| Metric | Type | [Labels](#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. |
|
||||
|
||||
=== "InfluxDB2"
|
||||
|
||||
| Metric | Type | [Labels](#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. |
|
||||
|
||||
=== "StatsD"
|
||||
|
||||
| Metric | Type | [Labels](#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. |
|
||||
|
||||
!!! note "\{prefix\} Default Value"
|
||||
By default, \{prefix\} value is `traefik`.
|
||||
|
||||
#### Router Metrics
|
||||
|
||||
=== "OpenTelemetry"
|
||||
|
||||
| Metric | Type | [Labels](#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. |
|
||||
|
||||
=== "Prometheus"
|
||||
|
||||
| Metric | Type | [Labels](#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. |
|
||||
|
||||
=== "Datadog"
|
||||
|
||||
| Metric | Type | [Labels](#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. |
|
||||
|
||||
=== "InfluxDB2"
|
||||
|
||||
| Metric | Type | [Labels](#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. |
|
||||
|
||||
=== "StatsD"
|
||||
|
||||
| Metric | Type | [Labels](#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. |
|
||||
|
||||
!!! note "\{prefix\} Default Value"
|
||||
By default, \{prefix\} value is `traefik`.
|
||||
|
||||
#### Service Metrics
|
||||
|
||||
=== "OpenTelemetry"
|
||||
|
||||
| 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. |
|
||||
| `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. |
|
||||
|
||||
=== "Prometheus"
|
||||
|
||||
| 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. |
|
||||
| `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. |
|
||||
|
||||
=== "Datadog"
|
||||
|
||||
| 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. |
|
||||
| `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. |
|
||||
|
||||
=== "InfluxDB2"
|
||||
|
||||
| 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. |
|
||||
| `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. |
|
||||
|
||||
=== "StatsD"
|
||||
|
||||
| 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. |
|
||||
| `{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. |
|
||||
|
||||
!!! note "\{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" |
|
||||
|
||||
!!! info "`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`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods)
|
||||
or the [`PRI`](https://datatracker.ietf.org/doc/html/rfc7540#section-11.6) verb (for `HTTP/2`),
|
||||
then the value for the method label becomes `EXTENSION_METHOD`.
|
|
@ -0,0 +1,62 @@
|
|||
---
|
||||
title: "Traefik Tracing Overview"
|
||||
description: "The Traefik Proxy tracing system allows developers to visualize call flows in their infrastructure. Read the full documentation."
|
||||
---
|
||||
|
||||
# Tracing
|
||||
|
||||
Visualize the Requests Flow
|
||||
{: .subtitle }
|
||||
|
||||
The tracing system allows developers to visualize call flows in their infrastructure.
|
||||
|
||||
Traefik uses [OpenTelemetry](https://opentelemetry.io/ "Link to website of OTel"), an open standard designed for distributed tracing.
|
||||
|
||||
## Configuration Example
|
||||
|
||||
To enable the tracing:
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
tracing: {}
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[tracing]
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--tracing=true
|
||||
```
|
||||
|
||||
```yaml tab="Helm Chart Values"
|
||||
tracing:
|
||||
otlp:
|
||||
enabled: true
|
||||
```
|
||||
|
||||
## Configuration Options
|
||||
|
||||
| Field | Description | Default | Required |
|
||||
|:-----------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------|:---------|
|
||||
| `tracing.addInternals` | Enables tracing for internal resources (e.g.: `ping@internal`). | false | No |
|
||||
| `tracing.serviceName` | Service name used in selected backend. | "traefik" | No |
|
||||
| `tracing.sampleRate` | The proportion of requests to trace, specified between 0.0 and 1.0. | 1.0 | No |
|
||||
| `tracing.globalAttributes` | Applies a list of shared key:value attributes on all spans. | {} | No |
|
||||
| `tracing.capturedRequestHeaders` | Defines the list of request headers to add as attributes.<br />It applies to client and server kind spans.| {} | No |
|
||||
| `tracing.capturedResponseHeaders` | Defines the list of response headers to add as attributes.<br />It applies to client and server kind spans.| {} |False |
|
||||
| `tracing.safeQueryParams` | By default, all query parameters are redacted.<br />Defines the list of query parameters to not redact. | {} | No |
|
||||
| `tracing.otlp.http` | This instructs the exporter to send the tracing to the OpenTelemetry Collector using HTTP.<br /> Setting the sub-options with their default values. | null/false | No |
|
||||
| `tracing.otlp.http.endpoint` | URL of the OpenTelemetry Collector to send tracing to.<br /> Format="`<scheme>://<host>:<port><path>`" | "http://localhost:4318/v1/tracing" | Yes |
|
||||
| `tracing.otlp.http.headers` | Additional headers sent with tracing by the exporter to the OpenTelemetry Collector. | | No |
|
||||
| `tracing.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 |
|
||||
| `tracing.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 |
|
||||
| `tracing.otlp.http.tls.key` | This instructs the exporter to send the tracing to the OpenTelemetry Collector using HTTP.<br /> Setting the sub-options with their default values. | ""null/false "" | No |
|
||||
| `tracing.otlp.http.tls.insecureskipverify` |If `insecureSkipVerify` is `true`, the TLS connection to the OpenTelemetry Collector accepts any certificate presented by the server regardless of the hostnames it covers. | false | Yes |
|
||||
| `tracing.otlp.grpc` | This instructs the exporter to send tracing to the OpenTelemetry Collector using gRPC. | false | No |
|
||||
| `tracing.otlp.grpc.endpoint` | Address of the OpenTelemetry Collector to send tracing to.<br /> Format="`<host>:<port>`" | "localhost:4317" | Yes |
|
||||
| `tracing.otlp.grpc.headers` | Additional headers sent with tracing by the exporter to the OpenTelemetry Collector. | {} | No |
|
||||
| `tracing.otlp.grpc.insecure` |Allows exporter to send tracing to the OpenTelemetry Collector without using a secured protocol. | false | Yes |
|
||||
| `tracing.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 |
|
||||
| `tracing.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 |
|
||||
| `tracing.otlp.grpc.tls.key` | This instructs the exporter to send the tracing to the OpenTelemetry Collector using HTTP.<br /> Setting the sub-options with their default values. | ""null/false "" | No |
|
||||
| `tracing.otlp.grpc.tls.insecureskipverify` |If `insecureSkipVerify` is `true`, the TLS connection to the OpenTelemetry Collector accepts any certificate presented by the server regardless of the hostnames it covers. | false | Yes |
|
Loading…
Add table
Add a link
Reference in a new issue