How rishabhdas/events-app-opentelemetry works
Project Type and Purpose
• This is a full-stack events application designed as a Proof-of-Concept (POC) for OpenTelemetry integration.
• The project demonstrates how a Python-based events app can use distributed tracing (via OpenTelemetry) to monitor inter-component calls.
• The application consists of:
• A Flask-based Frontend (user interface) rendering HTML.
• A FastAPI-based Backend that exposes REST APIs.
• A PostgreSQL datastore to hold event and participant data.
• Integration with Jaeger for visualizing telemetry data.
Analyzing the File Structure
• Top-level directories and files:
• “frontend” directory: Contains the Flask application, Dockerfile, requirements and HTML templates.
• “backend” directory: Contains the FastAPI application, Dockerfile, and dependencies.
• Root-level files like Docker Compose, Makefile, and bootstrap.py indicate container orchestration and easy spin-up of the entire environment.
• The presence of separate Dockerfiles for frontend and backend and a unified docker-compose.yaml file suggests a containerized environment where each component runs in its own container.
Key Components to Capture
a. Frontend:
• Handles UI rendering and user requests.
• Technologies: Flask, HTML templates.
b. Backend:
• Serves API calls, processes requests, and fetches data.
• Technologies: FastAPI, Python.
c. Datastore:
• Stores events and participants information.
d. Observability:
• OpenTelemetry instrumentation captures and traces calls between components, with traces visualized on the Jaeger dashboard.
e. Infrastructure/Orchestration:
• Containers: Use of Docker (each component containerized) and docker-compose to orchestrate services.
• Build/config: Makefile, bootstrap.py indicate simplified deployment and initialization.
Mapping Relationships and Data Flow
• User / Browser → Frontend: representing HTTP requests.
• Frontend → Backend: API calls from Flask to FastAPI endpoints.
• Backend → PostgreSQL: Data queries and transactions.
• Backend → OpenTelemetry: Tracing instrumentation gathering and sending telemetry data.
• OpenTelemetry → Jaeger: Flow of trace data for monitoring.
• That the telemetry collecting mechanism spans across the Frontend, Backend, and Database interactions.
Highlighting Architectural Patterns and Design Principles
• Separation of Concerns: Clear division between presentation (Frontend), business logic (Backend), and data (PostgreSQL).
• Containerization: Illustrate that each major component (Frontend, Backend, Database, and possibly Jaeger) runs in its own Docker container.
• Observability: Integration of tracing for end-to-end monitoring.