This PR adds instrumentation to the exporter itself by introducing a new interface for the existing collectors, called InstrumentableCollector, and wrapping these in a new InstrumentedCollector concrete implementation, which adds the following two metrics to each collector, using a constant label (i.e. a label that never changes in a time series):
# HELP ha_cluster_scrape_duration_seconds Duration of a collector scrape.
# TYPE ha_cluster_scrape_duration_seconds gauge
ha_cluster_scrape_duration_seconds{collector="foo"} 1.234
# HELP ha_cluster_scrape_success Whether a collector succeeded.
# TYPE ha_cluster_scrape_success gauge
ha_cluster_scrape_success{collector="foo"} 1
This PR adds instrumentation to the exporter itself by introducing a new interface for the existing collectors, called
InstrumentableCollector
, and wrapping these in a newInstrumentedCollector
concrete implementation, which adds the following two metrics to each collector, using a constant label (i.e. a label that never changes in a time series):These metrics take inspiration from
node_exporter
.Some significant refactoring was contextually performed to the main
run()
function, to add some test coverage to it.Closes #159