Currently across all our binaries, individual metrics are only registered on their first usage, i.e. when we record that metric for the first time. This is not ideal, as some metrics (especially ones recording failures) remain invisible via the metrics endpoint throughout the lifetime of the session.
We should register all metrics during startup, potentially holding the returned metric object in a new struct which can be cloned to all places in the codebase required to record metrics. This would be more efficient than attempting to register the given metric every time we want to record it.
We should also ensure the call to register_metrics occurs after the call to metrics_builder.install() as it has no effect otherwise.
Currently across all our binaries, individual metrics are only registered on their first usage, i.e. when we record that metric for the first time. This is not ideal, as some metrics (especially ones recording failures) remain invisible via the metrics endpoint throughout the lifetime of the session.
We should register all metrics during startup, potentially holding the returned metric object in a new struct which can be cloned to all places in the codebase required to record metrics. This would be more efficient than attempting to register the given metric every time we want to record it.
We should also ensure the call to
register_metricsoccurs after the call tometrics_builder.install()as it has no effect otherwise.