Switch it on
OpenTofu ships tracing disabled and sends nothing until you name an exporter. Export
these before you run anything; every tofu command then emits one trace, with a span per
resource instance. Needs OpenTofu 1.10 or newer, where tracing arrived as an experimental
feature.
export OTEL_TRACES_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://ingestion.eu.bronto.io/v1/traces
export OTEL_EXPORTER_OTLP_HEADERS="x-bronto-api-key=$BRONTO_API_KEY"
export OTEL_SERVICE_NAME=opentofu
tofu apply
export OTEL_TRACES_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4318/v1/traces
export OTEL_SERVICE_NAME=opentofu
tofu apply
This assumes a Collector listening on localhost:4318; the
Local Collector setup shows how to start one.
This uses the endpoint and auth header you saved in the setup guide.
export OTEL_TRACES_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=YOUR_OTLP_ENDPOINT/v1/traces
export OTEL_EXPORTER_OTLP_HEADERS="YOUR_AUTH_HEADER=YOUR_AUTH_VALUE"
export OTEL_SERVICE_NAME=opentofu
tofu apply