prometheus-cpp icon indicating copy to clipboard operation
prometheus-cpp copied to clipboard

Standard metrics: CPU time, memory usage, process start time, etc.

Open Radrik5 opened this issue 6 years ago • 3 comments

Any plans for adding standard metrics like in official Go/Java/Python client libraries?

I understand it's difficult to make them in a cross-platform fashion but it would be very helpful to have them out of the box.

Radrik5 avatar Apr 07 '19 19:04 Radrik5

Love this idea, but since this ventures into app metrics (as the exporter library will be embedded elsewhere), platform dependencies & licensing I'd like to suggest we KISS this by only defining a bunch of callbacks to be implemented. The metrics themselves can be predefined so that they are consistent across implementations, but the actual delivery of the metric should be the task of the callbacks, which should be unimplemented & empty by default. For Unix-ish platforms it should be easy to provide a demo provider based on e.g. libstatgrab, which I've used in the past. But what really matters here is a consistent lifecycle API and setup of the counters/gauges to be exported.

hhoffstaette avatar Mar 01 '20 11:03 hhoffstaette

Hi, I think adding process start time may not be that hard; here I've found a sample: https://github.com/ef-gy/prometheus-client-cpp/blob/master/include/prometheus/metric.h#L142 What do you think?

nnWhisperer avatar Jul 06 '20 10:07 nnWhisperer