Victoria metric increase() function outputs very high values

Viewed 29

I am new to victoria metrics and trying to send some data to VM using exposition format. Basically I have a csv data , I am reading csv and creating a exposition string separated by \n, in format metric_name{label=label_value} counter current epoch mili. The counter is monotonically increasing. label has 100 different values.

I am able to send the data to VM with 1 sample every 10 sec.

When I apply increase function for duration of 2m increase(metric[2m]) this gives me many time series due to cardinality of label, but if I do sum(increase(metric[2m])) I was assuming this would give me correct output but this provides very high numbers which do not align with the data I am sending.

My calculations : 6 counter increase in 1 min.

min counter


0. 0

  1. 6
  2. 12
  3. 18

Assumption the increase should provide constant number.

Do let me know if I missed something or doing something wrong.

1 Answers

It looks like there is a confusion between counter and gauge metric types. Counter metric should increase over time, while gauge metric can have arbitrary values over time. If you push gauge metrics into VictoriaMetrics, then you need to use sum_over_time() function instead of increase().

See also Prometheus key concepts.

Related