hyperhive/hive-metric
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas b28af3cd1f fix(c0re): stop compiling out the OTLP exporter's own diagnostics
`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.
2026-08-14 23:16:59 +02:00
..
src fix(hive-metric): blocking OTLP client (no-reactor panic), reject negative counters, allow negative gauges 2026-07-10 21:27:56 +02:00
Cargo.toml fix(c0re): stop compiling out the OTLP exporter's own diagnostics 2026-08-14 23:16:59 +02:00
README.md docs(#2627): add READMEs for the remaining infra crates 2026-07-23 13:16:29 +02:00

hive-metric

A tiny CLI that pushes a single labeled metric to the OTEL collector, then exits. Built on the OpenTelemetry Rust SDK with the OTLP HTTP/JSON exporter.

When to use it

For emitting a one-off counter or gauge from a shell script or systemd unit without embedding an OTEL SDK in the caller — the harness and various hive scripts use it to record per-agent metrics.

Usage

hive-metric <name> <value> [--type counter|gauge] [--labels key=value ...]

Standard OTEL environment variables are read automatically by the SDK:

  • OTEL_EXPORTER_OTLP_ENDPOINT — collector URL (required)
  • OTEL_EXPORTER_OTLP_HEADERS — auth headers (Key=Value,...)
  • OTEL_RESOURCE_ATTRIBUTES — resource labels (k=v,...)

The harness populates all of these per-agent when services.hyperhive.otel.enable = true. See docs/observability.md for the collector setup and the metrics hyperhive exports.