Skip to main content

Overview

deployERP provides comprehensive monitoring capabilities to ensure your Odoo servers operate at peak performance. Monitor resources, track metrics, and receive alerts for critical events.

Monitoring Dashboard

Access real-time server metrics from your dashboard:
Navigate to Servers → [Server Name] → Monitoring to view detailed metrics

Key Metrics

CPU Usage

Processor utilization percentage

Memory

RAM usage and available memory

Disk I/O

Read/write operations and latency

Network

Bandwidth usage and connections

Metrics Collection

System Metrics

deployERP collects comprehensive system metrics:
MetricDescriptionCollection IntervalRetention
CPU UsageOverall and per-core utilization30 seconds30 days
Memory UsageRAM, swap, and cache statistics30 seconds30 days
Disk UsageSpace utilization and I/O stats60 seconds30 days
Network TrafficInbound/outbound bandwidth30 seconds30 days
Process CountActive processes and threads60 seconds7 days
Load Average1, 5, and 15-minute averages30 seconds30 days

Application Metrics

Odoo-specific monitoring:
MetricDescriptionCollection IntervalRetention
HTTP RequestsRequest rate and response times10 seconds7 days
Database QueriesQuery count and execution time30 seconds7 days
Worker StatusActive, idle, and blocked workers30 seconds7 days
Cache Hit RateRedis cache performance60 seconds7 days
Error RateApplication errors and warningsReal-time30 days
Active UsersConcurrent user sessions60 seconds7 days

Real-Time Monitoring

Live Metrics View

Monitor your server in real-time:
# View live metrics via CLI
deployerp server monitor srv_abc123 --live

# Output
┌─────────────────────────────────────────────┐
 Server: production-eu-1
 Status: Running | Uptime: 45d 12h 30m
├─────────────────────────────────────────────┤
 CPU:    [████████░░░░░░░░░░] 42.5%         │
 Memory: [██████████████░░░░] 73.2% (11.7GB)│
 Disk:   [████████████░░░░░░] 61.0% (195GB) │
 Network: 125 Mbps 45 Mbps
└─────────────────────────────────────────────┘

Metric Visualization

View trends and patterns:
  • Time Series
  • Heatmaps
  • Gauges
Line graphs showing metric changes over time
  • Customizable time ranges
  • Multiple metric overlay
  • Zoom and pan capabilities

Alert Configuration

Creating Alerts

Set up custom alerts for critical metrics:
1

Select Metric

Choose the metric to monitor
2

Define Threshold

Set warning and critical levels
3

Configure Duration

Specify how long before triggering
4

Set Notifications

Choose notification channels

Alert Types

Threshold Alerts

Trigger when metrics exceed limits
cpu_high:
  metric: cpu_usage
  condition: ">"
  threshold: 80
  duration: 5m

Anomaly Alerts

Detect unusual patterns
traffic_spike:
  metric: network_in
  condition: anomaly
  sensitivity: high
  window: 1h

Availability Alerts

Monitor service uptime
service_down:
  check: http_status
  endpoint: /web/health
  expected: 200
  interval: 60s

Composite Alerts

Combine multiple conditions
high_load:
  conditions:
    - cpu_usage > 70
    - memory_usage > 80
    - response_time > 500ms

Common Alert Rules

# High CPU usage
- name: "High CPU Usage"
  metric: system.cpu.usage
  condition: ">"
  threshold: 85
  duration: 5m
  severity: warning

# Memory pressure
- name: "Memory Pressure"
  metric: system.memory.usage
  condition: ">"
  threshold: 90
  duration: 3m
  severity: critical

# Disk space low
- name: "Low Disk Space"
  metric: system.disk.usage
  condition: ">"
  threshold: 85
  duration: 10m
  severity: warning

# Database connections
- name: "Database Connection Pool"
  metric: postgresql.connections.active
  condition: ">"
  threshold: 80
  duration: 2m
  severity: warning

# Response time
- name: "Slow Response Time"
  metric: odoo.http.response_time
  condition: ">"
  threshold: 1000  # milliseconds
  duration: 5m
  severity: warning

Notification Channels

Email Notifications

Configure email alerts:
{
  "channel": "email",
  "addresses": ["[email protected]", "[email protected]"],
  "settings": {
    "include_graphs": true,
    "include_logs": false,
    "batch_window": "5m"
  }
}

Slack Integration

Send alerts to Slack:
{
  "channel": "slack",
  "webhook_url": "https://hooks.slack.com/services/xxx",
  "settings": {
    "channel": "#alerts",
    "username": "deployERP Bot",
    "icon_emoji": ":warning:",
    "mention_users": ["@oncall"]
  }
}

Webhook Notifications

