Home / Companies / Grafana Labs / Blog / Post Details
Content Deep Dive

How to monitor HCP Terraform and Terraform Enterprise with Grafana Cloud

Blog post from Grafana Labs

Post Details
Company
Date Published
Author
Rajesh Mahalingaswamy
Word Count
1,665
Company Posts That Month
1
Language
English
Hacker News Points
-
Post removed?
No
Summary

HCP Terraform and Terraform Enterprise self-hosted agents emit OpenTelemetry traces and metrics for run phases and write logs to standard output, enabling centralized monitoring when connected to Grafana Cloud through Grafana Alloy. The walkthrough uses Docker Compose to run an Alloy collector alongside an HCP Terraform agent, with the agent sending OTLP traces and metrics to Alloy while Alloy reads container logs through the Docker API, assigns them a matching service name, converts delta metrics to the cumulative format required by Grafana Cloud Metrics, and exports all signals to Grafana Cloud. It requires HCP Terraform agent execution mode, a configured agent pool and token, Grafana Cloud OTLP credentials, Terraform CLI, and Docker. After starting the stack and triggering Terraform runs in a workspace bound to the agent pool, users can inspect plan and apply traces in Tempo, agent metrics such as initialization and apply durations in Mimir, and execution logs in Loki. Key considerations include ensuring workspaces use agent rather than remote execution, running multiple licensed agents for concurrent workloads, separately collecting stdout and stderr logs because they are not emitted through OTLP, correlating logs with traces through a shared service name, and pinning collector versions for dependable production use.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
OpenTelemetry 5 158 34 25 -85%
Secrets Management 2 584 99 52 -76%
Kubernetes 1 634 79 44 -75%
Real-time 1 1,106 270 109 -81%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.