惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

Datadog | The Monitor blog

Reduce CVE noise with OpenVEX assessments in Datadog How we made a SQL query optimization agent 59% more accurate using autoresearch and LLM Observability How to audit and clean up monitors effectively Diagnose slow PostgreSQL queries faster with explain plan correlation Explore Datadog metrics with Natural Language Queries Toto 2.0: Time series forecasting enters the scaling era Simplify micro-frontend observability with Datadog RUM Attribute AI costs across providers with Datadog Cloud Cost Management Diagnose and resolve database performance issues faster with Database Investigator Datadog for Government achieves FedRAMP® High certification Analyze cloud costs with flexible spreadsheets in Datadog Sheets Inside Datadog’s AI Research Lab: Meet two PhD candidates behind Toto Connect triage and investigation in a single workflow with Datadog Cloud SIEM This Month in Datadog - April 2026 Monitor and optimize Supabase query performance with Datadog Database Monitoring Add dynamically updating context to logs with Reference Tables and Observability Pipelines Introducing ARFBench: A time series question-answering benchmark based on real incidents The product signal latency gap slowing your growth Test network paths with TCP, UDP, and ICMP in Datadog Turn developer feedback into operational insight with Datadog Forms and Sheets How to investigate cloud credential compromise with Bits AI Security Analyst Evaluate, optimize, and secure your Google Cloud AI stack with Datadog Bringing observability data hosting to the UK on AWS Identify and fix code issues faster with Datadog’s Azure DevOps Source Code integration Steganography at scale: Embedding share URLs in Datadog widget screenshots Every team should be A/B testing Centralize observability management with Datadog Governance Console Spotting CI/CD misconfigurations before the bots do: Securing GitHub Actions with Datadog IaC Security Route OTel data from AI apps to ClickHouse and Datadog using Observability Pipelines Manage service tracing across hosts with Single Step Instrumentation rules Offline evaluation for AI agents: Best practices Detect runtime threats in Python Lambda functions with Datadog AAP Introducing our open source AI-native SAST Instrument and monitor Boomi integration flows with OpenTelemetry and Datadog Not all index scans are equal: How we cut query latency by over 99% Platform engineering metrics: What to measure and what to ignore Integrate Recorded Future threat intelligence with Datadog Cloud SIEM CI/CD security: threat modeling using a MITRE-style threat matrix CI/CD security: How to secure your GitHub ecosystem Ingress NGINX is EOL: A practical guide for migrating to Kubernetes Gateway API How we built a real-world evaluation platform for autonomous SRE agents at scale Operating agentic AI with Amazon Bedrock AgentCore and Datadog LLM Observability: Lessons from NTT DATA Introducing the Datadog Code Security MCP Capture and analyze custom heatmaps in Session Replay Understand session replays faster with AI summaries and smart chapters Monitor ClickHouse query performance with Datadog Database Monitoring How we designed empathetic alert sounds for on-call engineers Search and act across Datadog to resolve issues faster with Bits Assistant Measure the business impact of every product change with Datadog Experiments Analyzing round trip query latency Configuring JavaScript caches for better performance Introducing Bits AI Dev Agent for Code Security Datadog achieves ISO 42001 certification for responsible AI Monitor Nutanix clusters, hosts, and VMs with Datadog Monitor Juniper Mist in Datadog A new Host Map for modern infrastructure When upserts don't update but still write: Debugging Postgres performance at scale Annotate traces to improve LLM quality with Datadog LLM Observability What's new in Cloud SIEM: AI-powered investigations, enhanced threat intelligence, and scalable security operations Explore Kubernetes with native OpenTelemetry data Monitor Oracle Fusion Cloud Applications with Datadog Announcing the Datadog Terraform provider v4.0.0 Scaling Kubernetes workloads on custom metrics How to design cloud environments for AI-powered threat analysis Monitor Aruba Central in Datadog How we centralize and remediate risks with Datadog Case Management Accelerate incident response with Datadog and ServiceNow Monitor your application and network load balancer logs Understanding Karpenter architecture for Kubernetes autoscaling Tools for collecting metrics and logs from Karpenter Monitor Karpenter with Datadog What your product data is actually saying Key metrics for monitoring Karpenter Securing Datadog's platform in the AI age: The role of observability data Closing the verification loop: Observability-driven harnesses for building with agents When an AI agent came knocking: Catching malicious contributions in Datadog’s open source repos Closing the verification loop, Part 2: Fully autonomous optimization Four ways engineering teams use the Datadog MCP Server to power AI agents Approaching your observability migration with the right mindset Meet the new Bits AI SRE: Deeper reasoning, twice as fast Designing MCP tools for agents: Lessons from building Datadog's MCP server Key learnings from the 2026 State of DevSecOps study Use plain English to query your multi-cloud infrastructure in Resource Catalog Simplifying troubleshooting across the user journey with Datadog Synthetic Monitoring Protect your OCI resources with Datadog Cloud Security This Month in Datadog - February 2026 Fine-tune Toto for turbocharged forecasts Amazon EC2 security: How misconfigured and public AMIs expand your cloud attack surface Enable end-to-end visibility into your Java apps with a single command Measure and improve mobile app startup performance with Datadog RUM Evaluating our AI Guard application to improve quality and control cost Identify untested code across every level of your codebase Make use of guardrail metrics and stop babysitting your releases Monitor Versa Networks SD-WAN performance in Datadog How we reduced the size of our Agent Go binaries by up to 77% Improve performance and reliability with APM Recommendations Remediate transitive vulnerabilities faster with Datadog Software Composition Analysis Generate audit-ready vulnerability and compliance reports with Datadog Sheets Monitor Fortinet FortiManager performance in Datadog Improve test coverage across codebases with Datadog Code Coverage
Automating your synthetic test infrastructure with Datadog Synthetic Monitoring and Terraform
2025-10-31 · via Datadog | The Monitor blog

