hyperhive/hive-metric
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 34fed47400 cut the comments back to what the code cannot say
mara: comments to code ratio too high. It was 16 comment lines for one
line of feature.

Kept only the fact that stops the feature being trimmed away again - it
is not a transport, it is in `default`, so `default-features = false`
drops it - and, in hive-metric, the one reason its declaration
deliberately differs. Why an HTTP 200 is the failure that matters, and
what a stderr-reporting CLI would cost, are the PR's and the follow-up
issue's job, not the manifest's.
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 cut the comments back to what the code cannot say 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.