Skip to content

Instantly share code, notes, and snippets.

@saml
Last active January 17, 2019 15:05
Show Gist options
  • Save saml/ae327e6cc9b807009fe75749299a6a51 to your computer and use it in GitHub Desktop.
Save saml/ae327e6cc9b807009fe75749299a6a51 to your computer and use it in GitHub Desktop.
# metric_monitor.tf
resource "datadog_monitor" "metric_monitor" {
name = "${var.title}"
type = "metric alert"
query = "${var.query}"
message = "${var.message}"
}
# yolo.tf
module "yolo_monitor" {
source = "./.modules/metric_monitor"
title = "Something yolo happened"
query = "avg(last_15m):max:some.metric > 10"
message = "Something happened @slack-my-team-notification"
}
# yolo2.tf
module "yolo_monitor2" {
source = "./.modules/metric_monitor"
title = "Something different happened"
query = "avg(last_15m):max:some.other.metric > 20"
message = "Something different happened @slack-my-team-notification"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment