How grafana/oncall works
Overall Structure and Key Components
• Frontend/Integration with Grafana:
– Show a “Grafana Plugin” component (under grafana-plugin) that runs inside Grafana.
– It communicates with the on‑call engine through secure REST API calls and serves as the UI for end‑users.
• Backend – OnCall Engine:
– Highlight that the engine includes a “manage.py” entry point for administrative and migration tasks.
• Background Processing:
– Include a separate component representing “Celery Workers” that handle asynchronous tasks such as sending notifications, processing alerts, and executing periodic jobs.
– Show the communication between the Engine and the Celery Task Queue.
• Data Storage:
– Represent a “Database” (or multiple persistence stores) that stores alert data, on‑call schedules, user settings, and migration history. This is typically configured as part of the Docker Compose/Helm setup.
• Deployment and Orchestration:
– Incorporate deployment artifacts like Docker Compose (docker-compose.yml), Helm charts (helm/), and Terraform (terraform/) that orchestrate containers and services.
• External Integration Services:
– Indicate that the engine’s “config_integrations” and various “apps” (like apps/slack, apps/email, etc.) interface with these external systems.
• CI/CD and Developer Tools (Optional):
– Mention the “tools/migrators” and “tools/scripts,” which assist with data migration and administrative tasks.
Depicting Relationships and Data Flow
– From end‑users interacting via Grafana (and its plugin) to the OnCall Engine’s API.
– Between the engine’s API endpoint and the Celery Workers for scheduling and heavy‐weight tasks.
– From the engine to external integration services to send notifications (via HTTP, SMS gateway, or telephony APIs).
– From the engine to the database for data persistence.
Architectural Patterns & Design Principles
• Modularization: The engine is partitioned into “apps” (e.g., alerts, api, integrations, user management, schedules) – show these as modular building blocks.
• Separation of concerns: Clearly separate the UI (Grafana Plugin), API/backend (Engine), asynchronous processing (Celery), and infrastructure/deployment (Docker, Helm, Terraform).
• Integration and Extensibility: Highlight how third‑party integrations and notification channels are isolated via dedicated modules and config files.