How ai-portfolio-study-org/grafana_monitor works
Project type and purpose
• This is a real-time anomaly-detection and monitoring pipeline built as a Docker-Compose–orchestrated microservices system. It uses Kafka for event ingestion, Spark for streaming analytics, Airflow for orchestration, FastAPI as a metrics/API service, and Prometheus + Grafana for observability.
File structure
• Top-level services (via docker-compose.yml):
• backend/ – FastAPI service (server.py + metric endpoints)
• dags/ – Airflow DAG definitions (model_training.py)
• kafka/ – Kafka broker config & JMX exporter
• spark/ – Spark jobs (anomaly_detection.py, kafka_test.py) + JMX exporter
• prometheus/ – Prometheus scrape configuration
• grafana/ – Grafana dashboards + datasource provisioning
• graph/ – Graph-neural-network model code (dataset.py, gnn_model.py)
• send_transactions.py – synthetic transaction producer
• Key patterns: stream-processing (Spark), pub/sub (Kafka), orchestration (Airflow), service/API layer (FastAPI), monitoring (Prometheus/Grafana).
README for additional insights
• Confirms full pipeline:
• Real-time transaction ingestion → Spark streaming anomaly detection → metric emission → API serving & monitoring
• Periodic offline evaluation / model retraining via Airflow → metrics POSTed to FastAPI → Prometheus updates → Grafana dashboards