resource "datadog_timeboard" "concourse-jobs" {

  title = "${format("%s job runtime difference", var.env) }"
  description = "vs previous hour"
  read_only = false

  graph {
    title = "Runtime changes vs hour ago"
    viz = "change"
    request {
       q = "${format("avg:%s_concourse.build.finished{*} by {job}", replace(var.env, "-", "_"))}"
    }
  }
}

resource "datadog_timeboard" "concourse-jobs" {

  title = "${format("%s job runtime difference", var.env) }"
  description = "vs previous hour"
  read_only = false

  graph {
    title = "Runtime changes vs hour ago"
    viz = "change"
    request {
       q = "${format("avg:concourse.build.finished{bosh-deployment:%s} by {job}", var.env)}"
    }
  }
}

Use bosh-deployment tag for concourse metrics
Use bosh-deployment tag for concourse metrics

The environment name is passed as a tag in `bosh-deployment`
so we don't need it in the metric name.

As a consequenece, we don't have to remove hyphens as it is fine to
have hyphens in tags.

alphagov/paas-cf,alphagov/paas-cf,jimconner/paas-cf,jimconner/paas-cf,jimconner/paas-cf,alphagov/paas-cf,jimconner/paas-cf,alphagov/paas-cf,alphagov/paas-cf,jimconner/paas-cf,jimconner/paas-cf,jimconner/paas-cf,alphagov/paas-cf,alphagov/paas-cf,alphagov/paas-cf