Skip to content

feat(sidebar): real-time system resource metrics widget #13160

Description

@ricardodgtallab96

Feature Description

Add a real-time system resource metrics widget to the sidebar, giving users at-a-glance visibility into host resource usage without leaving the Portainer UI.

Motivation

Currently there is no way to monitor host resource usage (CPU, RAM, Disk) directly from the Portainer sidebar. Users have to leave the UI or open a separate tool to check system health. This feature improves operational awareness, especially for self-hosted users managing resource-constrained environments.

Proposed Solution

Display three resource bars (CPU, RAM, Disk) and a Disk I/O row in the sidebar, updated every 5 seconds:

  • CPU — usage percentage + number of logical cores
  • RAM — usage percentage + used/total (e.g. 4.2 GB / 16.0 GB)
  • Disk — usage percentage + used/total (e.g. 200 GB / 476 GB)
  • Disk I/O — read and write throughput in bytes/s (e.g. ↓ 1.2 MB/s ↑ 300 KB/s)

Metrics are collected server-side using gopsutil via a new /api/system/metrics endpoint (authenticated).

Implementation Overview

Backend

  • New handler GET /api/system/metrics returning CPU %, core count, RAM used/total, Disk used/total, Disk I/O read/write bytes/s
  • Uses github.com/shirou/gopsutil/v3

Frontend

  • New ResourceCharts component rendered in the sidebar when open
  • Polls /api/system/metrics every 5s via React Query

Alternatives Considered

  • Pulling metrics from Docker stats — limited to container scope, doesn't reflect host disk or full RAM
  • Client-side metrics via browser APIs — not available for server-side resources

Related PR

#13159

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions