[Feat] Monitoring Improvements#1115
Merged
RichardAnderson merged 8 commits intoMay 23, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands Vito’s monitoring system to collect and display additional server health metrics (CPU core info, CPU usage/steal, swap, uptime, reboot-required state, and OOM kill count), adds an agent ingestion endpoint, and updates the UI to surface these signals (including warning banners).
Changes:
- Extend metric collection/storage to include CPU, swap, uptime, reboot-required, and OOM kill stats (SSH collector + DB schema + model casting).
- Add an API endpoint + Action to accept metrics from the Vito Agent and update tests accordingly.
- Refresh monitoring UI/UX (new detailed CPU/Memory/Disk views, reusable warning banners, server list warning indicator).
Reviewed changes
Copilot reviewed 34 out of 36 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Unit/Commands/GetMetricsCommandTest.php | Expands command test coverage for newly collected SSH metrics. |
| tests/Feature/MetricsTest.php | Adds feature coverage for monitoring.json returning current + history. |
| tests/Feature/API/AgentControllerTest.php | Introduces API tests for agent metric ingestion, auth, and validation. |
| resources/views/ssh/os/resource-info.blade.php | Extends SSH script output with additional system stats. |
| resources/js/types/server.d.ts | Adds warnings typing for server list/overview warning UI. |
| resources/js/types/metric.d.ts | Updates metric typings and introduces MetricsResponse/CurrentMetric. |
| resources/js/pages/servers/overview.tsx | Adds server banners and reboot-required detection via metrics query. |
| resources/js/pages/servers/index.tsx | Displays per-server warning count indicator in the table actions. |
| resources/js/pages/servers/components/update-server.tsx | Improves update confirmation copy and dialog structure. |
| resources/js/pages/servers/components/reboot-server.tsx | Renames “Reboot” to “Restart” and improves confirmation copy. |
| resources/js/pages/servers/components/actions.tsx | Updates dropdown label to “Restart”. |
| resources/js/pages/monitoring/show.tsx | Replaces generic cards view with dedicated CPU/Memory/Disk views. |
| resources/js/pages/monitoring/index.tsx | Adds system status + refactors memory/disk details into a component. |
| resources/js/pages/monitoring/components/use-metrics.ts | New shared React Query hook for fetching metrics with refetch intervals. |
| resources/js/pages/monitoring/components/system-status.tsx | New status tiles for uptime/reboot/OOM/core counts. |
| resources/js/pages/monitoring/components/stat-tile.tsx | New reusable stat tile component. |
| resources/js/pages/monitoring/components/resource-usage-chart.tsx | Generalizes chart to arbitrary metric keys and improves empty-state handling. |
| resources/js/pages/monitoring/components/metrics-cards.tsx | Switches to %-based memory/disk charts and reuses useMetrics. |
| resources/js/pages/monitoring/components/memory-view.tsx | New memory-focused monitoring view with swap/OOM context. |
| resources/js/pages/monitoring/components/memory-disk-details.tsx | New extracted component for index-page memory/disk detail cards. |
| resources/js/pages/monitoring/components/disk-view.tsx | New disk-focused view (capacity bar + trend charts). |
| resources/js/pages/monitoring/components/cpu-view.tsx | New CPU-focused view (usage/load/steal charts + tiles). |
| resources/js/lib/utils.ts | Adds humanizeSeconds() for uptime formatting. |
| resources/js/components/site-banners.tsx | Refactors site warnings UI to use shared banner components. |
| resources/js/components/server-banners.tsx | New server warning banners (updates + reboot required). |
| resources/js/components/banners.tsx | New shared warning banner primitives (row + collapsible block). |
| database/migrations/2026_05_23_120000_add_extended_stats_to_metrics_table.php | Adds extended stats columns to the metrics table. |
| database/factories/MetricFactory.php | Updates metric factory with new fields for testing/seeding. |
| app/Tables/ServerTable.php | Adds warnings data column and eager-loads latestMetric for server list. |
| app/SSH/OS/OS.php | Parses new SSH output fields into the metrics payload. |
| app/Models/Server.php | Adds latestMetric() relationship for warning/banner logic. |
| app/Models/Metric.php | Adds new fields, casts, and rounding/JSON attribute handling. |
| app/Http/Controllers/MonitoringController.php | Removes lastMetric prop and serves metrics via monitoring.json. |
| app/Http/Controllers/API/AgentController.php | Switches to Action-based ingestion and adds constant-time secret check. |
| app/Actions/Monitoring/StoreAgentMetric.php | New Action for validating and storing agent-submitted metrics. |
| app/Actions/Monitoring/GetMetrics.php | Returns { current, history } and enriches history with derived percent fields. |
saeedvaziry
approved these changes
May 23, 2026
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.
This pull request significantly extends the server monitoring metrics system by adding support for a wide range of additional system statistics, improving both backend data handling and frontend display. The changes include database schema updates, model and API enhancements, and frontend adjustments to support and visualize the new metrics.