From d9d5495f1f52669429a667a073c9be0f6382b425 Mon Sep 17 00:00:00 2001 From: damocles Date: Wed, 24 Jun 2026 21:05:37 +0200 Subject: [PATCH] docs: regenerate hivectl-cli.md for the migrate-stats verb --- docs/tools/hivectl-cli.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/tools/hivectl-cli.md b/docs/tools/hivectl-cli.md index 49b83751..6349c71b 100644 --- a/docs/tools/hivectl-cli.md +++ b/docs/tools/hivectl-cli.md @@ -35,6 +35,7 @@ This document contains the help content for the `hivectl` command-line program. * [`hivectl quota limit`↴](#hivectl-quota-limit) * [`hivectl subvol`↴](#hivectl-subvol) * [`hivectl subvol upgrade`↴](#hivectl-subvol-upgrade) +* [`hivectl migrate-stats`↴](#hivectl-migrate-stats) * [`hivectl completions`↴](#hivectl-completions) ## `hivectl` @@ -57,6 +58,7 @@ Sibling to the `hive-c0re` daemon binary. Covers host-side admin operations that * `restart` — Restart containers hive-wide — `stop` then `start` over the same scope. Bare `hivectl restart` restarts **everything** (all sub-agents plus the ci/forge/gateway/matrix infra containers); the same scope flags as `stop`/`start` narrow it (`--agents`, `--ci`, `--forge`, `--gateway`, `--matrix`, `--agent `). If the stop phase reports a failure the start phase is skipped so the operator can investigate. Requires the hive-c0re daemon * `quota` — Per-agent disk accounting + optional quotas via btrfs qgroups * `subvol` — btrfs subvolume management for agent state dirs +* `migrate-stats` — One-shot backfill of historical per-agent turn stats into the OTEL collector as cumulative `claude_code.token.usage` metrics, so pre-OTEL token history shows up in grafana alongside the live stream. Reads each agent's `hyperhive-turn-stats.sqlite` and POSTs OTLP/HTTP JSON to the collector. Every datapoint is tagged `hyperhive-migration="true"`. Safe to re-run (cumulative samples at fixed historical timestamps are idempotent on the backend) * `completions` — Generate a shell completion script for `hivectl` and print it to stdout ###### **Options:** @@ -513,6 +515,20 @@ Convert an existing plain-dir agent state root into a btrfs subvolume in place. +## `hivectl migrate-stats` + +One-shot backfill of historical per-agent turn stats into the OTEL collector as cumulative `claude_code.token.usage` metrics, so pre-OTEL token history shows up in grafana alongside the live stream. Reads each agent's `hyperhive-turn-stats.sqlite` and POSTs OTLP/HTTP JSON to the collector. Every datapoint is tagged `hyperhive-migration="true"`. Safe to re-run (cumulative samples at fixed historical timestamps are idempotent on the backend) + +**Usage:** `hivectl migrate-stats [OPTIONS]` + +###### **Options:** + +* `--endpoint ` — OTLP collector base URL (e.g. `http://10.42.0.1:4318`). Defaults to `$OTEL_EXPORTER_OTLP_ENDPOINT`, then `$HYPERHIVE_OTEL_ENDPOINT` +* `--agent ` — Limit to a single agent (default: every agent with a state dir) +* `--dry-run` — Report datapoint counts without sending anything + + + ## `hivectl completions` Generate a shell completion script for `hivectl` and print it to stdout.