Overview

Last updated: April 11, 2026

Monitor Module Overview

The monitor package provides internal infrastructure monitoring and health checks for the dLANDiscord ecosystem.

Key Features

  • Protocol Support: Supports monitoring via HTTP(S), ICMP (Ping), TCP, and specialized game protocols (e.g., Pelican).
  • Alert Management: Aggregates and debounces alerts before routing them to agents or notification channels.
  • Database Integration: Stores monitoring targets and historical uptime data in a dedicated database.
  • Dashboard API: Provides data for the infrastructure tabs in Mission Control.

Key Files & Directories

  • monitor/monitor.go: The central monitoring engine.
  • monitor/internal/config/: Configuration management for monitoring targets.
  • monitor/internal/monitor/: Implementations of different monitoring protocols.
  • monitor/internal/handlers/: API handlers for monitoring data.

Integration Flow

  1. Polling: The monitoring engine periodically checks the status of all configured targets.
  2. State Change: If a target's status changes (e.g., Up → Down), an alert is generated.
  3. Debouncing: Related alerts are grouped to prevent notification storms.
  4. Notification: Alerts are sent to the assistant module or directly to notification channels (WhatsApp/Discord).

Mermaid Diagram: Monitoring Flow

graph TD
    M[Monitor Engine] --> P[Protocol: HTTP/Ping/TCP]
    P --> T[Target: e.g. Gadgetzan]
    T -- Status --> M
    M --> D{Status Changed?}
    D -- Yes --> A[Generate Alert]
    A --> DB[Debounce Logic]
    DB --> N[Notify User / Agent]

Guidance for AI Agents

  • Infrastructure Context: Use the infra_status tools to get real-time data from the monitor module during troubleshooting tasks.
  • Alert Investigation: When an alert is received, use the sysadmin or sasha agents to perform an automated investigation of the affected server.

Cross-References