feat: server monitoring metrics - #76
Closed
loadinglucian wants to merge 3 commits into
Closed
Conversation
- Create modular Caddy configuration with conf.d/sites/ directory - Add localhost-only monitoring endpoints (PHP-FPM status) - Enable PHP-FPM status page in pool configuration - Update demo-site to use new modular config structure - Improve code organization with better section headers
- Query Caddy admin API for version, uptime, requests, memory - Query PHP-FPM status endpoint for pool stats and performance metrics - Extract metrics using curl and text parsing (no jq dependency) - Output metrics in YAML format for server info command
- Display Caddy metrics: version, uptime, requests, memory - Display PHP-FPM metrics: pool, processes, queue, performance indicators - Add formatUptime helper for human-readable uptime display - Highlight warnings for queue backlog and performance issues
Contributor
|
Caution Review failedThe pull request is closed. WalkthroughThis PR extends server deployment and monitoring capabilities by adding Caddy and PHP-FPM metrics collection, implementing server information display enhancements, establishing deployer user management, creating deployment infrastructure setup workflows, and introducing package manager lock handling with repository configuration logic. Changes
Sequence DiagramssequenceDiagram
participant main as Main Script
participant caddy as Caddy Metrics<br/>(get_caddy_metrics)
participant phpfpm as PHP-FPM Metrics<br/>(get_php_fpm_metrics)
participant yaml as YAML Output
main->>caddy: Execute metrics collection
caddy-->>main: Return tab-separated data<br/>(version, uptime_s, requests, etc.)
main->>phpfpm: Execute metrics collection
phpfpm-->>main: Return tab-separated data<br/>(pool, processes, queue, etc.)
main->>main: Parse outputs into variables
main->>yaml: Emit caddy section with availability flag
main->>yaml: Emit php_fpm section with availability flag
rect rgb(200, 220, 240)
Note over main,yaml: New metrics integrated into<br/>server-info YAML output
end
sequenceDiagram
participant main as Main Install Script
participant prereq as Prerequisites
participant repos as Repositories
participant caddy as Caddy Setup
participant deploy as Deployer Setup
participant key as SSH Key Setup
main->>prereq: Check prerequisites (distro/family)
prereq-->>main: Validation complete
main->>repos: setup_repositories()
repos-->>main: Add Caddy & PHP repos with GPG keys
main->>caddy: setup_caddy_structure()
caddy-->>main: Create config dirs, Caddyfile, localhost proxy
main->>deploy: ensure_deployer_user()
deploy->>deploy: setup_deploy_user()
deploy->>deploy: configure_deployer_groups()
deploy->>deploy: setup_deploy_directories()
deploy-->>main: Deployer account configured with permissions
main->>key: setup_deploy_key()
key-->>main: SSH key generated for git operations
rect rgb(200, 240, 200)
Note over main,key: New orchestrated setup flows<br/>for infrastructure & deployment
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes
Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
Comment |
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 by CodeRabbit
New Features
Improvements