Skip to content

[Feat] Monitoring Improvements#1115

Merged
RichardAnderson merged 8 commits into
vitodeploy:4.xfrom
RichardAnderson:feat/monitor-updates
May 23, 2026
Merged

[Feat] Monitoring Improvements#1115
RichardAnderson merged 8 commits into
vitodeploy:4.xfrom
RichardAnderson:feat/monitor-updates

Conversation

@RichardAnderson

Copy link
Copy Markdown
Member

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread app/Actions/Monitoring/GetMetrics.php
Comment thread app/Actions/Monitoring/GetMetrics.php
Comment thread app/Http/Controllers/API/AgentController.php
Comment thread resources/views/ssh/os/resource-info.blade.php Outdated
Comment thread resources/views/ssh/os/resource-info.blade.php Outdated
@RichardAnderson RichardAnderson marked this pull request as ready for review May 23, 2026 12:35
@RichardAnderson RichardAnderson merged commit d015834 into vitodeploy:4.x May 23, 2026
3 checks passed
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.

3 participants