website/docs/internals/tracing.mdx
:::warning Experimental Feature OpenTelemetry tracing support is experimental and may change in future releases. :::
OpenTofu 1.10.0 introduces support for OpenTelemetry (OTel) tracing, providing visibility into OpenTofu's internal operations. This feature helps you debug performance issues, understand operation flows, and optimize your infrastructure workflows.
OpenTofu's tracing implementation is designed with privacy as the top priority:
As the OpenTofu team emphasizes: "Although this builds on a project named OpenTelemetry, we are adding this support explicitly for you to trace your application using your tooling on your infrastructure." This feature is not intended to collect any data about OpenTofu usage patterns or user behavior for the OpenTofu project itself.
The easiest way to get started is with Jaeger, an open-source distributed tracing platform:
docker run -d --rm --name jaeger \
-p 16686:16686 \
-p 4317:4317 \
-p 4318:4318 \
jaegertracing/jaeger:latest
Enable tracing by setting these environment variables:
# Enable OTLP trace exporter
export OTEL_TRACES_EXPORTER=otlp
# Point to your Jaeger instance
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
# Required for local development (skip TLS verification)
export OTEL_EXPORTER_OTLP_INSECURE=true
Now any OpenTofu command will generate traces:
tofu init # Traces provider downloads
tofu plan # Traces planning operations
tofu apply # Traces apply workflow
Open your browser and navigate to http://localhost:16686 to access the Jaeger UI. You'll see your OpenTofu operations broken down into detailed traces.
OpenTofu supports standard OpenTelemetry environment variables for configuration:
| Variable | Description | Example |
|---|---|---|
OTEL_TRACES_EXPORTER | Must be set to otlp to enable tracing | otlp |
OTEL_EXPORTER_OTLP_ENDPOINT | OTLP endpoint URL | http://localhost:4317 |
OTEL_EXPORTER_OTLP_INSECURE | Skip TLS verification | true for local dev |
Additional OTLP configuration options are supported. See the OpenTelemetry documentation for details.
:::note In this experimental implementation, OpenTofu always samples 100% of traces when tracing is enabled. Sampling configuration is not currently supported. :::
While Jaeger is great for getting started, OpenTofu's OpenTelemetry support works with any OTLP-compatible backend such as Grafana Tempo, AWS X-Ray, or Datadog.
Tracing helps identify bottlenecks in your OpenTofu workflows:
In continuous integration environments, tracing can reveal:
For complex deployments across regions or environments:
This experimental feature is actively being developed. The OpenTofu team is particularly interested in feedback about:
Please share your feedback through GitHub issues or the OpenTofu Slack community.