OpenTelemetry

To enable the OpenTelemetry tracer:

File (YAML)

  1. tracing:
  2. otlp: {}

File (TOML)

  1. [tracing]
  2. [tracing.otlp]

CLI

  1. --tracing.otlp=true

Default protocol

The OpenTelemetry trace exporter will export traces to the collector using HTTP by default to https://localhost:4318/v1/traces, see the gRPC Section to use gRPC.

Trace sampling

By default, the OpenTelemetry trace exporter will sample 100% of traces.
See OpenTelemetry’s SDK configuration to customize the sampling strategy.

Propagation

Traefik supports the OTEL_PROPAGATORS env variable to set up the propragators. The supported propagators are:

  • tracecontext (default)
  • baggage (default)
  • b3
  • b3multi
  • jaeger
  • xray
  • ottrace

Example of configuration:

  1. OTEL_PROPAGATORS=b3,jaeger

HTTP configuration

Optional

This instructs the exporter to send spans to the OpenTelemetry Collector using HTTP.

File (YAML)

  1. tracing:
  2. otlp:
  3. http: {}

File (TOML)

  1. [tracing]
  2. [tracing.otlp.http]

CLI

  1. --tracing.otlp.http=true

endpoint

Required, Default=”http://localhost:4318/v1/traces“, Format=”<scheme>://<host>:<port><path>

URL of the OpenTelemetry Collector to send spans to.

File (YAML)

  1. tracing:
  2. otlp:
  3. http:
  4. endpoint: http://localhost:4318/v1/traces

File (TOML)

  1. [tracing]
  2. [tracing.otlp.http]
  3. endpoint = "http://localhost:4318/v1/traces"

CLI

  1. --tracing.otlp.http.endpoint=http://localhost:4318/v1/traces

headers

Optional, Default={}

Additional headers sent with traces by the exporter to the OpenTelemetry Collector.

File (YAML)

  1. tracing:
  2. otlp:
  3. http:
  4. headers:
  5. foo: bar
  6. baz: buz

File (TOML)

  1. [tracing]
  2. [tracing.otlp.http.headers]
  3. foo = "bar"
  4. baz = "buz"

CLI

  1. --tracing.otlp.http.headers.foo=bar --tracing.otlp.http.headers.baz=buz

tls

Optional

Defines the Client TLS configuration used by the exporter to send spans to the OpenTelemetry Collector.

ca

Optional

ca is the path to the certificate authority used for the secure connection to the OpenTelemetry Collector, it defaults to the system bundle.

File (YAML)

  1. tracing:
  2. otlp:
  3. http:
  4. tls:
  5. ca: path/to/ca.crt

File (TOML)

  1. [tracing.otlp.http.tls]
  2. ca = "path/to/ca.crt"

CLI

  1. --tracing.otlp.http.tls.ca=path/to/ca.crt
cert

Optional

cert is the path to the public certificate used for the secure connection to the OpenTelemetry Collector. When using this option, setting the key option is required.

File (YAML)

  1. tracing:
  2. otlp:
  3. http:
  4. tls:
  5. cert: path/to/foo.cert
  6. key: path/to/foo.key

File (TOML)

  1. [tracing.otlp.http.tls]
  2. cert = "path/to/foo.cert"
  3. key = "path/to/foo.key"

CLI

  1. --tracing.otlp.http.tls.cert=path/to/foo.cert
  2. --tracing.otlp.http.tls.key=path/to/foo.key
key

Optional

key is the path to the private key used for the secure connection to the OpenTelemetry Collector. When using this option, setting the cert option is required.

File (YAML)

  1. tracing:
  2. otlp:
  3. http:
  4. tls:
  5. cert: path/to/foo.cert
  6. key: path/to/foo.key

File (TOML)

  1. [tracing.otlp.http.tls]
  2. cert = "path/to/foo.cert"
  3. key = "path/to/foo.key"

CLI

  1. --tracing.otlp.http.tls.cert=path/to/foo.cert
  2. --tracing.otlp.http.tls.key=path/to/foo.key
insecureSkipVerify

Optional, Default=false

If insecureSkipVerify is true, the TLS connection to the OpenTelemetry Collector accepts any certificate presented by the server regardless of the hostnames it covers.

