I periodically send metrics with a gauge type and the count of processed rows. I need to create a time series chart that shows the count of items I've sent at specific moments.
Example of needed chart:
If there wasn't metric sending for any period then bar value should be empty. Is it possible to do it?
I send metrics at 13:54 and 13:56 and it fills gaps between them with values, that were recieved
I need something like this:
Now my query is:
metric{metric_type="gauge", env="development"}
There is a problem with you idea: if you'll "send" new metric with exactly the same value - there is no way to detect if is new or old value.
You shouldn't use Gause for this, use Counter instead. And once you expose counter, you'll be able to use query like increase(metric_total{env="development"}[$__interval])
with min step set to something like 1m
(to exclude multiple bars for the same increase in step)