Prometheus: what's the difference between a Gauge and a GaugeMetricFamily?

I understand that Gauge is for reporting e.g. application metrics "normally", and GaugeMetricFamily is for writing custom collectors and exporters. But I can't figure out how they meaningfully differ. Is there a difference?

1 Answer

You can think of it that Gauge is an instrumentation-friendly object the takes care of tracking values, concurrency, labels. At the end of this it produces a GaugeMetricFamily data structure as a snapshot of its current state (it doesn't actually use a GaugeMetricFamily, but that's an implementation detail) when needed by a scrape.

For custom collectors, you have to produce the GaugeMetricFamily yourself.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like