Testing ecosystems contain massive amounts of data, including outlined test scenarios, prerequisite configurations, and the tests themselves. As a result, these ecosystems are prone to data sprawl. This makes it difficult to prevent configuration drift and quickly spin up new tests, especially at the frequency needed to support a fast-growing application.

Teams can handle these challenges by treating their tests as part of their application infrastructure. This strategy involves bringing your test data into the platforms you use to manage the rest of your infrastructure, with Terraform being one of the most popular. Doing so enables you to keep your testing environments in sync, quickly provision new ones, and maintain robust backups.

In this post, we’ll explore how you can:

Configure synthetic tests in Terraform with Datadog

Datadog provides robust synthetic testing with built-in support for cross-region and cross-environment testing, as well as version control. In some cases, you may want to use Terraform to customize your setup further. For example, Terraform makes it easy to deploy tests within your own data centers. Some organizations may also require teams to keep backups of their data within separate platforms like Terraform.

Depending on how your workflows are structured, you can work with Datadog synthetic tests in several ways:

Creating tests in Terraform

In many organizations, developers are responsible for creating tests for their own projects. Since many developers already use Terraform for other tasks, they can extend it to include test creation and simplify their workflows even further. With the Datadog Terraform integration, developers can easily use Terraform to create Datadog synthetics test resources, including multistep API tests, browser tests, mobile tests, and granular API tests.

With this approach, multiple development teams across your organization may contribute to the same test configuration. To maintain consistency, it helps to follow a few shared best practices to ensure a standardized test ecosystem, such as those listed below.

Using global variables

Global variables in Datadog Synthetic Monitoring enable you to share data across synthetic tests. This data can include usernames, passwords, API keys, and mock payment information. Using global variables ensures that all teams have access to the same sample data, making it easy to create consistent tests quickly. Within Terraform, you can create global variables by defining variables of the type global. For example:

