docs(#2627): add READMEs for the remaining infra crates
Second increment of the per-crate README effort, covering the rest of the infra/wire/priv column: hive-priv, hive-metric, hive-types, hive-sh4re, hive-core-agent-sock, hive-agent-sock. Same shape as the first batch — purpose + when-to-use, and point at the crate-root //! docs plus the relevant docs/ pages rather than duplicating them. Wires readme = "README.md" into each Cargo.toml [package]. Disjoint from the batch-1 crates, so the two increments compose cleanly.
This commit is contained in:
parent
4017a57350
commit
bbfc578c95
12 changed files with 162 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
[package]
|
||||
name = "hive-metric"
|
||||
version.workspace = true
|
||||
readme = "README.md"
|
||||
edition.workspace = true
|
||||
|
||||
[[bin]]
|
||||
|
|
|
|||
26
hive-metric/README.md
Normal file
26
hive-metric/README.md
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# 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 ...]
|
||||
```
|
||||
|
||||
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.
|
||||
Loading…
Reference in a new issue