Skip to content

feat: CPU Temperature Monitoring for Hosts#1352

Open
thiagoalcav wants to merge 2 commits intomoghtech:mainfrom
thiagoalcav:feature/host-temperature
Open

feat: CPU Temperature Monitoring for Hosts#1352
thiagoalcav wants to merge 2 commits intomoghtech:mainfrom
thiagoalcav:feature/host-temperature

Conversation

@thiagoalcav
Copy link
Copy Markdown

Motivation

This pull request introduces native CPU temperature monitoring for hosts within the Komodo ecosystem. Previously, users might have relied on external tools like Beszel or other standalone monitoring systems to keep an eye on hardware thermals. By integrating this directly into Komodo, we provide a more unified management experience, allowing users to monitor both their containers and their host's hardware health in a single pane of glass.

Changes

Backend & Core

  • komodo_client: Added an optional cpu_temp field to SystemStats (real-time) and SystemStatsRecord (historical) entities.
  • periphery: Implemented thermal sensor collection in the stats polling loop using the sysinfo crate. It automatically filters for components labeled "core", "package", or "cpu" and reports the maximum temperature found to represent the host's thermal state accurately.
  • core: Updated the monitoring logic to receive and persist CPU temperature data in the database (FerretDB/Postgres).

Frontend (UI)

  • Server Dashboard: Added a new "Temp" column to the server list. It uses the standard StatCell component with a progress bar and dynamic coloring:
    • 🟢 Green: ≤ 65°C
    • 🟠 Orange: 66°C - 80°C
    • 🔴 Red: > 80°C
  • Server Header: Added a quick-view temperature indicator with a thermometer icon in the server details header, placed logically after CPU cores and before Load Average.
  • Server Details: Included temperature information within the CPU usage card for detailed viewing.
  • UI Consistency: Updated StatCell to support custom suffixes (like °C), and optimized column widths across the dashboard to accommodate the new metric without horizontal scrolling.

Technical Details

  • Built on top of the existing sysinfo integration for zero overhead and maximum portability.
  • Respects Komodo's idiomatic patterns for data flow between Periphery -> Core -> UI.
  • All new fields are optional/nullable to ensure backward compatibility with older Periphery agents.

Screenshots (Internal validation)

  • image
image - image - image - image

@jhenrique09
Copy link
Copy Markdown

Nice addition, +1

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.

2 participants