What you will learn in this TP
- Create Synthetic tests with Terraform
- Understand assertions and locations
- Run a test in CI
Introduction #
What you will learn in this section
- Create Synthetic tests with Terraform
- Understand assertions and locations
- Run a test in CI
Context. The home page went down on a Sunday and nobody noticed before Monday. You set up versioned synthetic tests.
Prerequisites: Datadog account with API and application keys, Terraform · Estimated time: 35 min
Synthetic tests managed as code.Hands-on #
Guided steps, with their solution.
1. Declare an API test
Why? Versioned, the test is reviewed and recreated identically in every organisation.
Writemain.tfwith an HTTP test on three locations.2. Add a certificate test
Why? An expired certificate is a total outage, and entirely predictable.
Add an SSL test that alerts 30 days before expiry.3. Apply
Why? The provider reads the keys from environment variables.
Apply the configuration and open the tests in Datadog.4. Trigger a failure
Why? Check that an alert really fires, and only when it should.
Change the status assertion target to404, apply, and watch the result.5. Run in CI
Why? Blocking a deployment that breaks a journey costs less than an incident.
Run the test from the command line, as a CI pipeline would.
Difficulty level : ●●●○○ (3/5)
My progress
Sign in to track your progress and take notes. Sign in
💬 Recent discussions about this course
- Datadog : relier traces, logs et métriques du même service✓ solved · 1 reply(ies)
Ask a question about this lesson →See all discussions about this course
Recommended Articles
RUM and Synthetic Monitoring with Datadog: synthetic transaction monitoring and user experience
Measure user experience with Datadog: browser and mobile RUM, Core Web Vitals, Session Replay, li...
Monitors, SLOs, dashboards and Datadog as code
Create effective monitors (metrics, logs, APM, composites, anomalies), SLOs, dashboards, and mana...
Datadog best practices: tags, costs, alerts and governance
Checklist for using Datadog effectively: unified tagging, cost control (hosts, logs, custom metri...
Datadog APM and OpenTelemetry: traces, services and correlation with logs
Instrument applications for Datadog APM (dd-trace, single step instrumentation, OpenTelemetry), u...
Testing and securing Terraform: validate, terraform test, tflint, Checkov and policies
Ensure the quality of Terraform code: fmt and validate, native terraform test tests with mocked p...
Synthetic monitoring as code: industrializing synthetic scenario management
Learn how to integrate synthetic monitoring into your CI/CD pipelines for automated, resilient pe...
Dynatrace Synthetic Monitoring: complete guide and best practices
Learn how to use Dynatrace Synthetic Monitoring to proactively monitor your applications, from th...
Security with Datadog: Cloud SIEM, Cloud Security and application protection
Discover Datadog's security products: Cloud SIEM and detection rules, Cloud Security (posture, vu...
Datadog on Kubernetes: Operator, Cluster Agent and Autodiscovery
Monitor Kubernetes with Datadog: the Datadog Operator and the DatadogAgent resource, Cluster Agen...