Skip to main content

Observability Configuration

Configuration

Basics

Before getting started, you need to set up or register observability backend services. They can be either managed or self-hosted services that support OpenTelemetry OTLP protocols.

The configuration is identical to the specification of OpenTelemetry OTLP exporter. The minimum configuration are the following environments:

  • OTEL_EXPORTER_OTLP_ENDPOINT: A base endpoint URL for any signal type, with an optionally-specified port number.
  • OTEL_EXPORTER_OTLP_PROTOCOL: Specifies the OTLP transport protocol to be used for all telemetry data that typically be either http/protobuf or grpc. Default value is grpc.

Traces

Traces is enabled by default if OTEL_EXPORTER_OTLP_ENDPOINT environment variable is set. If the Trace receiver endpoint of the observability service is different from other data types, you can configure a custom endpoint with the OTEL_EXPORTER_OTLP_TRACES_ENDPOINT environment variable.

Metrics

You can export either Prometheus or OTLP via the OTEL_METRICS_EXPORTER environment variable.

  • prometheus: export metrics to the /metrics endpoint. The Prometheus server can scrape metrics from this endpoint. If you want customize a different port for the exporter, setting the OTEL_EXPORTER_PROMETHEUS_PORT environment variable.
  • otlp: export metrics to a remote observability service via the OTLP protocol. The endpoint is configured via OTEL_EXPORTER_OTLP_ENDPOINT environment variable. If the metrics endpoint is different from other data types, you can configure a custom endpoint with the OTEL_EXPORTER_OTLP_METRICS_ENDPOINT environment variable.
  • none: Disable metrics (default).

Logs

Logs are disabled by default. Setting OTEL_LOGS_EXPORTER=otlp environment variable to enable it. The endpoint is configured via OTEL_EXPORTER_OTLP_ENDPOINT environment variable. If the logs endpoint is different from other data types, you can configure a custom endpoint with the OTEL_EXPORTER_OTLP_LOGS_ENDPOINT environment variable.