kumina / openvpn_exporter

A Prometheus exporter for OpenVPN.
Apache License 2.0
214 stars 105 forks source link

The time lebel crashed Prometheus server #19

Closed shaotingcheng closed 4 years ago

shaotingcheng commented 5 years ago

The biggest antipattern with any timeseries storage system is having a hugely growing label cardinality. Each new combinaison of label values will grant its own timeseries to store data. The number of said files can grow exponentially and have a huge impact on the health of prometheus.

NotAFile commented 5 years ago

Yeah, this unfortunately makes this exporter pretty unusable.

We have hundreds to thousands of users connected at a time, so enabling this exporter in production would immediately DOS the Prometheus.

https://prometheus.io/docs/practices/instrumentation/#things-to-watch-out-for has a useful overview of why adding all of this high-cardinality data is bad.

NotAFile commented 5 years ago

I think the best thing to do here would be to have an "-individual-users" command line option or similar, like collectd does: https://collectd.org/wiki/index.php/Plugin:OpenVPN

timstoop commented 5 years ago

We're happy to accept a PR for that :)

grobie commented 5 years ago

An alternative of a command line option would be a HTTP parameter similar to what the node_exporter provides: https://github.com/prometheus/node_exporter#filtering-enabled-collectors That would allow users to disable collecting user metrics in their Prometheus server, while allowing other clients (e.g. web clients) to take a look at all stats.

rajatvig commented 5 years ago

@timstoop have created a PR here - https://github.com/kumina/openvpn_exporter/pull/24

davidquarles commented 4 years ago

Perhaps it would make sense to expose the per-client connection timestamp as an actual metric instead of or in addition to this ask? Aggregate and per-user uptime is something I do actually want visibility into, but unpacking a label's value and transforming it into a metric (what I'll likely do today) doesn't seem like a fantastic pattern.

BartVerc commented 4 years ago

This should be solved in #31 .