Folks, im completely new to the forum, and most probably going to ask something that has been asked multiple times in the past
it is related to the combination of rate
and sum
(or even sum_over_time
)
see this SO answer
i have the following query for my graph:
sum by(feature) (
increase(xyz_service_tokens_histogram_sum{feature="SELDOMLY_USED_FEATURE"}[$__range])
)
sorry, had to mask some names but the main point is that this query works for most of the features, as they are used heavily, but for this particular one, im getting the graph seen on the screenshot
.Why is this a problem? because it shouldn’t be 0 (low number but not 0), when looking at the raw counter metric:
xyz_service_tokens_histogram_sum{feature_scope="SELDOMLY_USED_FEATURE"}
I see what is shown on the second screenshot
definitely some non 0 values, but they are not growing at all (most probably because the metric was emitted only once from those envs, it jumped to that level, but as we don’t have datapoints for 0, then those jumps are not evaluated as change)
One thing i forgot to mention: what is my goal?my goal is to get the total token usage over the selected period. i.e. what was the token usage for this feature over the last 90 days
however for this particular case its showing 0 instead of a nonzero value (at least im assuming,t hat it should be non 0)