Remove legacy sysmon shadow/cutover metric tech-debt (post-JetStream migration) [#3788] #3801

Open
opened 2026-06-13 23:30:17 +00:00 by mfreeman451 · 2 comments
Owner

Remove legacy sysmon shadow / cutover metric tech-debt (post-JetStream migration)

Bundles the migration-era tech-debt deletions from carverauto/serviceradar#3788 (none currently tracked by a task/issue). These are safe to remove once the JetStream metric path is authoritative.

DELETE

  • @legacy_sysmon_schema "serviceradar.sysmon.shadow.v1" acceptance — event_writer/processors/metrics.ex:19,151.
  • AGENT_GATEWAY_SYSMON_METRICS_SHADOW_ENABLED / AGENT_GATEWAY_SNMP_METRICS_SHADOW_ENABLED env defaults — serviceradar_agent_gateway/config/runtime.exs:312-318 — and the helm sysmonMetricsShadowEnabled / snmpMetricsShadowEnabled aliases — helm/serviceradar/templates/agent-gateway.yaml:29-36.
  • Flag-gated direct insert maybe_insert_metrics + :plugin_result_direct_metrics_enabledobservability/plugin_result_ingestor.ex:52,200-206; serviceradar_core/config/config.exs:133. Keep build_status_row/insert_status — only the metric insert is debt.
  • No-op results_router sysmon/snmp metrics cutover handlers (handle_sysmon_metrics/handle_snmp_metricsacknowledge_metrics_cutover) + their dispatch entries — results_router.ex:129-137,239-245,611; status_handler.ex source list.

KEEP — do NOT delete

sysmon_profiles (config table + UI + compiler) is configuration, not metric debt. The five sysmon metric hypertables (cpu/memory/disk/process/cpu_cluster_metrics) are unification candidates handled under the contract work, not this cleanup.

Before removing

Confirm no live producer still emits serviceradar.sysmon.shadow.v1 and no deployment sets plugin_result_direct_metrics_enabled=true or the *ShadowEnabled overrides. Rewrite the tests that pin the shadow schema (see #3788 tests list).

## Remove legacy sysmon shadow / cutover metric tech-debt (post-JetStream migration) Bundles the migration-era tech-debt deletions from carverauto/serviceradar#3788 (none currently tracked by a task/issue). These are safe to remove once the JetStream metric path is authoritative. ### DELETE - `@legacy_sysmon_schema "serviceradar.sysmon.shadow.v1"` acceptance — `event_writer/processors/metrics.ex:19,151`. - `AGENT_GATEWAY_SYSMON_METRICS_SHADOW_ENABLED` / `AGENT_GATEWAY_SNMP_METRICS_SHADOW_ENABLED` env defaults — `serviceradar_agent_gateway/config/runtime.exs:312-318` — and the helm `sysmonMetricsShadowEnabled` / `snmpMetricsShadowEnabled` aliases — `helm/serviceradar/templates/agent-gateway.yaml:29-36`. - Flag-gated direct insert `maybe_insert_metrics` + `:plugin_result_direct_metrics_enabled` — `observability/plugin_result_ingestor.ex:52,200-206`; `serviceradar_core/config/config.exs:133`. Keep `build_status_row`/`insert_status` — only the metric insert is debt. - No-op `results_router` sysmon/snmp metrics cutover handlers (`handle_sysmon_metrics`/`handle_snmp_metrics` → `acknowledge_metrics_cutover`) + their dispatch entries — `results_router.ex:129-137,239-245,611`; `status_handler.ex` source list. ### KEEP — do NOT delete `sysmon_profiles` (config table + UI + compiler) is configuration, not metric debt. The five sysmon **metric** hypertables (`cpu/memory/disk/process/cpu_cluster_metrics`) are unification candidates handled under the contract work, not this cleanup. ### Before removing Confirm no live producer still emits `serviceradar.sysmon.shadow.v1` and no deployment sets `plugin_result_direct_metrics_enabled=true` or the `*ShadowEnabled` overrides. Rewrite the tests that pin the shadow schema (see #3788 tests list).
Author
Owner

Re-assessed against current staging (the line numbers in the description are stale — intervening work, incl. the de-causal sweep #4319, moved a lot).

5 of the 6 DELETE items are already gone (confirmed absent repo-wide):

  • @legacy_sysmon_schema "serviceradar.sysmon.shadow.v1" acceptance — gone (no producer or consumer of the schema anywhere).
  • AGENT_GATEWAY_SYSMON_METRICS_SHADOW_ENABLED / AGENT_GATEWAY_SNMP_METRICS_SHADOW_ENABLED + the helm sysmonMetricsShadowEnabled / snmpMetricsShadowEnabled aliases — gone.
  • maybe_insert_metrics + :plugin_result_direct_metrics_enabled (plugin_result_ingestor.ex / config.exs) — gone.

The 6th item evolved rather than being deleted. results_router's handle_sysmon_metrics / handle_snmp_metrics (and handle_sweep_metrics) no longer call acknowledge_metrics_cutover; they now actively reject the legacy metric-via-gateway-status path:

defp reject_gateway_metric_status(status) do
  {:error, {:gateway_metric_status_not_core_routable, status[:source]}}
end

That reject is the correct safety end-state — removing it (and the "sysmon-metrics"/"snmp-metrics" dispatch) before #3788 eliminates the legacy metric path would let a straggler legacy status fall through to the default handler. So the remaining removal is folded into #3788 (this issue's parent — "the tail of #3788"), to land when the legacy path is gone.

Conclusion: no safe standalone deletion remains for this issue right now; it's effectively resolved except for the reject-handler removal, which is now tracked as part of #3788.

Re-assessed against current `staging` (the line numbers in the description are stale — intervening work, incl. the de-causal sweep #4319, moved a lot). **5 of the 6 DELETE items are already gone** (confirmed absent repo-wide): - `@legacy_sysmon_schema "serviceradar.sysmon.shadow.v1"` acceptance — gone (no producer or consumer of the schema anywhere). - `AGENT_GATEWAY_SYSMON_METRICS_SHADOW_ENABLED` / `AGENT_GATEWAY_SNMP_METRICS_SHADOW_ENABLED` + the helm `sysmonMetricsShadowEnabled` / `snmpMetricsShadowEnabled` aliases — gone. - `maybe_insert_metrics` + `:plugin_result_direct_metrics_enabled` (`plugin_result_ingestor.ex` / `config.exs`) — gone. **The 6th item evolved rather than being deleted.** `results_router`'s `handle_sysmon_metrics` / `handle_snmp_metrics` (and `handle_sweep_metrics`) no longer call `acknowledge_metrics_cutover`; they now actively **reject** the legacy metric-via-gateway-status path: ```elixir defp reject_gateway_metric_status(status) do {:error, {:gateway_metric_status_not_core_routable, status[:source]}} end ``` That reject is the correct safety end-state — removing it (and the `"sysmon-metrics"`/`"snmp-metrics"` dispatch) *before* #3788 eliminates the legacy metric path would let a straggler legacy status fall through to the default handler. So the remaining removal is **folded into #3788** (this issue's parent — "the tail of #3788"), to land when the legacy path is gone. **Conclusion:** no safe standalone deletion remains for this issue right now; it's effectively resolved except for the reject-handler removal, which is now tracked as part of #3788.
Author
Owner

Re-assessed against current staging (the line numbers in the description are stale — intervening work, incl. the de-causal sweep #4319, moved a lot).

5 of the 6 DELETE items are already gone (confirmed absent repo-wide):

  • @legacy_sysmon_schema "serviceradar.sysmon.shadow.v1" acceptance — gone (no producer or consumer of the schema anywhere).
  • AGENT_GATEWAY_SYSMON_METRICS_SHADOW_ENABLED / AGENT_GATEWAY_SNMP_METRICS_SHADOW_ENABLED + the helm sysmonMetricsShadowEnabled / snmpMetricsShadowEnabled aliases — gone.
  • maybe_insert_metrics + :plugin_result_direct_metrics_enabled (plugin_result_ingestor.ex / config.exs) — gone.

The 6th item evolved rather than being deleted. results_router's handle_sysmon_metrics / handle_snmp_metrics (and handle_sweep_metrics) no longer call acknowledge_metrics_cutover; they now actively reject the legacy metric-via-gateway-status path:

defp reject_gateway_metric_status(status) do
  {:error, {:gateway_metric_status_not_core_routable, status[:source]}}
end

That reject is the correct safety end-state — removing it (and the "sysmon-metrics"/"snmp-metrics" dispatch) before #3788 eliminates the legacy metric path would let a straggler legacy status fall through to the default handler. So the remaining removal is folded into #3788 (this issue's parent — "the tail of #3788"), to land when the legacy path is gone.

Conclusion: no safe standalone deletion remains for this issue right now; it's effectively resolved except for the reject-handler removal, which is now tracked as part of #3788.

Re-assessed against current `staging` (the line numbers in the description are stale — intervening work, incl. the de-causal sweep #4319, moved a lot). **5 of the 6 DELETE items are already gone** (confirmed absent repo-wide): - `@legacy_sysmon_schema "serviceradar.sysmon.shadow.v1"` acceptance — gone (no producer or consumer of the schema anywhere). - `AGENT_GATEWAY_SYSMON_METRICS_SHADOW_ENABLED` / `AGENT_GATEWAY_SNMP_METRICS_SHADOW_ENABLED` + the helm `sysmonMetricsShadowEnabled` / `snmpMetricsShadowEnabled` aliases — gone. - `maybe_insert_metrics` + `:plugin_result_direct_metrics_enabled` (`plugin_result_ingestor.ex` / `config.exs`) — gone. **The 6th item evolved rather than being deleted.** `results_router`'s `handle_sysmon_metrics` / `handle_snmp_metrics` (and `handle_sweep_metrics`) no longer call `acknowledge_metrics_cutover`; they now actively **reject** the legacy metric-via-gateway-status path: ```elixir defp reject_gateway_metric_status(status) do {:error, {:gateway_metric_status_not_core_routable, status[:source]}} end ``` That reject is the correct safety end-state — removing it (and the `"sysmon-metrics"`/`"snmp-metrics"` dispatch) *before* #3788 eliminates the legacy metric path would let a straggler legacy status fall through to the default handler. So the remaining removal is **folded into #3788** (this issue's parent — "the tail of #3788"), to land when the legacy path is gone. **Conclusion:** no safe standalone deletion remains for this issue right now; it's effectively resolved except for the reject-handler removal, which is now tracked as part of #3788.
Sign in to join this conversation.
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#3801
No description provided.