<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/what-is-terraform-observability-and-how-does-it-work--8an8p7pr1" -->

---
title: What Is Terraform Observability and How Does It Work?
description: Terraform observability means collecting logs, metrics, and traces from every component in a Terraform run: version control, the runner, the Terraform binary,...
canonical: https://daily.dev/posts/what-is-terraform-observability-and-how-does-it-work--8an8p7pr1
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: What Is Terraform Observability and How Does It Work? | daily.dev
og:description: Terraform observability means collecting logs, metrics, and traces from every component in a Terraform run: version control, the runner, the Terraform binary,...
og:url: https://daily.dev/posts/what-is-terraform-observability-and-how-does-it-work--8an8p7pr1
og:image: https://api.daily.dev/og/posts/8An8P7pR1.png
og:image:alt: What Is Terraform Observability and How Does It Work?
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# What Is Terraform Observability and How Does It Work?

**[Spacelift](https://daily.dev/sources/spacelift)** · 22 min read · 4 upvotes · 0 comments

## Summary

Terraform observability means collecting logs, metrics, and traces from every component in a Terraform run: version control, the runner, the Terraform binary, the state backend, provider APIs, and the provisioned infrastructure. Explains the difference between monitoring and observability, walks through the three pillars (metrics via terraform plan -json, logs via TF_LOG_CORE/TF_LOG_PROVIDER, and traces via an experimental OTLP exporter), and gives a seven-step implementation guide covering state backend logs, drift detection with terraform plan -refresh-only, log/metric collection from Terraform operations and automation platforms, provider/API auditing, and dashboards. Also covers best practices like alerting on actionable conditions, monitoring critical dependencies, and maintaining audit trails, closing with a promotion of Spacelift's observability integrations and platform features.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://spacelift.io/blog/terraform-observability>

## Questions this post answers

### Can I use OpenTelemetry tracing with Terraform CLI?

Yes, but only through an experimental interface. Terraform CLI includes an OTLP trace exporter enabled via the OTEL_TRACES_EXPORTER=otlp environment variable, but HashiCorp marks it in the source code as experimental and not a committed interface, meaning it can change or be removed between releases. Terragrunt offers proper trace export support via TG_TELEMETRY_TRACE_EXPORTER, and the HCP Terraform agent exports via TFC_AGENT_OTLP_ADDRESS.

_Anyone wiring tracing into a Terraform pipeline can track tooling changes like this on daily.dev._

### How do I detect infrastructure drift in a Terraform-managed environment?

Run terraform plan with the -refresh-only and -detailed-exitcode flags on a schedule, which causes Terraform to exit with code 2 when planned changes (drift) exist without reporting changes from new code pushes. A common pattern is a scheduled GitHub Actions workflow that runs this command daily and raises a warning when the exit code is 2, then either remediates via apply or updates configuration to match manual changes.

_Teams building drift detection pipelines can follow ongoing Terraform tooling discussions on daily.dev._

### What environment variables control Terraform logging verbosity?

TF_LOG sets overall verbosity to TRACE, DEBUG, INFO, WARN, or ERROR, with TRACE being most verbose and a JSON option producing machine-parseable output. TF_LOG_CORE and TF_LOG_PROVIDER control verbosity separately for Terraform core versus provider plugins, and TF_LOG_PATH persists logs to a file; TRACE and DEBUG levels may expose sensitive resource data, so they should only be enabled when actively troubleshooting.

_Engineers debugging Terraform runs can keep tabs on IaC tooling practices via daily.dev._

## Similar posts on daily.dev

- [Observability vs. Visibility: What's the Difference?](https://daily.dev/posts/observability-vs-visibility-what-s-the-difference--oktsst6fr) · Last9 · 0 upvotes · 0 comments
- [Why Observability is Critical for Modern Cloud‑Native Systems](https://daily.dev/posts/why-observability-is-critical-for-modern-cloud-native-systems-iqylreqhz) · Cloud Native Now · 1 upvotes · 0 comments

---

Tags: [#observability](https://daily.dev/tags/observability), [#terraform](https://daily.dev/tags/terraform), [#iac](https://daily.dev/tags/iac), [#opentelemetry](https://daily.dev/tags/opentelemetry)

[View this post on daily.dev](https://daily.dev/posts/what-is-terraform-observability-and-how-does-it-work--8an8p7pr1)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"What Is Terraform Observability and How Does It Work?","url":"https://daily.dev/posts/what-is-terraform-observability-and-how-does-it-work--8an8p7pr1","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/what-is-terraform-observability-and-how-does-it-work--8an8p7pr1"},"datePublished":"2026-08-31T09:34:19.969Z","dateModified":"2026-08-31T09:34:51.259Z","description":"Terraform observability means collecting logs, metrics, and traces from every component in a Terraform run: version control, the runner, the Terraform binary,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d727c27b47c38a2812a0d77f4afd1ae1?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d727c27b47c38a2812a0d77f4afd1ae1?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Spacelift","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Spacelift","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/422b4004f7b24dc988e5720eca3accfc","url":"https://daily.dev/sources/spacelift"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/what-is-terraform-observability-and-how-does-it-work--8an8p7pr1","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"observability,terraform,iac,opentelemetry","timeRequired":"PT22M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Spacelift","item":"https://daily.dev/sources/spacelift"},{"@type":"ListItem","position":3,"name":"What Is Terraform Observability and How Does It Work?"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/what-is-terraform-observability-and-how-does-it-work--8an8p7pr1#faq","mainEntity":[{"@type":"Question","name":"Can I use OpenTelemetry tracing with Terraform CLI?","acceptedAnswer":{"@type":"Answer","text":"Yes, but only through an experimental interface. Terraform CLI includes an OTLP trace exporter enabled via the OTEL_TRACES_EXPORTER=otlp environment variable, but HashiCorp marks it in the source code as experimental and not a committed interface, meaning it can change or be removed between releases. Terragrunt offers proper trace export support via TG_TELEMETRY_TRACE_EXPORTER, and the HCP Terraform agent exports via TFC_AGENT_OTLP_ADDRESS. Anyone wiring tracing into a Terraform pipeline can track tooling changes like this on daily.dev."}},{"@type":"Question","name":"How do I detect infrastructure drift in a Terraform-managed environment?","acceptedAnswer":{"@type":"Answer","text":"Run terraform plan with the -refresh-only and -detailed-exitcode flags on a schedule, which causes Terraform to exit with code 2 when planned changes (drift) exist without reporting changes from new code pushes. A common pattern is a scheduled GitHub Actions workflow that runs this command daily and raises a warning when the exit code is 2, then either remediates via apply or updates configuration to match manual changes. Teams building drift detection pipelines can follow ongoing Terraform tooling discussions on daily.dev."}},{"@type":"Question","name":"What environment variables control Terraform logging verbosity?","acceptedAnswer":{"@type":"Answer","text":"TF_LOG sets overall verbosity to TRACE, DEBUG, INFO, WARN, or ERROR, with TRACE being most verbose and a JSON option producing machine-parseable output. TF_LOG_CORE and TF_LOG_PROVIDER control verbosity separately for Terraform core versus provider plugins, and TF_LOG_PATH persists logs to a file; TRACE and DEBUG levels may expose sensitive resource data, so they should only be enabled when actively troubleshooting. Engineers debugging Terraform runs can keep tabs on IaC tooling practices via daily.dev."}}]}
```

