`default-features = false` on opentelemetry-otlp was written to trim transports and dropped `internal-logs` with them, so every otel_warn! and otel_debug! inside that crate compiled to nothing. The failure that matters is the one which returns HTTP 200: the collector accepts the request and rejects the data points, and HttpMetricsClient.PartialSuccess is the only place the rejection count and the collector's reason are ever surfaced. The feature is per-crate, not per-workspace: the macros are exported by the opentelemetry API crate but their cfg and CARGO_PKG_NAME resolve in the calling crate, so the API crate and the SDK had internal logs on while the exporter did not. hive-metric keeps the identical declaration on purpose - it installs no tracing subscriber, so the feature would be inert there and would only mislead. Both files now record which side of that they are on, and the stale "same features as hive-metric" comment is corrected. Not sufficient on its own: a hard export failure is logged by the SDK at debug on the compiled timer path, so it stays below the info filter. That needs a level rather than a feature and is left to review.
34 lines
1.4 KiB
TOML
34 lines
1.4 KiB
TOML
[package]
|
|
name = "hive-metric"
|
|
version.workspace = true
|
|
readme = "README.md"
|
|
edition.workspace = true
|
|
|
|
[[bin]]
|
|
name = "hive-metric"
|
|
path = "src/main.rs"
|
|
|
|
[dependencies]
|
|
anyhow.workspace = true
|
|
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.
|
|
#
|
|
# Deliberately WITHOUT the `internal-logs` feature that `hive-c0re` names, even
|
|
# though the defect is identical: this binary installs no `tracing` subscriber,
|
|
# so the SDK's diagnostics would be emitted into a void. Enabling it here would
|
|
# read as "hive-metric reports its export failures" while changing nothing at
|
|
# all. Giving this CLI somewhere to report is a behaviour change with its own
|
|
# decision (does a metrics push print to stderr?) — tracked separately.
|
|
opentelemetry-otlp = { version = "0.32", default-features = false, features = [
|
|
"metrics",
|
|
"http-json",
|
|
"reqwest-blocking-client",
|
|
"reqwest-rustls",
|
|
] }
|