Skip to content

deck: host metrics and per-VM dashboards (Prometheus, cAdvisor, Grafana) - #118

Closed
Nihalsaeed wants to merge 2 commits into
tinkerhub0:mainfrom
Nihalsaeed:deck/metrics-self
Closed

Nihalsaeed wants to merge 2 commits into
tinkerhub0:mainfrom
Nihalsaeed:deck/metrics-self

Conversation

@Nihalsaeed

Copy link
Copy Markdown
Collaborator

What

Adds white-box monitoring as a deck service, alongside the Uptime Kuma black-box monitor that is already enabled.

  • services.prometheus (15d retention) with two scrape jobs: node and cgroups.
  • services.prometheus.exporters.node with the systemd collector (unit state).
  • services.cadvisor with --docker_only=false so all cgroups are reported. Each microVM and virtiofsd is a systemd service with its own cgroup, so this is where per-VM CPU/RAM comes from. The dashboard uses the id label because raw cgroups have an empty name label.
  • services.grafana with Prometheus provisioned as the default datasource and a checked-in dashboard (host CPU idle, memory available, load, top cgroups by CPU and memory).
  • Everything binds to 127.0.0.1. No new public or mesh port; Grafana is reached with ssh -L 3000:127.0.0.1:3000 mothership. No credentials or secrets are added.

Wiring is minimal: one import in modules/deck/default.nix and one enable = true in hosts/mothership/default.nix.

Why

Uptime Kuma answers "is it up?". These numbers answer "why is it slow?", including which member VM is using the CPU. See docs/monitoring.md (new page, linked from the docs index).

Checks

  • Dashboard JSON parses.
  • No BOM/CRLF in the new or changed .nix files.
  • Nix is not installed in this workspace, so nix flake check could not be run locally — CI evaluates both hosts and runs the flake checks. Option names were verified against the pinned nixpkgs (rev 241313f4e8e508cb9b13278c2b0fa25b9ca27163): services.prometheus.retentionTime, services.cadvisor.extraOptions, services.grafana.provision.*.

Note: another thread has a parallel PR implementing a similar stack under modules/monitoring/; this one follows the existing modules/deck/ convention instead. Maintainers should pick one.

@Nihalsaeed Nihalsaeed closed this Nov 24, 2026
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