remove otel.metricIntervalMs and the host-level otel.debug
Both are ignored with a warning through the same shim, now nix/host-modules/hive-options-removed.nix. - otel.metricIntervalMs: claude in every agent and hive-c0re's container-resource exporter run at the 60s default. The agent-level services.hyperhive.agent.otel.metricIntervalMs, set only by the meta render, goes too (warning shim in nix/agent-modules/otel-removed.nix). - otel.debug: services.hyperhive.agent.otel.debug stays, documented and set in an agent's own config; the meta render no longer emits it.
This commit is contained in:
parent
4b5707768c
commit
0a5f35bda3
14 changed files with 136 additions and 152 deletions
|
|
@ -219,7 +219,7 @@ in
|
|||
baseClaudeEnv
|
||||
// lib.optionalAttrs otelCfg.enable otelSettingsEnv
|
||||
// lib.optionalAttrs (otelCfg.enable && otelCfg.debug) {
|
||||
# SDK diagnostics — noisy; only on when services.hyperhive.otel.debug = true.
|
||||
# SDK diagnostics — noisy; only on when services.hyperhive.agent.otel.debug = true.
|
||||
CLAUDE_CODE_OTEL_DIAG_STDERR = "1";
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ in
|
|||
./memory-cap.nix
|
||||
./network.nix
|
||||
./otel.nix
|
||||
./otel-removed.nix
|
||||
./packages.nix
|
||||
./queue.nix
|
||||
./queue-identity.nix
|
||||
|
|
|
|||
27
nix/agent-modules/otel-removed.nix
Normal file
27
nix/agent-modules/otel-removed.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# Removal shim for `services.hyperhive.agent.otel.metricIntervalMs`.
|
||||
#
|
||||
# A definition is ignored and produces a warning, so an agent config, or a
|
||||
# meta flake rendered before the option went, keeps evaluating. claude runs
|
||||
# at the OTEL SDK's default export cadence.
|
||||
#
|
||||
# Self-contained and deletable: one file to remove when the deprecation
|
||||
# window closes.
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
value = config.services.hyperhive.agent.otel.metricIntervalMs;
|
||||
in
|
||||
{
|
||||
options.services.hyperhive.agent.otel.metricIntervalMs = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.ints.positive;
|
||||
default = null;
|
||||
visible = false;
|
||||
internal = true;
|
||||
description = "Removed and ignored. `null` is \"not set\".";
|
||||
};
|
||||
|
||||
config.warnings = lib.optional (value != null) ''
|
||||
services.hyperhive.agent.otel.metricIntervalMs is removed and ignored:
|
||||
claude exports metrics at the SDK default of 60 seconds. Remove this
|
||||
setting.
|
||||
'';
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
# OpenTelemetry wiring for an agent container: the per-agent options the
|
||||
# meta flake injects (host-driven from `services.hyperhive.otel.*`), the
|
||||
# meta flake injects (host-driven from `services.hyperhive.otel.*`) plus
|
||||
# `debug`, which the agent's own config sets, the
|
||||
# environment every OTLP producer inside the container reads, and the
|
||||
# collector that forwards this container's journal to the hive.
|
||||
#
|
||||
|
|
@ -62,9 +63,6 @@ let
|
|||
# silently drop without a deltatocumulative processor.
|
||||
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE = "cumulative";
|
||||
OTEL_RESOURCE_ATTRIBUTES = resourceAttributes;
|
||||
}
|
||||
// lib.optionalAttrs (cfg.metricIntervalMs != null) {
|
||||
OTEL_METRIC_EXPORT_INTERVAL = toString cfg.metricIntervalMs;
|
||||
};
|
||||
|
||||
# The exporter's NAME picks the wire protocol, so `protocol` has to be
|
||||
|
|
@ -131,25 +129,14 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
metricIntervalMs = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.ints.positive;
|
||||
default = null;
|
||||
internal = true;
|
||||
description = ''
|
||||
Metric export interval in milliseconds, set as
|
||||
`OTEL_METRIC_EXPORT_INTERVAL`. Null leaves the SDK default (60s
|
||||
for Claude Code). Host-driven via
|
||||
`services.hyperhive.otel.metricIntervalMs`.
|
||||
'';
|
||||
};
|
||||
|
||||
debug = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
internal = true;
|
||||
description = ''
|
||||
Emit OTEL SDK diagnostics to stderr (`CLAUDE_CODE_OTEL_DIAG_STDERR=1`).
|
||||
Host-driven via `services.hyperhive.otel.debug`.
|
||||
Emit claude's OTEL SDK diagnostics to stderr
|
||||
(`CLAUDE_CODE_OTEL_DIAG_STDERR=1`). Set it in this agent's own
|
||||
config while troubleshooting its collector connection; it is noisy,
|
||||
so leave it off otherwise. Only takes effect when `enable` is true.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue