]> piware.de Git - learn-metrics.git/commit
Add script to generate time series
authorMartin Pitt <martin@piware.de>
Fri, 21 May 2021 11:26:23 +0000 (13:26 +0200)
committerMartin Pitt <martin@piware.de>
Fri, 21 May 2021 11:51:08 +0000 (13:51 +0200)
commit1948264b92c88ebfe5176a4d61a23f01b457009a
treea2fc356ed057c9416442043d1f0bcd2018145300
parent762850f8170ad2411fe014b5af63d4820ac9301f
Add script to generate time series

The text import format supports specifying a time stamp [1]. Use this to
generate a time series for thing_count and thing_failures.

    ./things-series  > http/metrics
    podman pod rm -f learn-metrics || true
    podman play kube learn-metrics.yaml

First non-trivial query from "indefinitely long lookback" counters: "How
many tests happened in the last 5 minutes?

    rate(thing_count{job="host-http"}[5m]) * 5 * 60

The re-scaling is because the natural unit is "1/s" and we want the unit
to be the same as the original counter.

[1] https://prometheus.io/docs/instrumenting/exposition_formats/
things-series [new file with mode: 0755]