Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Observability as Code

Observability as Code

In this webinar, Dan Maher (Developer Advocate at Datadog), and I look at how to use the Datadog Provider for Terraform to codify observability resources such as Application Performance Monitors (APM) and Dashboards.

This version of the webinar was given at a Datadog webinar in September 2020.

---

Companion Code: github.com/hashicorp/observability-as-code

8c73ec710b03be8909e71ad500866934?s=128

Kerim Satirli
PRO

September 23, 2020
Tweet

Transcript

  1. Observability as Code with Datadog and HashiCorp Terraform

  2. Kerim Satirli @ksatirli Developer Advocate HashiCorp Daniel Maher @phrawzty Developer

    Advocate Datadog
  3. Agenda ▪ What is Datadog? ▪ What is Terraform? ▪

    What is Observability as Code? ▪ How do Datadog and Terraform integrate? ▪ Q&A
  4. None
  5. None
  6. app.terraform.io

  7. storedog.example

  8. ⁄ What is Observability as Code

  9. ⁄ How do Datadog and Terraform integrate?

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

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

  12. Datadog Provider for Terraform CODE EDITOR terraform { required_providers {

    datadog = { source = "datadog/datadog" version = "2.13.0" } } required_version = "~> 0.13" }
  13. Datadog Provider for Terraform CODE EDITOR provider "datadog" { #

    Datadog credentials }
  14. Datadog Provider for Terraform CODE EDITOR provider "datadog" { api_url

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

    = "https://api.datadoghq.eu/" } !
  16. Datadog Monitors Interface app.datadoghq.com/monitors/manage

  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!" ... }
  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}"
  19. ⁄ Demonstration

  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
  21. Q & A ask us anything (related to today’s session)

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