fix(otel): cumulative metric temporality + metricIntervalMs knob (real metrics-export fix)

This commit is contained in:
damocles 2026-06-24 20:28:37 +02:00
commit af10a4bfef
3 changed files with 64 additions and 10 deletions

View file

@ -257,6 +257,23 @@ in
`service.name` / `agent` / `hive` / `swarm` labels.
'';
};
metricIntervalMs = lib.mkOption {
type = lib.types.nullOr lib.types.ints.positive;
default = null;
example = 10000;
description = ''
Metric export interval in milliseconds, set as
`OTEL_METRIC_EXPORT_INTERVAL` for every agent. Claude Code's
default is 60000 (60s). Leave `null` to use that default.
Each agent runs claude as a short-lived per-turn process; claude
force-flushes metrics on shutdown, so this is not required for
metrics to be exported, but a lower value gives more frequent
intermediate flushes within long turns. Cosmetic, not a
correctness knob.
'';
};
};
# Peer hives in the same swarm. Each entry declares a remote hive
@ -888,6 +905,9 @@ in
// lib.optionalAttrs (otel.headersCredential != null) {
HYPERHIVE_OTEL_HEADERS_CREDENTIAL = otel.headersCredential;
}
// lib.optionalAttrs (otel.metricIntervalMs != null) {
HYPERHIVE_OTEL_METRIC_INTERVAL_MS = toString otel.metricIntervalMs;
}
)
// {
# In-cluster forge URL — the gateway vhost (`forge.<domain>`), which