All metrics functionality should be provided via the astria-telemetry crate so that our other crates don't need to depend upon the metrics or metrics-exporter-prometheus crates.
astria-telemetry should provide a metrics Builder to allow for configuring and registering metrics. Builder::build should consume self to avoid later attempts to register further metrics, and should return an instance of the calling crate's Metrics struct along with a wrapped handle to the PrometheusHandle which will be useful for tests.
As well as registering individual metrics, the builder should support optionally starting the exporter server, and optionally registering the global metrics recorder.
All metrics functionality should be provided via the
astria-telemetrycrate so that our other crates don't need to depend upon themetricsormetrics-exporter-prometheuscrates.astria-telemetryshould provide a metricsBuilderto allow for configuring and registering metrics.Builder::buildshould consumeselfto avoid later attempts to register further metrics, and should return an instance of the calling crate'sMetricsstruct along with a wrapped handle to thePrometheusHandlewhich will be useful for tests.As well as registering individual metrics, the builder should support optionally starting the exporter server, and optionally registering the global metrics recorder.