import { Icon } from '../shared/Icon'; const METRICS = [ { name: 'booking_status_update_rate', type: 'Counter', description: 'Number of booking status updates per minute', alert: '> 500/min sustained → investigate traffic spike', source: 'fnUpdateBookingStatus middleware', }, { name: 'optimistic_lock_failure_rate', type: 'Counter', description: 'Number of modifiedCount: 0 responses', alert: '> 5% of total updates → investigate concurrent access patterns', source: 'Trip.updateOne with booking_status guard', }, { name: 'bullmq_job_processing_time', type: 'Histogram', description: 'Time from job scheduled to job completed', alert: 'p99 > 30s → check Redis latency and worker health', source: 'BullMQ worker event listeners', }, { name: 'bullmq_queue_depth', type: 'Gauge', description: 'Number of waiting jobs in booking-trips queue', alert: '> 100 waiting → workers may be stuck or undersized', source: 'BullMQ queue.getWaitingCount()', }, { name: 'notification_delivery_failures', type: 'Counter', description: 'Failed push notification sends', alert: '> 10% failure rate → check FCM/APNS credentials', source: 'sendBookingNotificationWithConfig .catch()', }, { name: 'dac_pubsub_publish_failures', type: 'Counter', description: 'Failed DAC Pub/Sub publishes', alert: 'Any sustained failures → check GCP Pub/Sub health', source: 'publishScheduledRideDacMW', }, ]; const DASHBOARD_PANELS = [ 'Booking status distribution (pie chart: terminal vs active)', 'Update rate over time (time series: last 24h)', 'Optimistic lock failure ratio (single stat + trend)', 'BullMQ queue depth and processing rate (dual axis)', 'Notification delivery success rate (gauge)', 'Top error codes by frequency (bar chart)', ]; export function MonitoringAlertingSection() { return (
{m.name}
{m.type}
{m.description}