Pcornel
Observability · OpenTelemetry

OpenTelemetry SDK Configuration

Cheat sheet · https://pcornel.dk/topic.php?topic=6214

Back to the Topic

Answer

OpenTelemetry SDK configuration sets the resource (service.name, version, environment), exporters, propagators, samplers and batch settings — usually via OTEL_* environment variables.

Remember

Set OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES everywhere. Point OTEL_EXPORTER_OTLP_ENDPOINT to the local Collector. Use the batch processor in production.

First checks

  • env | grep ^OTEL_ — first check for this topic
  • curl -s localhost:9090/-/ready — Prometheus ready
  • curl -s 'localhost:9090/api/v1/query?query=up' — scrape targets up/down
  • promtool check config prometheus.yml — config valid

Verify in this order

env/config → SDK provider → processors → exporter → Collector

Where it usually breaks

Sending http/protobuf to the gRPC port fails silently in some SDKs.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6214

Confirmation

Confirm action

Continue?