diff options
author | Alex <alex@adnab.me> | 2022-09-20 17:53:46 +0200 |
---|---|---|
committer | Alex <alex@adnab.me> | 2022-09-20 17:53:46 +0200 |
commit | fc8550864898a7a24e71dfb29027fd9b39305eab (patch) | |
tree | 56db83c31c53688c7c216cc425d1e2602e5ef1a4 /src/api | |
parent | 7a901f7aab29d9ae09c378e3824b8236458f85f1 (diff) | |
parent | 782630fc27b41b9ae58d1417cace2995c99856fc (diff) | |
download | garage-fc8550864898a7a24e71dfb29027fd9b39305eab.tar.gz garage-fc8550864898a7a24e71dfb29027fd9b39305eab.zip |
Merge pull request 'Initialize metrics exporter earlier (fix #389)' (#390) from fix-metrics into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/390
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/admin/api_server.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/api/admin/api_server.rs b/src/api/admin/api_server.rs index fb0078cc..0816bda1 100644 --- a/src/api/admin/api_server.rs +++ b/src/api/admin/api_server.rs @@ -34,7 +34,10 @@ pub struct AdminApiServer { } impl AdminApiServer { - pub fn new(garage: Arc<Garage>) -> Self { + pub fn new( + garage: Arc<Garage>, + #[cfg(feature = "metrics")] exporter: PrometheusExporter, + ) -> Self { let cfg = &garage.config.admin; let metrics_token = cfg .metrics_token @@ -47,7 +50,7 @@ impl AdminApiServer { Self { garage, #[cfg(feature = "metrics")] - exporter: opentelemetry_prometheus::exporter().init(), + exporter, metrics_token, admin_token, } |