grafana - Prometheus increase() does not detect counter update after service restart (prometheus-client 0.16.0) - Stack Overflow

admin2025-04-20  0

I have a service running prometheus-client version 0.16.0.

I run one instance of the service per region. The service runs a job that updates a counter, which has several labels. I am trying to determine whether there was or was not an increase in the counter for a specific set of labels.

Issue: After a restart of the service, the counter gets updated, but increase() does not detect the change.

After the restart, the counter is set to 1, but increase() does not register this as an increase.

Questions: Why does increase() not detect the value change after a restart? How can I ensure increase() properly registers this kind of update? Are there alternative approaches to detect changes despite service restarts?

Additional Info: AFAIK, the counter is not pre-registered before being updated.

Any insights would be greatly appreciated!

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745125385a286394.html

最新回复(0)