PHP Classes

File: config/monitoring.example.php

Recommend this page to a friend!
  Packages of Adrian M   PHP CRUD API Generator   config/monitoring.example.php   Download  
File: config/monitoring.example.php
Role: Auxiliary script
Content type: text/plain
Description: Configuration script
Class: PHP CRUD API Generator
Create an API to access MySQL database record
Author: By
Last change: up
Date: 11 months ago
Size: 1,485 bytes
 

 

Contents

Class file image Download

    // ========================================
    // MONITORING CONFIGURATION
    // ========================================
    'monitoring' => [
        'enabled' => true,                          // Enable/disable monitoring
        'metrics_dir' => __DIR__ . '/../storage/metrics', // Metrics storage directory
        'alerts_dir' => __DIR__ . '/../storage/alerts',   // Alerts storage directory
        'retention_days' => 30,                     // Keep metrics for X days
        'check_interval' => 60,                     // Health check interval (seconds)
        
        // Alert thresholds
        'thresholds' => [
            'error_rate' => 5.0,                   // Alert if error rate > 5%
            'response_time' => 1000,               // Alert if response time > 1000ms
            'rate_limit' => 90,                    // Alert if rate limit usage > 90%
            'auth_failures' => 10,                 // Alert if > 10 auth failures per minute
        ],
        
        // Alert handlers (callables that receive alert data)
        'alert_handlers' => [
            // Example: function($alert) { error_log("ALERT: " . $alert['message']); }
            // Example: function($alert) { mail('admin@example.com', 'API Alert', $alert['message']); }
            // Example: function($alert) { /* Send to Slack/Discord webhook */ }
        ],
        
        // Collect system metrics (CPU, memory, disk)
        'collect_system_metrics' => true,
    ],