tikv / rust-prometheus

Prometheus instrumentation library for Rust applications
Apache License 2.0
1.07k stars 182 forks source link

Prevent underflow with CPU time counter #465

Closed nox closed 1 year ago

lucab commented 1 year ago

Thanks for the PR! I've left a minor comment in review.

Did you hit this in the wild? How did you end up having multiple ProcessCollector inside the same application?

nox commented 1 year ago

Thanks for the PR! I've left a minor comment in review.

You didn't.

How did you end up having multiple ProcessCollector inside the same application?

You don't need multiple process collectors, only multiple threads collecting the global registry at the same time.