move otel_http_client from swarm-queue-client into swarm-controller

This commit is contained in:
damocles 2026-08-26 23:38:20 +02:00 committed by mara
commit f3be08f6b6
9 changed files with 52 additions and 70 deletions

View file

@ -34,9 +34,9 @@ use opentelemetry_sdk::metrics::{PeriodicReader, SdkMeterProvider};
/// Type-erases a caller's concrete [`HttpClient`] impl so [`spawn_exporter`]
/// can accept "any client, or none" without this crate depending on any one
/// caller's concrete type (`swarm-controller`'s
/// `swarm_queue_client::otel_http_client::AuthenticatedHttpClient` today,
/// conceivably something else from a future caller) — the same genericity
/// caller's concrete type (`swarm-controller`'s own
/// `otel_http_client::AuthenticatedHttpClient` today, conceivably something
/// else from a future caller) — the same genericity
/// this crate already has over `N`/`R`, applied to the one other caller-
/// supplied thing it touches.
///
@ -84,8 +84,8 @@ const DEFAULT_INTERVAL: Duration = Duration::from_mins(1);
/// before this parameter existed. `Some(client)` routes every export
/// through that [`HttpClient`] instead, for a caller whose destination
/// checks a bearer token per request rather than a static header
/// (`swarm-controller`'s case — see `swarm_queue_client::otel_http_client`'s
/// module doc for why a static header doesn't fit an expiring token).
/// (`swarm-controller`'s case — see its own `otel_http_client` module doc
/// for why a static header doesn't fit an expiring token).
pub fn spawn_exporter<N, R>(
jobq: Arc<Mutex<hive_jobq::scheduler::Scheduler<N, R>>>,
service_name: &str,