File (YAML)

  1. tracing:
  2. otlp:
  3. http:
  4. tls:
  5. insecureSkipVerify: true

File (TOML)

  1. [tracing.otlp.http.tls]
  2. insecureSkipVerify = true

CLI

  1. --tracing.otlp.http.tls.insecureSkipVerify=true

gRPC configuration

Optional

This instructs the exporter to send spans to the OpenTelemetry Collector using gRPC.

File (YAML)

  1. tracing:
  2. otlp:
  3. grpc: {}

File (TOML)

  1. [tracing]
  2. [tracing.otlp.grpc]

CLI

  1. --tracing.otlp.grpc=true

endpoint

Required, Default=”localhost:4317”, Format=”<host>:<port>

Address of the OpenTelemetry Collector to send spans to.

File (YAML)

  1. tracing:
  2. otlp:
  3. grpc:
  4. endpoint: localhost:4317

File (TOML)

  1. [tracing]
  2. [tracing.otlp.grpc]
  3. endpoint = "localhost:4317"

CLI

  1. --tracing.otlp.grpc.endpoint=localhost:4317

insecure

Optional, Default=false

Allows exporter to send spans to the OpenTelemetry Collector without using a secured protocol.

File (YAML)

  1. tracing:
  2. otlp:
  3. grpc:
  4. insecure: true

File (TOML)

  1. [tracing]
  2. [tracing.otlp.grpc]
  3. insecure = true

CLI

  1. --tracing.otlp.grpc.insecure=true

headers

Optional, Default={}

Additional headers sent with traces by the exporter to the OpenTelemetry Collector.

File (YAML)

  1. tracing:
  2. otlp:
  3. grpc:
  4. headers:
  5. foo: bar
  6. baz: buz

File (TOML)

  1. [tracing]
  2. [tracing.otlp.grpc.headers]
  3. foo = "bar"
  4. baz = "buz"

CLI

  1. --tracing.otlp.grpc.headers.foo=bar --tracing.otlp.grpc.headers.baz=buz

tls

Optional

Defines the Client TLS configuration used by the exporter to send spans to the OpenTelemetry Collector.

ca

Optional

ca is the path to the certificate authority used for the secure connection to the OpenTelemetry Collector, it defaults to the system bundle.

File (YAML)

  1. tracing:
  2. otlp:
  3. grpc:
  4. tls:
  5. ca: path/to/ca.crt

File (TOML)

  1. [tracing.otlp.grpc.tls]
  2. ca = "path/to/ca.crt"

CLI

  1. --tracing.otlp.grpc.tls.ca=path/to/ca.crt
cert

Optional

cert is the path to the public certificate used for the secure connection to the OpenTelemetry Collector. When using this option, setting the key option is required.

File (YAML)

  1. tracing:
  2. otlp:
  3. grpc:
  4. tls:
  5. cert: path/to/foo.cert
  6. key: path/to/foo.key

File (TOML)

  1. [tracing.otlp.grpc.tls]
  2. cert = "path/to/foo.cert"
  3. key = "path/to/foo.key"

CLI

  1. --tracing.otlp.grpc.tls.cert=path/to/foo.cert
  2. --tracing.otlp.grpc.tls.key=path/to/foo.key
key

Optional

key is the path to the private key used for the secure connection to the OpenTelemetry Collector. When using this option, setting the cert option is required.

File (YAML)

  1. tracing:
  2. otlp:
  3. grpc:
  4. tls:
  5. cert: path/to/foo.cert
  6. key: path/to/foo.key

File (TOML)

  1. [tracing.otlp.grpc.tls]
  2. cert = "path/to/foo.cert"
  3. key = "path/to/foo.key"

CLI

  1. --tracing.otlp.grpc.tls.cert=path/to/foo.cert
  2. --tracing.otlp.grpc.tls.key=path/to/foo.key
insecureSkipVerify

Optional, Default=false

If insecureSkipVerify is true, the TLS connection to the OpenTelemetry Collector accepts any certificate presented by the server regardless of the hostnames it covers.

File (YAML)

  1. tracing:
  2. otlp:
  3. grpc:
  4. tls:
  5. insecureSkipVerify: true

File (TOML)

  1. [tracing.otlp.grpc.tls]
  2. insecureSkipVerify = true

CLI

  1. --tracing.otlp.grpc.tls.insecureSkipVerify=true