config_variable {

name = “AUTHENTICATOR-API”

id = “f4a2d0c8-3b7b-42fc-9d12-8c6bcb40a91e”

type = “global”

Additionally, global variables enable you to easily control who can access this information, with the option to obfuscate or password-protect sensitive data as needed. You can easily manage these controls in Terraform via the secure variable and datadog-restriction-policy resource.

Establishing ownership via tagging

Determining ownership can be difficult within Terraform, since the only way to see which users worked on specific resources is through Terraform audit trails. To help teams clearly establish responsibility, you can add team information to Terraform tests with the tags variable, for example tags=[“team:security”]. These tags make it easy to find which team created a test if it needs to be updated. Additionally, if a test fails, tags help you quickly figure out which team is responsible for troubleshooting.

You can enforce ownership attribution best practices by creating a tag policy for the team tag. Tag policies prevent users from saving Datadog synthetic tests—including ones created in Terraform—if they don’t include the required tags.

Creating resilient locators

Datadog provides two options for working with locators: built-in self-healing locators which are generated for each test and user-defined CSS or xPath-based locators. In the Datadog UI, the former are used by default, but you can create the latter as needed.

Because elements within Terraform must be defined manually, you’ll need to configure a locator for each element yourself. You can view our guide for more details on when CSS or xPath would make more sense. In Terraform, you can define them using the element_user_locator variable, as shown below:

element_user_locator {

value {

type = “css”

value = “#checkout-button”

}

}

For each user-defined locator in Terraform, Datadog automatically generates a self-healing locator. These locators will update as your UI changes, ensuring that your tests remain reliable across redesigns.

Import tests created within the Datadog UI

While Terraform-based test creation can be useful for developers who already know Terraform syntax, some organizations involve non-technical teams in their test design processes. In these situations, users can build initial tests directly within the Datadog UI. This enables teams to take advantage of Datadog’s code-free test creation features, such as test templates for common use cases and interaction-based test recording. The UI also clearly displays available actions, global variables, and assertions available for use. Developers can then import the finished tests into Terraform for storage or ongoing maintenance.

A screenshot of the test creation window in Datadog Synthetic Monitoring.

To do this, developers can start by retrieving the test identifiers and configuration files within Datadog. Then, they can import these resources into Terraform by configuring the Datadog provider and creating an import block, as shown below:

Datadog provider configuration

terraform {

required_providers {

datadog = {

source = "DataDog/datadog"

}

}

}

provider "datadog" {

api_key = var.datadog_api_key

app_key = var.datadog_app_key

}

Import block

import {

to = “datadog_synthetics_test.payment_test”

id = “ad1-b2c-ds3”

}

This approach automatically creates the test configuration in Terraform. It differs from using the import command, which only updates the Terraform state file and requires you to manually enter the test configuration. Alternatively, you can skip importing your tests entirely and query them as external data sources instead. This approach is useful if you don’t want to store your test configuration and simply want to invoke certain test resources, such as subtests or global variables.

Simplify test creation with Datadog subtests

To better tailor your synthetic monitoring strategy with your teams’ workflows, you may choose to combine these methods. While Terraform-based test creation conveniently integrates with development workflows, manually coding tests step-by-step in Terraform can quickly become tedious. As such, teams may find it more efficient to create the foundation of their tests directly in Datadog Synthetic Monitoring.

One of the most effective ways of doing so is by using subtests. Subtests enable you to modularize your tests by creating reusable groups of test steps. You can use subtests to develop the basic building blocks of your tests using the Datadog UI, then combine and recombine them within Terraform.

After recording synthetic tests within Datadog and importing them into Terraform, you can integrate them into new tests as subtests using a browser step with a playSubTest type. Within this browser step, specify the test you want to use as a subtest using the subtest_public_id variable. If you want the subtest to open within a new window or tab—for example, to display a newsletter signup screen in a popup window—you can configure this with the playing_tab_id variable. The code for a finished subtest browser step could look like this:

browser_step {

name = “Test user authentication”

type = “playSubTest”

subtest_public_id = “ad1-b2c-ds3”

Let’s say that you’re creating several lengthy browser tests that contain the same flow, which involves logging into a rewards account, redeeming rewards points, and viewing redemption offers. Rewriting these steps each time you created a new test would be inefficient. Instead, you can record these steps as a single rewards subtest in Datadog.

A screenshot of the subtest creation window in Datadog Synthetic Monitoring.

You can then import this subtest into Terraform and use it as the base of your tests. Because subtests are shared across your organization, this simplifies test creation for other teams as well.

Develop and manage your test ecosystem with Terraform and Datadog

As test collections grow, configuration data can spread across multiple sources. This can make maintenance difficult, leading to stale data and tedious test creation. By treating tests as infrastructure, you can manage them more efficiently with platforms like Terraform.

To learn more, read our documentation on getting started with Datadog Synthetic Monitoring and using it with Terraform. Or, if you’re new to Datadog, you can sign up for a 14-day free trial.