Creating containers for GC metric

I’ve been playing around with metrics dashboards on our Concourse and have noticed that the metric creating containers to be garbage collected counts up cumulatively rather than counting the number per time period like the other container GC related metrics (i.e. created and destroying).

I’m trying to get a graph like the “Containers found for deletion” one on the concourse-ci metrics page. but when I use the same JSON I get something that looks like:

How is the Concourse team getting incremental values for this metric? I feel like I must be missing something.

1 Like

Not sure about the concourse team, but whenever I hit metrics like that (known as monotonically increasing gauge counters or whatever), I apply some kind of delta function which presents the values as a difference between data points.

True. I guess my main question is why I need

            "select": [
              [
                {
                  "params": [
                    "value"
                  ],
                  "type": "field"
                },
                {
                  "params": [],
                  "type": "sum"
                },
                {
                  "params": [],
                  "type": "difference"
                }
              ]
            ]

to get the same graph that metrics.concourse-ci.org displays without needing the

 {
    "params": [],
    "type": "difference"
}

parameter. In theory the metric emitted from Concourse should be the same in both cases.