traefik/docs/content/observability/metrics/opentelemetry.md
2022-11-29 15:34:05 +01:00

6.3 KiB

title description
Traefik OpenTelemetry Documentation Traefik supports several metrics backends, including OpenTelemetry. Learn how to implement it for observability in Traefik Proxy. Read the technical documentation.

OpenTelemetry

To enable the OpenTelemetry:

metrics:
  openTelemetry: {}
[metrics]
  [metrics.openTelemetry]
--metrics.openTelemetry=true

!!! info "The OpenTelemetry exporter will export metrics to the collector by using HTTP by default, see the gRPC Section to use gRPC."

address

Required, Default="localhost:4318", Format="<host>:<port>"

Address of the OpenTelemetry Collector to send metrics to.

metrics:
  openTelemetry:
    address: localhost:4318
[metrics]
  [metrics.openTelemetry]
    address = "localhost:4318"
--metrics.openTelemetry.address=localhost:4318

addEntryPointsLabels

Optional, Default=true

Enable metrics on entry points.

metrics:
  openTelemetry:
    addEntryPointsLabels: true
[metrics]
  [metrics.openTelemetry]
    addEntryPointsLabels = true
--metrics.openTelemetry.addEntryPointsLabels=true

addRoutersLabels

Optional, Default=false

Enable metrics on routers.

metrics:
  openTelemetry:
    addRoutersLabels: true
[metrics]
  [metrics.openTelemetry]
    addRoutersLabels = true
--metrics.openTelemetry.addRoutersLabels=true

addServicesLabels

Optional, Default=true

Enable metrics on services.

metrics:
  openTelemetry:
    addServicesLabels: true
[metrics]
  [metrics.openTelemetry]
    addServicesLabels = true
--metrics.openTelemetry.addServicesLabels=true

explicitBoundaries

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

Explicit boundaries for Histogram data points.

metrics:
  openTelemetry:
    explicitBoundaries:
      - 0.1
      - 0.3
      - 1.2
      - 5.0
[metrics]
  [metrics.openTelemetry]
    explicitBoundaries = [0.1,0.3,1.2,5.0]
--metrics.openTelemetry.explicitBoundaries=0.1,0.3,1.2,5.0

headers

Optional, Default={}

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

metrics:
  openTelemetry:
    headers:
      foo: bar
      baz: buz
[metrics]
  [metrics.openTelemetry.headers]
    foo = "bar"
    baz = "buz"
--metrics.openTelemetry.headers.foo=bar --metrics.openTelemetry.headers.baz=buz

insecure

Optional, Default=false

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

metrics:
  openTelemetry:
    insecure: true
[metrics]
  [metrics.openTelemetry]
    insecure = true
--metrics.openTelemetry.insecure=true

pushInterval

Optional, Default=10s

Interval at which metrics are sent to the OpenTelemetry Collector.

metrics:
  openTelemetry:
    pushInterval: 10s
[metrics]
  [metrics.openTelemetry]
    pushInterval = "10s"
--metrics.openTelemetry.pushInterval=10s

path

Required, Default="/v1/traces"

Allows to override the default URL path used for sending metrics. This option has no effect when using gRPC transport.

metrics:
  openTelemetry:
    path: /foo/v1/traces
[metrics]
  [metrics.openTelemetry]
    path = "/foo/v1/traces"
--metrics.openTelemetry.path=/foo/v1/traces

tls

Optional

Defines the TLS configuration used by the reporter 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.

metrics:
  openTelemetry:
    tls:
      ca: path/to/ca.crt
[metrics.openTelemetry.tls]
  ca = "path/to/ca.crt"
--metrics.openTelemetry.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.

metrics:
  openTelemetry:
    tls:
      cert: path/to/foo.cert
      key: path/to/foo.key
[metrics.openTelemetry.tls]
  cert = "path/to/foo.cert"
  key = "path/to/foo.key"
--metrics.openTelemetry.tls.cert=path/to/foo.cert
--metrics.openTelemetry.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.

metrics:
  openTelemetry:
    tls:
      cert: path/to/foo.cert
      key: path/to/foo.key
[metrics.openTelemetry.tls]
  cert = "path/to/foo.cert"
  key = "path/to/foo.key"
--metrics.openTelemetry.tls.cert=path/to/foo.cert
--metrics.openTelemetry.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.

metrics:
  openTelemetry:
    tls:
      insecureSkipVerify: true
[metrics.openTelemetry.tls]
  insecureSkipVerify = true
--metrics.openTelemetry.tls.insecureSkipVerify=true

gRPC configuration

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

metrics:
  openTelemetry:
    grpc: {}
[metrics]
  [metrics.openTelemetry.grpc]
--metrics.openTelemetry.grpc=true