On 09.09.21 09:42, José San Gil wrote:
>
> I'm aware of the cumulative nature of the buckets. I assumed that if do:
>
> increase(operation_x_bucket{operationType="TypeA", le="+Inf"}[24h]), I'd be
> getting the total number of observations of the bucket for that specific
> operationType in the last 24h. Is that correct?
Sounds about right. Note that you will get multiple time series if
there are other labels, including target labels. For example, if you
have multiple different instances that have served this metric
(concurrently or over time), you'll get a separate result for each. To
get them all, you can sum the final result, i.e.
sum(increase(operation_x_bucket{operationType="TypeA", le="+Inf"}[24h]))
> The problem is the that the values I get are significantly lower than
> reality for a period of let's say 24 hours. I thought that maybe he buckets
> might not behave as a regular counter (it seems they do).
They do, and in fact, the `le="+Inf"` bucket should be identical to
the `operation_x_sum` time series (which is something you could check
in your case).
> I do have multiple buckets (each k8s pod seems to be create a new one), so
> I used sum(increase(operation_x_bucket{operationType="TypeA",
> le="+Inf"}[24h])) to sum the observations.
OK, so you did that already. If that gives unexpected results, there
must be something else happening. All the information you provided
looks OK to me.