OpenTelemetry

To enable the OpenTelemetry metrics:

File (YAML)

  1. metrics:
  2. otlp: {}

File (TOML)

  1. [metrics]
  2. [metrics.otlp]

CLI

  1. --metrics.otlp=true

Default protocol

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

addEntryPointsLabels

Optional, Default=true

Enable metrics on entry points.

File (YAML)

  1. metrics:
  2. otlp:
  3. addEntryPointsLabels: true

File (TOML)

  1. [metrics]
  2. [metrics.otlp]
  3. addEntryPointsLabels = true

CLI

  1. --metrics.otlp.addEntryPointsLabels=true

addRoutersLabels

Optional, Default=false

Enable metrics on routers.

File (YAML)

  1. metrics:
  2. otlp:
  3. addRoutersLabels: true

File (TOML)

  1. [metrics]
  2. [metrics.otlp]
  3. addRoutersLabels = true

CLI

  1. --metrics.otlp.addRoutersLabels=true

addServicesLabels

Optional, Default=true

Enable metrics on services.

File (YAML)

  1. metrics:
  2. otlp:
  3. addServicesLabels: true

File (TOML)

  1. [metrics]
  2. [metrics.otlp]
  3. addServicesLabels = true

CLI

  1. --metrics.otlp.addServicesLabels=true

explicitBoundaries

Optional, Default=”.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10”

Explicit boundaries for Histogram data points.

File (YAML)

  1. metrics:
  2. otlp:
  3. explicitBoundaries:
  4. - 0.1
  5. - 0.3
  6. - 1.2
  7. - 5.0

File (TOML)

  1. [metrics]
  2. [metrics.otlp]
  3. explicitBoundaries = [0.1,0.3,1.2,5.0]

CLI

  1. --metrics.otlp.explicitBoundaries=0.1,0.3,1.2,5.0

pushInterval

Optional, Default=10s

Interval at which metrics are sent to the OpenTelemetry Collector.

File (YAML)

  1. metrics:
  2. otlp:
  3. pushInterval: 10s

File (TOML)

  1. [metrics]
  2. [metrics.otlp]
  3. pushInterval = "10s"

CLI

  1. --metrics.otlp.pushInterval=10s

serviceName

Optional, Default=”traefik”

OTEL service name to use.

File (YAML)

  1. metrics:
  2. otlp:
  3. serviceName: name

File (TOML)

  1. [metrics]
  2. [metrics.otlp]
  3. serviceName = "name"

CLI

  1. --metrics.otlp.serviceName=name

HTTP configuration

Optional

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

File (YAML)

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

File (TOML)

  1. [metrics]
  2. [metrics.otlp.http]

CLI

  1. --metrics.otlp.http=true

endpoint

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

URL of the OpenTelemetry Collector to send metrics to.

File (YAML)

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

File (TOML)

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

CLI

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

headers

Optional, Default={}

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

File (YAML)

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

File (TOML)

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

CLI

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

tls

Optional

Defines the Client TLS configuration used by the exporter to send metrics 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. metrics:
  2. otlp:
  3. http:
  4. tls:
  5. ca: path/to/ca.crt

File (TOML)

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

CLI

  1. --metrics.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. metrics:
  2. otlp:
  3. http:
  4. tls:
  5. cert: path/to/foo.cert
  6. key: path/to/foo.key

File (TOML)

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

CLI

  1. --metrics.otlp.http.tls.cert=path/to/foo.cert
  2. --metrics.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. metrics:
  2. otlp:
  3. http:
  4. tls:
  5. cert: path/to/foo.cert
  6. key: path/to/foo.key

File (TOML)

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

CLI

  1. --metrics.otlp.http.tls.cert=path/to/foo.cert
  2. --metrics.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. metrics:
  2. otlp:
  3. http:
  4. tls:
  5. insecureSkipVerify: true

File (TOML)

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

CLI

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

gRPC configuration

Optional

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

File (YAML)

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

File (TOML)

  1. [metrics]
  2. [metrics.otlp.grpc]

CLI

  1. --metrics.otlp.grpc=true

endpoint

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

Address of the OpenTelemetry Collector to send metrics to.

File (YAML)

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

File (TOML)

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

CLI

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

insecure

Optional, Default=false

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

File (YAML)

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

File (TOML)

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

CLI

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

headers

Optional, Default={}

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

File (YAML)

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

File (TOML)

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

CLI

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

tls

Optional

Defines the Client TLS configuration used by the exporter to send metrics 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. metrics:
  2. otlp:
  3. grpc:
  4. tls:
  5. ca: path/to/ca.crt

File (TOML)

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

CLI

  1. --metrics.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. metrics:
  2. otlp:
  3. grpc:
  4. tls:
  5. cert: path/to/foo.cert
  6. key: path/to/foo.key

File (TOML)

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

CLI

  1. --metrics.otlp.grpc.tls.cert=path/to/foo.cert
  2. --metrics.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. metrics:
  2. otlp:
  3. grpc:
  4. tls:
  5. cert: path/to/foo.cert
  6. key: path/to/foo.key

File (TOML)

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

CLI

  1. --metrics.otlp.grpc.tls.cert=path/to/foo.cert
  2. --metrics.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. metrics:
  2. otlp:
  3. grpc:
  4. tls:
  5. insecureSkipVerify: true

File (TOML)

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

CLI

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