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.