Custom webhook integration:
{
  "channel": "webhook",
  "url": "https://your-app.com/webhooks/alerts",
  "method": "POST",
  "headers": {
    "Authorization": "Bearer YOUR_TOKEN"
  },
  "retry": {
    "attempts": 3,
    "backoff": "exponential"
  }
}

Performance Analysis

Resource Utilization Reports

Generate detailed performance reports:
  • Daily Report
  • Monthly Overview
Daily Performance Summary - 2024-01-15
=====================================

CPU Usage:
- Average: 45.2%
- Peak: 78.5% at 14:30
- 95th percentile: 62.0%

Memory Usage:
- Average: 8.3 GB (51.9%)
- Peak: 12.1 GB (75.6%)
- Swap used: 0 GB

Disk I/O:
- Read: 1.2 TB
- Write: 450 GB
- Average latency: 2.3ms

Network:
- Inbound: 850 GB
- Outbound: 1.1 TB
- Peak throughput: 180 Mbps

Query Performance

Monitor database performance:
-- Top slow queries
SELECT 
  query,
  calls,
  mean_time,
  total_time
FROM pg_stat_statements
ORDER BY mean_time DESC
LIMIT 10;

-- Connection statistics
SELECT 
  datname,
  numbackends,
  xact_commit,
  xact_rollback
FROM pg_stat_database;

Auto-Healing

Automatic Recovery Actions

deployERP automatically responds to common issues:
ConditionAuto-Healing ActionNotification
Service downRestart serviceAlert sent
High memory usageClear caches, restart workersWarning sent
Disk space lowClean logs, temp filesAlert sent
Database locksKill blocking queriesAlert sent
Worker deadlockRestart affected workersWarning sent
Network issuesReset connectionsAlert sent

Configuring Auto-Healing

auto_healing:
  enabled: true
  
  rules:
    - name: "Restart on crash"
      trigger: service_down
      action: restart_service
      max_attempts: 3
      cooldown: 5m
    
    - name: "Memory cleanup"
      trigger: memory_usage > 85%
      actions:
        - clear_cache
        - restart_workers
      cooldown: 15m
    
    - name: "Disk cleanup"
      trigger: disk_usage > 80%
      actions:
        - rotate_logs
        - clean_temp_files
      cooldown: 1h

Log Management

Log Collection

Centralized log collection:
Log TypeLocationRetentionSearchable
Odoo logs/var/log/odoo/30 daysYes
PostgreSQL logs/var/log/postgresql/30 daysYes
Nginx logs/var/log/nginx/7 daysYes
System logs/var/log/syslog7 daysYes
deployERP agent/var/log/deployerp/30 daysYes

Log Analysis

Search and analyze logs:
# Search Odoo logs
deployerp logs search --instance=production --query="ERROR" --last=1h

# Tail logs in real-time
deployerp logs tail --instance=production --filter="sale.order"

# Export logs
deployerp logs export --instance=production --from=2024-01-01 --to=2024-01-15

Custom Metrics

Defining Custom Metrics

Create business-specific metrics:
# Custom metric example
{
  "name": "daily_orders",
  "type": "gauge",
  "query": "SELECT COUNT(*) FROM sale_order WHERE date >= CURRENT_DATE",
  "interval": "5m",
  "labels": {
    "app": "odoo",
    "module": "sales"
  }
}

Metric Export

Export metrics to external systems:

Prometheus

prometheus:
  enabled: true
  port: 9090
  path: /metrics

Datadog

datadog:
  enabled: true
  api_key: "YOUR_KEY"
  site: "datadoghq.com"

New Relic

newrelic:
  enabled: true
  license_key: "YOUR_KEY"

CloudWatch

cloudwatch:
  enabled: true
  region: "us-east-1"
  namespace: "deployERP"

Monitoring Best Practices

  • Base thresholds on historical data
  • Consider business hours vs off-hours
  • Account for seasonal variations
  • Review and adjust regularly
  • Prioritize critical alerts
  • Use appropriate severity levels
  • Implement alert suppression
  • Group related alerts
  • Track application-specific KPIs
  • Monitor user experience metrics
  • Correlate technical and business metrics
  • Create custom dashboards
  • Weekly performance reviews
  • Monthly capacity planning
  • Quarterly optimization assessments
  • Annual architecture reviews

Troubleshooting

Common Monitoring Issues

IssueCauseSolution
Missing metricsAgent downRestart deployERP agent
Delayed alertsNetwork issuesCheck connectivity
False positivesIncorrect thresholdsAdjust alert rules
High cardinalityToo many labelsReduce metric labels

Monitoring Commands

# Check agent status
systemctl status deployerp-agent

# Test metric collection
deployerp-agent test

# Verify connectivity
deployerp-agent ping

# Debug mode
deployerp-agent run --debug