Well-Architected Framework
Manage vendor monitoring tools with Terraform
Terraform makes it easy to deploy and manage various vendor monitoring tools through official providers and modules. Terraform has over 200 partner and community providers for logging and monitoring — some popular ones include DataDog, New Relic, Grafana, and Splunk. With these providers, you can automatically provision the monitoring tool, and its resources like dashboard alerts.
Many monitoring vendors also contribute to OpenTelemetry (OTel). OpenTelemetry provides a standardized way to generate and export telemetry data like metrics, traces, and logs from your applications. The OpenTelemetry agent collects this data from your applications. Instead of deploying separate agents for each vendor monitoring tool, you can configure the OTel agent to export data to multiple backends simultaneously. For example, you can send metrics to Datadog, traces to Honeycomb, and logs to Splunk from the same Otel agent.
With Terraform, you have a unified approach to manage and operate all different monitoring systems through a single, automated workflow defined in code. Terraform lets you define the exact configuration you want for everything — from the OpenTelemetry agents collecting data (Refer to GCE example in external resources) to backend monitoring tools like DataDog, New Relic, Grafana, and others.
HashiCorp resources:
- The Terraform Datadog provider tutorial guides you through how to use Terraform to deploy an application in EKS and install the DataDog agent across the Kubernetes cluster.
- Terraform Registry hosts over 200 Logging and Monitoring partner and community providers. You should be able to find a provider to manage your monitoring tool of choice. This includes popular providers such as the New Relic Terraform provider and DataDog Terraform provider.
External resources:
The Deploying OpenTelemetry (OTel) agent to your GCE instances article provides insights from LiveRamp as they automatically deploy OTel agents using Terraform on their Google Cloud instances.
DataDog provides a quick start guide where they walk you through creating dashboards, deploying monitors and alerts, and integrating into AWS. This guide uses the resources in the DataDog provider module.
New Relic provides resources on implementing monitoring-as-code (MaC) with Terraform:
- The Automate your configuration with observability as code tutorial covers the importance of codifying monitoring using HCL.
- A three-part series guides you through using Terraform with JSON to create and dynamically generate New Relic dashboards:
- Creating dashboards with Terraform and JSON templates guides you through quickly updating New Relic dashboards with Terraform by using JSON templates
- Dynamically creating New Relic dashboards with Terraform guides you through using JSON templates to create dynamic dashboards
- Using Terraform to generate New Relic dashboards from NRQL queries guides you through using Terraform and NRQL queries to generate dashboards with dynamic data
Next steps
In this section of Configure dashboards and alerts, you found resources to help you configure OTel on your services and manage vendor monitoring tools with Terraform. Manage vendor monitoring tools with Terraform is part of the Define and automate processes pillar.