swarm-controller: move OTEL deps to workspace level, drop jobq_metrics singleton

This commit is contained in:
damocles 2026-08-19 17:32:38 +02:00 committed by mara
commit 621245306f
6 changed files with 81 additions and 67 deletions

View file

@ -917,7 +917,11 @@ async fn main() -> Result<()> {
hive_jobq::resources::ResourceTable::new(),
)));
spawn_jobq_worker(Arc::clone(&jobq), deps);
jobq_metrics::spawn_exporter(Arc::clone(&jobq));
// Bound to a named variable, not `_` — dropping the provider stops its
// `PeriodicReader`, so it must live as long as `main` does (which it
// does here: this binding never goes out of scope before the process
// exits via `axum::serve(...).await` below).
let _jobq_metrics_provider = jobq_metrics::spawn_exporter(Arc::clone(&jobq));
// Same "log and carry on" shape as the queue/bridge/forge wiring above.
// A controller that cannot hold a webhook secret still serves every