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}", var.env)}"
    }
  }
}

Create job runtime difference timeboard
Create job runtime difference timeboard

Create a basic timeboard which would show time difference in job
runtimes. Unfortunately TF provider for datadog currently doesn't
allow specifying any other parameters. To make this timeboard more
useful, do edit it manually in order to:
* show percentual change instead of absolute
* to show decreases as good and increases as bad
* to add last value to the graph so that you can see how long the given
  job took.

If it is very important to us that we can do the modified timeboard
automatically, then we should extend TF provider or create the timeboard
directly via API call. (Then also remember it exists and remove it when
we do TF destroy).

We use _ here instead of - in the metric prefix because riemann (or datadog)
changes the - to _ when sending metrics.

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