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]
bjo...@rabenste.in