prometheus-cpp
prometheus-cpp copied to clipboard
Set callback for Gauge
I'd like to start a discussion about supporting gauges whose value is determined at scrape time by evaluating a function. This functionality is essential when proxying a value from code that cannot be (easily) instrumented (for example, reporting the system load) or as a convenience when explicit modification of a gauge might be a nuisance (for example, instrumenting the length of a queue without requiring a proxy or facade object).
The Go, Java, and Python official clients all offer functionality like this.
Any implementation in C++ would encounter an obvious tension with object lifetimes, but I think we can just leave that to users to decide what to do.
The no-action alternative here is for users to implement their own Collectables.
Any news regarding such functionality? We also are interested in it. @gjasny maybe you can provide some feedback.
I'll work on improving prometheus-cpp during the next weeks. I'll consider adding such a callback if it integrated nicely into existing architecture.
any update on this? or do we have any workaround to achieve this for now?
I guess @gjasny knows somehting about the current status.