26 lines
915 B
Markdown
26 lines
915 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 per-agent when
|
|
`services.hyperhive.otel.enable = true`: an agent exports straight to
|
|
its own hive's collector. See `docs/scheduler/observability.md` for
|
|
the collector setup and the metrics hyperhive exports.
|