Closed free closed 3 years ago
Gentle nudge.
Thanks for the PR. Please note however that the ProcessCollector implements https://prometheus.io/docs/instrumenting/writing_clientlibs/#process-metrics. I'm thus wary of adding more arbitrary stuff directly here.
I'd be happy to see the "Number of OS threads" metrics standardized upstream, and once that is published we can promptly merge this.
I'd be happy to see the "Number of OS threads" metrics standardized upstream, and once that is published we can promptly merge this.
Is anything like that being worked on (upstream, I mean)? On the one hand the Golang library has go_threads
and Java has jvm_threads_current
(and I'm sure other language libraries have their own).
On the other hand, the only other way of getting this metric (other than everyone rolling their own implementation, which is what we ended up doing) is to enable the (by default disabled) processes
collector of node-exporter
(above which there's a warning that the collector may be disabled due to "prolonged runtime" or "significant resource usage"). While adding the metric here boils down to simply exporting a value that has already been retrieved from the OS.
I'm not going to insist that this be merged, but the fact that process_threads
is not a standard process metric is not a good reason against exporting it regardless.
I'm not aware of any such discussion, so I started it at https://github.com/prometheus/docs/pull/1964. As you mentioned, it is a common metrics across libraries so it makes sense to have it uniformed. Plus, the process_
prefix is reserved and I think that having to name this rust_process_threads
does not make much sense here.
@free sorry for putting this through the long path. The upstream doc change has been merged, so this can land too. It only needs a rebase and a minor rewording.
Phew, took a bit to get the DCO right.
sorry for putting this through the long path.
No worries, thanks for following through. I put together a polyfill locally in the meantime, so no problem.
This simply retrieves and exports the value of the
num_threads
field from the already populatedprocfs::process::Stat
that CPU, memory and start time are sourced.