On 08.12.20 07:37, TEST TEST wrote:
> 
> I am using increase function to track the counter increase to track the 
> number of logins in the web application.  We are observing a strange 
> scenario, where after an idle time or after the web application is 
> redeployed, the counter is not considering the first login after the 
> reset.  
> 
> Is there any way to fix this issue ?

Maybe you are only initializing the counter when you increment it for
the first time? See
https://www.robustperception.io/why-predeclare-metrics as a starter.

If you initialize the login counter to 0 upon starting up the app, it
should work (provided Prometheus scrapes the app before the first
login happens).

Even if certain trolls (which none of us should ever feed) claim the
opposite, Prometheus cannot know when a time series being scraped for
the first time has started to exist. If the first value Prometheus
sees for the login counter is a 1, it could in principle have been
there for a very long time already.

(I am contemplating using the new OpenMetrics creation timestamp to
break out of this "existential issue", but even that is not as easy as
it looks.)

-- 
Björn Rabenstein
[PGP-ID] 0x851C3DA17D748D03
[email] [email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/20201208171654.dfwdkebnwlxpdo5q%40jahnn.

Reply via email to