Configure Observability as Code with Terraform & Datadog

A presentation at Hashicorp & Datadog Webinar in September 2020 in by Daniel "phrawzty" Maher

Slide 1

Slide 1

Observability as Code with Datadog and HashiCorp Terraform

Slide 2

Slide 2

Kerim Satirli Daniel Maher @ksatirli @phrawzty Developer Advocate HashiCorp Developer Advocate Datadog

Slide 3

Slide 3

Agenda ▪ What is Datadog? ▪ What is Terraform? ▪ What is Observability as Code? ▪ How do Datadog and Terraform integrate? ▪ Q&A

Slide 4

Slide 4

Slide 5

Slide 5

Slide 6

Slide 6

app.terraform.io

Slide 7

Slide 7

storedog.example

Slide 8

Slide 8

What is Observability as Code ⁄

Slide 9

Slide 9

How do Datadog and Terraform integrate? ⁄

Slide 10

Slide 10

Datadog Provider for Terraform registry.terraform.io/providers/datadog/datadog

Slide 11

Slide 11

Datadog Provider for Terraform registry.terraform.io/providers/datadog/datadog

Slide 12

Slide 12

Datadog Provider for Terraform CODE EDITOR terraform { required_providers { datadog = { source = “datadog/datadog” version = “2.13.0” } } required_version = “~> 0.13” }

Slide 13

Slide 13

Datadog Provider for Terraform CODE EDITOR provider “datadog” { # Datadog credentials }

Slide 14

Slide 14

Datadog Provider for Terraform CODE EDITOR provider “datadog” { api_url = “https://api.datadoghq.com/” }

Slide 15

Slide 15

Datadog Provider for Terraform CODE EDITOR ! provider “datadog” { api_url = “https://api.datadoghq.eu/” }

Slide 16

Slide 16

Datadog Monitors Interface app.datadoghq.com/monitors/manage

Slide 17

Slide 17

Datadog Monitor CODE EDITOR resource “datadog_monitor” “high_error_rate” { for_each = var.services name = “HIGH: ${each.key} (${each.value.env})” type = “query alert” message = “${each.key} has a high error rate!” … }

Slide 18

Slide 18

Datadog Monitor CODE EDITOR … query = “avg(last_10m):(sum:trace.$ {each.value.framework}.request.errors{env:$ {each.value.environment},service:${each.key} } / sum:trace.$ {each.value.framework}.request.hits{env:$ {each.value.environment},service:${each.key} }) > $ {each.value.high_error_rate_critical}”

Slide 19

Slide 19

Demonstration ⁄

Slide 20

Slide 20

Resources ▪ Datadog: datadoghq.com/free-datadog-trial ▪ Terraform Cloud: app.terraform.io/signup ▪ Terraform provider: registry.terraform.io/providers/datadog/datadog ▪ webshop code: github.com/datadog/ecommerce-workshop ▪ workshop code: github.com/hashicorp/observability-as-code

Slide 21

Slide 21

Q&A ask us anything (related to today’s session)

Slide 22

Slide 22

Thank You kerim@hashicorp.com daniel.maher@datadoghq.com