feat: add Prometheus resource trends - #100
Open
WuShang-d wants to merge 2 commits into
Open
Conversation
WuShang-d
marked this pull request as ready for review
July 17, 2026 02:47
Contributor
|
@WuShang-d provide a demo video to show your code work as expected, like a web UI client to consume your Prometheus API, also the new web UI of CasOS |
Contributor
Author
|
Here is the demo video for PR #100. It shows:
The CasOS frontend consumes the new casos-pr-100-demo.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /api/get-monitor-metricswith validated cluster, Node, Pod, and PVC metric queries and centralized PromQL definitionsWhy
The Monitor Center currently exposes Kubernetes state snapshots, health checks, Events, issues, and diagnosis, but it cannot show how resource usage changes over time. This adds historical trends through Prometheus without making CasOS collect or persist metrics itself.
User impact
Users can inspect cluster CPU, memory, and network history together with per-Node disk and per-PVC storage trends over selectable time ranges. Prometheus remains optional: when it is unconfigured, unreachable, or missing a metric family, the existing health, Event, issue, and diagnosis functionality continues to operate and the trend area reports an explicit state.
Validation
go test -tags skipCi ./...go build ./...yarn eslint src/MonitorPage.js src/MonitorMetricChart.js src/backend/MonitorBackend.js src/monitorMetrics.js src/monitorMetrics.test.jsCI=true yarn craco test --watchAll=false --runTestsByPath src/monitorMetrics.test.jsyarn buildgit diff --check upstream/master...HEADNotes
Prometheus must already scrape node_exporter, kubelet/cAdvisor, and kubelet volume metrics. Authentication and custom CA configuration for Prometheus are outside this phase.