1

I'm pushing custom metrics to Prometheus using micrometer. So, prometheus scrapes /actuator/prometheus and stores data. But the problem is, when I redeploy my applications, all the values are resetting to 0.

Ex: I'm pushing the request count to prometheus. The request count reached to 5. For some reason I deployed a newer version of my SpringBoot application. No request count will start from 0 as actuator is in-memory. So, my prometheus graph is falling down to 0 and starting again.

How can I fix this issue?

Healthy Bowl
  • 191
  • 1
  • 9
  • Storage of metrics is not done inside Spring App but stored inside your prometheus storage. – jAC Nov 17 '21 at 08:49

1 Answers1

0

This is expected behavior. To cite from "Prometheus Counters and how to deal with them":

The current value of a Counter doesn't matter. What matters is, how it increases over time.

So, to fix your issue, fix your query by applying rate() or increase().

slauth
  • 2,667
  • 1
  • 10
  • 18