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.