Skip to content

Add true RSS reporting to dashboards#94

Merged
chrisbliss18 merged 1 commit intov2from
feature/dashboard-true-rss
Apr 30, 2026
Merged

Add true RSS reporting to dashboards#94
chrisbliss18 merged 1 commit intov2from
feature/dashboard-true-rss

Conversation

@chrisbliss18
Copy link
Copy Markdown
Contributor

Summary

This closes out the dashboard memory reporting work by adding true process RSS alongside the existing Go runtime memory signal.

The host and fleet dashboards now expose both values so operators can compare Jetmon with host-level tools like ps, top, and systemd while still keeping Go Sys memory visible for runtime guardrails and pprof investigations.

What changed

  • Added a shared internal/processmetrics helper for local process memory sampling.
  • Added rss_mem_mb to jetmon_process_health via migration 26.
  • Published RSS and Go Sys memory from both jetmon2 and jetmon-deliverer process-health snapshots.
  • Updated /api/state, /api/host, /api/fleet, the host dashboard, and the fleet dashboard to expose RSS beside Go Sys memory.
  • Updated StatsD memory gauges so process.rss_mb reports resident memory when procfs is available, with additive process.go_sys_mem_mb for the runtime allocator view.
  • Updated operations, migration, architecture, data-model, project, changelog, and roadmap docs.

Example dashboard values

Host dashboard throughput section now shows memory as two separate cards:

RSS Memory      37MB
Go Sys Memory   24MB

Fleet process rows now show both values in the memory column:

host-a:monitor     green   running   2s   0-499   active=12 queue=4 retry=0   rss=37MB go=24MB
host-b:deliverer   green   running   3s   -       active=0 queue=0 retry=0    rss=19MB go=14MB

The JSON payload exposes both fields for machine parsing:

{
  "go_sys_mem_mb": 24,
  "rss_mem_mb": 37
}

Review notes

I reviewed the branch from sysadmin, security, and code-quality perspectives after the initial implementation.

  • Sysadmin: RSS is now the first memory value shown, with Go Sys retained as the runtime and guardrail signal.
  • Security: RSS collection reads only /proc/self/statm; there is no user-controlled path in production code and no additional remote surface beyond the existing internal dashboards and APIs.
  • Engineering: memory sampling now flows through one focused CurrentMemory() helper, and tests assert the exact JSON and StatsD fields operators and automation will consume.

Testing

  • go test ./...
  • go vet ./...
  • make all
  • Targeted dry-run style tests for procfs parsing, current memory sampling, /api/state JSON, fleet rollup preservation, and StatsD metric names.

Add a shared processmetrics helper that reads Linux procfs resident pages, while keeping Go runtime Sys and heap allocation available as separate metrics. The host dashboard, fleet process-health snapshots, fleet JSON payloads, and fleet table now expose RSS alongside Go Sys memory instead of forcing operators to infer host memory from runtime allocator data.

Extend jetmon_process_health with rss_mem_mb and preserve go_sys_mem_mb for the runtime guardrail signal. Monitor and deliverer snapshots now publish both fields, and StatsD process.rss_mb again reports resident memory when procfs is available while process.go_sys_mem_mb keeps the old runtime view visible.

Update dashboard, rollout, architecture, and operations docs to explain how operators should use RSS versus Go Sys memory during rollout and memory-pressure investigations.
@chrisbliss18 chrisbliss18 merged commit 96c6c4a into v2 Apr 30, 2026
@chrisbliss18 chrisbliss18 deleted the feature/dashboard-true-rss branch April 30, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant