chore(agent-gateway): collapse sysmon/snmp metrics shadow flags to single enable [#3788] #3815

Merged
mfreeman451 merged 1 commit from work/3788-collapse-metrics-shadow-flags into staging 2026-06-14 03:48:28 +00:00
Owner

What

Removes the migration-era *_METRICS_SHADOW_ENABLED flag aliasing for the gateway sysmon/snmp metric publishers (#3788 DELETE list / #3801 tech-debt).

Why

The "shadow" framing predates the JetStream cutover: these metrics are now published on the primary metrics.* path, not as a shadow of a primary direct-to-DB write. The fallback is also dead in practice —

  • the Helm chart only ever injects the canonical AGENT_GATEWAY_{SYSMON,SNMP}_METRICS_ENABLED env var (it resolves the *MetricsShadowEnabled values-key alias at template time), and
  • values.yaml already uses the new sysmonMetricsEnabled / snmpMetricsEnabled keys.

Change

  • runtime.exs: read only AGENT_GATEWAY_{SYSMON,SNMP}_METRICS_ENABLED (default "true"), dropping the *_SHADOW_ENABLED || fallback. Now matches the plugin/otlp publisher config shape.
  • agent-gateway.yaml: drop the deprecated else if hasKey $gateway "*MetricsShadowEnabled" branches.

Safety

Behavior-preserving for the shipped config — helm template still renders AGENT_GATEWAY_SYSMON_METRICS_ENABLED="true" and AGENT_GATEWAY_SNMP_METRICS_ENABLED="true". Repo-wide grep confirms no remaining SHADOW_ENABLED / MetricsShadowEnabled references. mix compile clean; runtime.exs passes mix format --check-formatted.

Refs #3788, #3801

## What Removes the migration-era `*_METRICS_SHADOW_ENABLED` flag aliasing for the gateway sysmon/snmp metric publishers (#3788 DELETE list / #3801 tech-debt). ## Why The "shadow" framing predates the JetStream cutover: these metrics are now published on the **primary** `metrics.*` path, not as a shadow of a primary direct-to-DB write. The fallback is also dead in practice — - the Helm chart only ever injects the canonical `AGENT_GATEWAY_{SYSMON,SNMP}_METRICS_ENABLED` env var (it resolves the `*MetricsShadowEnabled` values-key alias at template time), and - `values.yaml` already uses the new `sysmonMetricsEnabled` / `snmpMetricsEnabled` keys. ## Change - `runtime.exs`: read only `AGENT_GATEWAY_{SYSMON,SNMP}_METRICS_ENABLED` (default `"true"`), dropping the `*_SHADOW_ENABLED` `||` fallback. Now matches the plugin/otlp publisher config shape. - `agent-gateway.yaml`: drop the deprecated `else if hasKey $gateway "*MetricsShadowEnabled"` branches. ## Safety Behavior-preserving for the shipped config — `helm template` still renders `AGENT_GATEWAY_SYSMON_METRICS_ENABLED="true"` and `AGENT_GATEWAY_SNMP_METRICS_ENABLED="true"`. Repo-wide grep confirms no remaining `SHADOW_ENABLED` / `MetricsShadowEnabled` references. `mix compile` clean; `runtime.exs` passes `mix format --check-formatted`. Refs #3788, #3801
Author
Owner

Finding: rollout docs still instruct operators to use the removed shadow terminology/knobs.

This PR removes the *MetricsShadowEnabled Helm aliases and *_METRICS_SHADOW_ENABLED runtime fallback, but docs/docs/anomaly-detection.md lines 155-159 still says to enable SNMP and sysmon shadow subjects during rollout. After this change, the supported knobs are the primary metrics enable flags, so the runbook points operators at terminology/config that no longer exists.

Please update that guidance as part of the same cleanup, or explicitly call out the new AGENT_GATEWAY_{SYSMON,SNMP}_METRICS_ENABLED/Helm values.

Finding: rollout docs still instruct operators to use the removed shadow terminology/knobs. This PR removes the `*MetricsShadowEnabled` Helm aliases and `*_METRICS_SHADOW_ENABLED` runtime fallback, but `docs/docs/anomaly-detection.md` lines 155-159 still says to enable SNMP and sysmon shadow subjects during rollout. After this change, the supported knobs are the primary metrics enable flags, so the runbook points operators at terminology/config that no longer exists. Please update that guidance as part of the same cleanup, or explicitly call out the new `AGENT_GATEWAY_{SYSMON,SNMP}_METRICS_ENABLED`/Helm values.
mfreeman451 force-pushed work/3788-collapse-metrics-shadow-flags from 814f1fadf3
Some checks failed
Helm Lint / Helm Lint (pull_request) Successful in 30s
Secret Scan / gitleaks (pull_request) Successful in 49s
Golang Tests / test-go (push) Successful in 2m27s
lint / lint (pull_request) Failing after 4m18s
lint / lint (push) Failing after 5m8s
Elixir Quality / Elixir Quality (pull_request) Failing after 12m17s
CI / build (pull_request) Successful in 22m27s
to a74f12db17
Some checks failed
Helm Lint / Helm Lint (pull_request) Successful in 49s
Secret Scan / gitleaks (pull_request) Successful in 1m6s
lint / lint (push) Failing after 5m13s
Golang Tests / test-go (push) Successful in 6m1s
lint / lint (pull_request) Failing after 5m53s
Elixir Quality / Elixir Quality (pull_request) Failing after 14m47s
CI / build (pull_request) Successful in 16m10s
2026-06-14 03:04:18 +00:00
Compare
Author
Owner

Addressed in the latest push (a74f12db17e0): updated docs/docs/anomaly-detection.md rollout step 2 to drop the removed "shadow subjects" wording and point operators at the primary enable knobs — AGENT_GATEWAY_{SNMP,SYSMON}_METRICS_ENABLED (and the gateway.snmpMetricsEnabled / gateway.sysmonMetricsEnabled Helm values). Repo-wide grep confirms no remaining shadow references in the doc.

Addressed in the latest push (`a74f12db17e0`): updated `docs/docs/anomaly-detection.md` rollout step 2 to drop the removed "shadow subjects" wording and point operators at the primary enable knobs — `AGENT_GATEWAY_{SNMP,SYSMON}_METRICS_ENABLED` (and the `gateway.snmpMetricsEnabled` / `gateway.sysmonMetricsEnabled` Helm values). Repo-wide grep confirms no remaining `shadow` references in the doc.
mfreeman451 deleted branch work/3788-collapse-metrics-shadow-flags 2026-06-14 03:48:30 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
carverauto/serviceradar!3815
No description provided.