Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/hive-metric/README.md
iris 6739bb903d docs: sort the top-level directories into five sections by what the reader wants
Every docs directory moves under 1-getting-started, 2-handbook,
4-implementation or 5-project; the options reference (section 3) comes from
the website and has no directory here. trust-boundary stays whole under the
handbook for now. web-ui, swarm and tools split between handbook and
implementation, and the command-line references move to
2-handbook/reference. Links, path references in code and nix, and the docs
index follow the moves; no page content changes.
2026-11-06 18:46:57 +01:00

25 lines
902 B
Markdown

# 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
```text
hive-metric <name> <value> [--type counter|gauge] [--labels key=value ...]
```
The SDK reads standard OTEL environment variables automatically:
- `OTEL_EXPORTER_OTLP_ENDPOINT` — collector URL (**required**)
- `OTEL_RESOURCE_ATTRIBUTES` — resource labels (`k=v,...`)
The harness populates both in every agent container: an agent exports straight to
its own hive's collector. See `docs/4-implementation/scheduler/observability.md` for
the collector setup and the metrics hyperhive exports.