OpenTelemetry
To enable the OpenTelemetry tracer:
File (YAML)
tracing:
otlp: {}
File (TOML)
[tracing]
[tracing.otlp]
CLI
--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:
OTEL_PROPAGATORS=b3,jaeger
HTTP configuration
Optional
This instructs the exporter to send spans to the OpenTelemetry Collector using HTTP.
File (YAML)
tracing:
otlp:
http: {}
File (TOML)
[tracing]
[tracing.otlp.http]
CLI
--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)
tracing:
otlp:
http:
endpoint: http://localhost:4318/v1/traces
File (TOML)
[tracing]
[tracing.otlp.http]
endpoint = "http://localhost:4318/v1/traces"
CLI
--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)
tracing:
otlp:
http:
headers:
foo: bar
baz: buz
File (TOML)
[tracing]
[tracing.otlp.http.headers]
foo = "bar"
baz = "buz"
CLI
--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)
tracing:
otlp:
http:
tls:
ca: path/to/ca.crt
File (TOML)
[tracing.otlp.http.tls]
ca = "path/to/ca.crt"
CLI
--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)
tracing:
otlp:
http:
tls:
cert: path/to/foo.cert
key: path/to/foo.key
File (TOML)
[tracing.otlp.http.tls]
cert = "path/to/foo.cert"
key = "path/to/foo.key"
CLI
--tracing.otlp.http.tls.cert=path/to/foo.cert
--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)
tracing:
otlp:
http:
tls:
cert: path/to/foo.cert
key: path/to/foo.key
File (TOML)
[tracing.otlp.http.tls]
cert = "path/to/foo.cert"
key = "path/to/foo.key"
CLI
--tracing.otlp.http.tls.cert=path/to/foo.cert
--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)
tracing:
otlp:
http:
tls:
insecureSkipVerify: true
File (TOML)
[tracing.otlp.http.tls]
insecureSkipVerify = true
CLI
--tracing.otlp.http.tls.insecureSkipVerify=true
gRPC configuration
Optional
This instructs the exporter to send spans to the OpenTelemetry Collector using gRPC.
File (YAML)
tracing:
otlp:
grpc: {}
File (TOML)
[tracing]
[tracing.otlp.grpc]
CLI
--tracing.otlp.grpc=true
endpoint
Required, Default=”localhost:4317”, Format=”<host>:<port>
“
Address of the OpenTelemetry Collector to send spans to.
File (YAML)
tracing:
otlp:
grpc:
endpoint: localhost:4317
File (TOML)
[tracing]
[tracing.otlp.grpc]
endpoint = "localhost:4317"
CLI
--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)
tracing:
otlp:
grpc:
insecure: true
File (TOML)
[tracing]
[tracing.otlp.grpc]
insecure = true
CLI
--tracing.otlp.grpc.insecure=true
headers
Optional, Default={}
Additional headers sent with traces by the exporter to the OpenTelemetry Collector.
File (YAML)
tracing:
otlp:
grpc:
headers:
foo: bar
baz: buz
File (TOML)
[tracing]
[tracing.otlp.grpc.headers]
foo = "bar"
baz = "buz"
CLI
--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)
tracing:
otlp:
grpc:
tls:
ca: path/to/ca.crt
File (TOML)
[tracing.otlp.grpc.tls]
ca = "path/to/ca.crt"
CLI
--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)
tracing:
otlp:
grpc:
tls:
cert: path/to/foo.cert
key: path/to/foo.key
File (TOML)
[tracing.otlp.grpc.tls]
cert = "path/to/foo.cert"
key = "path/to/foo.key"
CLI
--tracing.otlp.grpc.tls.cert=path/to/foo.cert
--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)
tracing:
otlp:
grpc:
tls:
cert: path/to/foo.cert
key: path/to/foo.key
File (TOML)
[tracing.otlp.grpc.tls]
cert = "path/to/foo.cert"
key = "path/to/foo.key"
CLI
--tracing.otlp.grpc.tls.cert=path/to/foo.cert
--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)
tracing:
otlp:
grpc:
tls:
insecureSkipVerify: true
File (TOML)
[tracing.otlp.grpc.tls]
insecureSkipVerify = true
CLI
--tracing.otlp.grpc.tls.insecureSkipVerify=true