Binding a Gauge to a value/object/method?

9 views
Skip to first unread message

John Dexter

unread,
Oct 1, 2020, 10:06:53 AM10/1/20
to promethe...@googlegroups.com
Say you are instrumenting a metric app_widgets_total, and your implementation is based on std::vector<Widget> mWidgets. It seems the client libraries (at least the one I looked at) expect you to explicitly instrument every change to mWidgets. It seems natural you might want to just bind your Gauge to mWidgets.size() - there might be threading ramifications but is this possible/feasible?
One could presumably write their own specialised client library changes, is that commonly done or considered a Bad Idea?

In the context of an Exporter where you wish to respect the Prometheus scrape-frequency, it would be nice if there were a callback to inform you of a scrape request and again I cannot tell if this is considered sensible or not.

Thanks for any insight.
Reply all
Reply to author
Forward
0 new messages