fix(hive-metric): blocking OTLP client (no-reactor panic), reject negative counters, allow negative gauges

This commit is contained in:
damocles 2026-07-10 21:17:39 +02:00 committed by mara
commit d91e6eb0e2
3 changed files with 35 additions and 7 deletions

View file

@ -13,10 +13,14 @@ clap.workspace = true
# OTEL SDK — only used by this crate, so kept local rather than in workspace.dependencies.
opentelemetry = "0.32"
opentelemetry_sdk = { version = "0.32", features = ["metrics"] }
# Blocking (not async) reqwest client on purpose: the metrics SDK drives the
# OTLP push from a `PeriodicReader` background thread that has no Tokio runtime,
# so the async client panics there with "no reactor running". The blocking
# client sends on that thread directly — and for a fire-and-forget CLI that
# records one point then `shutdown()`s, a synchronous send is exactly right.
opentelemetry-otlp = { version = "0.32", default-features = false, features = [
"metrics",
"http-json",
"reqwest-client",
"reqwest-blocking-client",
"reqwest-rustls",
] }
tokio = { workspace = true, features = ["rt", "macros"] }