Closed WoutResseler closed 11 months ago
@WoutResseler: Thanks for opening an issue, it is currently awaiting triage.
In the meantime, you can:
Hello,
This is half by design / half side effect :)
Internally, crowdsec has no "memory" of its metrics from one start to another, or even from one fetch to another. In the case of the decisions metrics, everything is recomputed dynamically when prometheus fetches the metrics, it's just a view of what is currently in the database. This means that if you delete the decisions, crowdsec will have no knowledge that there was ever a decision for a specific scenario, and the time series disappear.
Even if we were to somehow track the now empty time series between fetches, I don´t think we'd be able to do it across restarts, so you'd eventually end up in the same situation.
What happened?
When there is an active decision in the list Example
When looking at the metrics endpoint I see
Which is correct
When there is no active decision
When looking at the metrics endpoint for the
cs_active_decisions{action="ban",origin="crowdsec",reason="crowdsecurity/ssh-slow-bf"}
it is not there.What did you expect to happen?
I would expect to see
on the metrics endpoint
How can we reproduce it (as minimally and precisely as possible)?
Have something in the decision list, look at the metrics and point and find the corresponding active decision metric
Clear the decision list for that type of decision and look again at the metrics endpoint
Anything else we need to know?
Not sure if this is by design, but it causes some weird graphs when consuming the metrics because there is suddenly no more data
For example in this grafana graph:
Crowdsec version
OS version
Enabled collections and parsers
Acquisition config
Config show
Prometheus metrics
Related custom configs versions (if applicable) : notification plugins, custom scenarios, parsers etc.