Performance Monitoring
Easy Deploy provides comprehensive monitoring tools to track your application’s performance, health, and user experience in real-time.
Key Metrics
Section titled “Key Metrics”Application Performance
Section titled “Application Performance”- Response Time: Average, median, and 95th percentile response times
- Throughput: Requests per second and concurrent users
- Error Rate: HTTP error responses and exception tracking
- Availability: Uptime monitoring and service health checks
Infrastructure Metrics
Section titled “Infrastructure Metrics”- CPU Usage: Server CPU utilization and load average
- Memory Usage: RAM usage and memory leaks detection
- Disk Usage: Storage consumption and I/O performance
- Network: Bandwidth usage and connection metrics
Business Metrics
Section titled “Business Metrics”- User Sessions: Active users and session duration
- Page Views: Popular pages and user journeys
- Conversion Rates: Goal completion and funnel analysis
- Revenue Impact: Performance correlation with business metrics
Monitoring Dashboard
Section titled “Monitoring Dashboard”Real-time Overview
Section titled “Real-time Overview”Access your monitoring dashboard at /monitoring in your application settings:
- Live metrics: Real-time performance data
- Historical data: Trends over time (1h, 24h, 7d, 30d)
- Alerts: Active alerts and incidents
- Service status: Current health of all services
Custom Dashboards
Section titled “Custom Dashboards”Create custom dashboards for different teams:
- Development: Deployment frequency, build times, test coverage
- Operations: Infrastructure health, alerts, capacity planning
- Business: User metrics, conversion rates, revenue impact
- Support: Error rates, customer issues, response times
Health Checks
Section titled “Health Checks”Automatic Health Checks
Section titled “Automatic Health Checks”Easy Deploy automatically monitors:
- HTTP endpoints: Response status and timing
- Database connections: Connection pool health
- External services: Third-party API availability
- Background jobs: Queue processing and worker health
Custom Health Checks
Section titled “Custom Health Checks”Define custom health check endpoints:
// Node.js health check endpointapp.get('/health', (req, res) => { const health = { status: 'healthy', timestamp: new Date().toISOString(), checks: { database: checkDatabase(), redis: checkRedis(), external_api: checkExternalAPI() } };
const isHealthy = Object.values(health.checks).every(check => check.status === 'ok'); res.status(isHealthy ? 200 : 503).json(health);});
function checkDatabase() { try { // Database connectivity check return { status: 'ok', responseTime: '15ms' }; } catch (error) { return { status: 'error', message: error.message }; }}Health Check Configuration
Section titled “Health Check Configuration”monitoring: health_checks: - name: "Main Health Check" path: "/health" interval: 30s timeout: 5s expected_status: 200
- name: "API Health Check" path: "/api/health" interval: 60s timeout: 10s expected_status: 200 headers: Authorization: "Bearer health-check-token"Application Monitoring
Section titled “Application Monitoring”Performance Tracking
Section titled “Performance Tracking”Response Time Monitoring
Section titled “Response Time Monitoring”Track application response times:
// Express.js middlewareconst responseTime = require('response-time');
app.use(responseTime((req, res, time) => { // Send metrics to Easy Deploy metrics.timing('response_time', time, { method: req.method, route: req.route.path, status: res.statusCode });}));Error Tracking
Section titled “Error Tracking”Capture and track application errors:
// Error handling middlewareapp.use((error, req, res, next) => { // Log error details console.error('Application Error:', { message: error.message, stack: error.stack, url: req.url, method: req.method, userAgent: req.get('User-Agent'), timestamp: new Date().toISOString() });
// Send error to monitoring service monitoring.captureException(error, { request: req, user: req.user, extra: { url: req.url, method: req.method } });
res.status(500).json({ error: 'Internal Server Error' });});Custom Metrics
Section titled “Custom Metrics”Send custom metrics from your application:
// Custom metrics examplesconst metrics = require('@easydeploy/metrics');
// Counter metricsmetrics.increment('user.login', 1, { method: 'oauth' });metrics.increment('order.completed', 1, { product: 'premium' });
// Gauge metricsmetrics.gauge('active_users', 1250);metrics.gauge('queue_size', queueLength);
// Timing metricsmetrics.timing('database.query', queryTime, { table: 'users' });metrics.timing('external_api.request', apiTime, { service: 'payment' });
// Histogram metricsmetrics.histogram('request.size', requestSize);metrics.histogram('response.size', responseSize);Infrastructure Monitoring
Section titled “Infrastructure Monitoring”Server Metrics
Section titled “Server Metrics”Automatic collection of server metrics:
- CPU: Usage percentage, load average, core utilization
- Memory: Used/available RAM, swap usage, buffer/cache
- Disk: Usage percentage, I/O operations, free space
- Network: Bytes in/out, connections, packet loss
Container Metrics
Section titled “Container Metrics”For containerized applications:
- Container CPU: CPU usage per container
- Container Memory: Memory usage and limits
- Container Network: Network I/O per container
- Container Health: Container restarts and exit codes
Database Monitoring
Section titled “Database Monitoring”Monitor database performance:
- Connection pool: Active/idle connections
- Query performance: Slow queries and execution times
- Replication lag: Master-slave synchronization delay
- Resource usage: Database CPU, memory, and disk usage
Alerting
Section titled “Alerting”Alert Rules
Section titled “Alert Rules”Configure alerts for critical metrics:
# Alert configurationalerts: - name: "High Response Time" condition: "avg(response_time) > 1000ms over 5 minutes" severity: "warning" channels: ["email", "slack"]
- name: "High Error Rate" condition: "error_rate > 5% over 2 minutes" severity: "critical" channels: ["email", "slack", "pagerduty"]
- name: "Low Disk Space" condition: "disk_usage > 90%" severity: "warning" channels: ["email"]
- name: "Database Connection Issues" condition: "database_errors > 10 over 1 minute" severity: "critical" channels: ["email", "slack", "pagerduty"]Notification Channels
Section titled “Notification Channels”Email Alerts
Section titled “Email Alerts”curl -X POST \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "type": "email", "name": "DevOps Team", "email": "[email protected]" }' \ https://api.easydeploy.com/v1/applications/APP_ID/alert-channelsSlack Integration
Section titled “Slack Integration”curl -X POST \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "type": "slack", "name": "Alerts Channel", "webhook_url": "https://hooks.slack.com/services/..." }' \ https://api.easydeploy.com/v1/applications/APP_ID/alert-channelsPagerDuty Integration
Section titled “PagerDuty Integration”curl -X POST \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "type": "pagerduty", "name": "Critical Alerts", "integration_key": "your-pagerduty-integration-key" }' \ https://api.easydeploy.com/v1/applications/APP_ID/alert-channelsLog Management
Section titled “Log Management”Application Logs
Section titled “Application Logs”Centralized log collection and analysis:
- Structured logging: JSON log format support
- Log levels: Debug, info, warning, error, critical
- Log retention: Configurable retention periods
- Search and filtering: Full-text search across logs
Log Configuration
Section titled “Log Configuration”// Node.js structured loggingconst winston = require('winston');
const logger = winston.createLogger({ level: process.env.LOG_LEVEL || 'info', format: winston.format.combine( winston.format.timestamp(), winston.format.json() ), transports: [ new winston.transports.Console(), new winston.transports.File({ filename: 'app.log' }) ]});
// Usagelogger.info('User logged in', { userId: user.id, email: user.email, ip: req.ip, userAgent: req.get('User-Agent')});
logger.error('Payment failed', { userId: user.id, orderId: order.id, amount: order.total, error: error.message});Log Analysis
Section titled “Log Analysis”- Error tracking: Automatic error detection and grouping
- Performance insights: Slow request identification
- Security monitoring: Suspicious activity detection
- Business intelligence: User behavior analysis
API Monitoring
Section titled “API Monitoring”Monitoring API
Section titled “Monitoring API”Get performance metrics via API:
# Get application metricscurl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.easydeploy.com/v1/applications/APP_ID/metrics?period=24h"
# Get specific metriccurl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.easydeploy.com/v1/applications/APP_ID/metrics/response_time?period=1h"
# Get alert historycurl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.easydeploy.com/v1/applications/APP_ID/alerts?status=triggered"Webhook Notifications
Section titled “Webhook Notifications”Receive monitoring events via webhooks:
curl -X POST \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://your-app.com/webhooks/monitoring", "events": ["alert.triggered", "alert.resolved", "deployment.completed"] }' \ https://api.easydeploy.com/v1/applications/APP_ID/webhooksPerformance Optimization
Section titled “Performance Optimization”Monitoring-Driven Optimization
Section titled “Monitoring-Driven Optimization”Use monitoring data to optimize performance:
- Identify bottlenecks: Find slow endpoints and queries
- Resource optimization: Right-size CPU and memory
- Caching strategy: Implement caching where needed
- Database optimization: Optimize queries and indexes
- CDN usage: Optimize static asset delivery
Performance Best Practices
Section titled “Performance Best Practices”- Set up comprehensive monitoring from day one
- Define SLOs (Service Level Objectives) for key metrics
- Monitor business metrics, not just technical ones
- Set up alerts for critical issues
- Review metrics regularly and optimize based on data
Troubleshooting
Section titled “Troubleshooting”Common Monitoring Issues
Section titled “Common Monitoring Issues”Metrics not appearing
- Check monitoring agent installation
- Verify API key configuration
- Review firewall and network settings
High false positive alerts
- Adjust alert thresholds based on historical data
- Use trend-based alerts instead of absolute values
- Implement alert suppression during deployments
Missing performance data
- Ensure monitoring SDK is properly integrated
- Check for sampling rate configuration
- Verify data retention settings
Performance Debugging
Section titled “Performance Debugging”- Slow response times: Check database queries, external API calls
- High error rates: Review application logs and error tracking
- Memory leaks: Monitor memory usage trends over time
- CPU spikes: Identify resource-intensive operations
Need help? Check our troubleshooting guide or contact support.