You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any way to implement a callback-based gauge? This would be very useful for metrics that aren't related to the threads or processes of the server. For example, the docs mention a gauge for temperature:
This requires that there is some mechanism that continually updates the gauge via gauge.set, and hopefully the cadence of this mechanism matches the cadence of the scrape. It would be really nice to instead specify a callback and have the value calculated as needed.
This is how the python library works, which is great:
d = Gauge('room_temperature_celsius', 'Temp of room', ['room'])
d.labels('Room 1').set_function(lambda: ...))
The text was updated successfully, but these errors were encountered:
Hello,
Thank you for opening the issue.
The solution for this is Custom Collectors, which we're hoping to implement soon.
We're tracking that discussion on issue #90
I'm closing this issue as a duplicate of that one. Wir keep any updates to the other issue.
Is there any way to implement a callback-based gauge? This would be very useful for metrics that aren't related to the threads or processes of the server. For example, the docs mention a gauge for temperature:
This requires that there is some mechanism that continually updates the gauge via
gauge.set
, and hopefully the cadence of this mechanism matches the cadence of the scrape. It would be really nice to instead specify a callback and have the value calculated as needed.This is how the python library works, which is great:
The text was updated successfully, but these errors were encountered: