Skip to main content
This lesson uses the small demo application “KodeKloud Record Store Web App” to demonstrate observability, distributed tracing, metrics, and how distributed components interact. The full repository is available on GitHub: jaked-page91/kodekloud-records-store-web-app. Fork it to experiment with code, compose configurations, and observability settings.
A screenshot of a GitHub repository page for "kodekloud-records-store-web-app" showing the file and folder list, branches, and recent commits. The right sidebar displays the repo's About section, releases, and package/deployment info.
The repository README includes a concise introduction and an architecture overview — this is intentionally a small, extendable demo you can treat as a playground for instrumentation and observability experiments.
A dark-themed README/documentation page for "KodeKloud Records Store" showing an overview and architecture sections. It lists goals and bullet points about observability, monitoring, distributed tracing, and application components.

Overview and architecture

Key components:
  • FastAPI web service: handles HTTP requests and serves the API.
  • Celery workers: handle background processing with RabbitMQ as the broker.
  • PostgreSQL: persistent storage for products, orders, and other state.
  • Observability stack: Prometheus, Grafana, Jaeger, Loki, Fluent Bit, Pushgateway, Blackbox Exporter, and Alertmanager collect metrics, logs, and traces.
The diagram below shows the main components and their interactions.
A dark-themed system architecture diagram showing an observability stack and a Kodekloud records store. It labels components like Blackbox Exporter, FastAPI web service, RabbitMQ, Celery worker, Prometheus and PostgreSQL with arrows indicating data flows.

Request flow (how requests propagate and where signals are produced)

  • Read-only requests (example: GET /products) are handled fully by the FastAPI app querying PostgreSQL.
  • Stateful/business requests (example: POST /checkout) create orders and emit background tasks to RabbitMQ. Celery workers then process payments, update inventory, and persist results back to PostgreSQL.
  • Traces, logs, and metrics are exported so you can follow end-to-end request paths in Jaeger, correlate logs in Loki, and inspect metrics in Prometheus/Grafana.
The sequence diagram below illustrates these interactions and where observability signals are generated for different endpoints.
A dark-themed sequence diagram titled "Request Flow" showing lanes for Client, FastAPI App, Database, RabbitMQ, and Celery Worker. It diagrams GET /products and POST /checkout interactions (query products, create order, queue background task, process payment/inventory) with notes about Jaeger/Loki tracing and Prometheus metrics.

Project structure (simplified)

Below is a simplified tree of the files and directories you’ll interact with in the course:

Get started (local development)

  1. Clone the repository and prepare a development environment file:
Example: deploy/environments/.env.dev
  1. Start the full stack with Docker Compose using the .env.dev file:
  1. Verify containers are running:
  1. Test key endpoints and generate traces/metrics:

Available services (default ports and access)

Inspecting Prometheus and Jaeger

After the stack is up, verify metrics and traces in the Prometheus and Jaeger UIs.
A screenshot of the Prometheus web UI (localhost:9090) showing the Query page with an empty expression input, an "Execute" button, and the message "No data queried yet." The interface also shows tabs for Table/Graph/Explain and a visible "Add query" button.
A screenshot of the Jaeger UI search page with a left-side search form. On the right is a large cartoon blue gopher wearing a green hat peeking up from the bottom of the screen.

Docker Compose highlights

The repository provides a single docker-compose.yaml describing the application and the observability stack. The api service reads many values via environment variables from the external .env.* file. Example excerpt showing environment injection:
Other compose services include: worker (Celery), db (Postgres), rabbitmq, prometheus, pushgateway, grafana, alertmanager, jaeger, loki, fluent-bit, and blackbox_exporter. The repository already contains Prometheus scrape configs, Grafana provisioning, Loki/fluent-bit logging pipelines, and alert rules to explore.

Testing and demo scripts

Use included helper scripts to generate traffic, produce log lines, and run synthetic probes:

Common troubleshooting and tips

  • If ports conflict, check listeners with netstat -tuln or ss -tuln and update the .env.* files accordingly.
  • Verify container health with docker-compose ps and inspect logs with docker logs <container>.
  • Confirm Prometheus scrape targets: http://localhost:9090/api/v1/targets
  • Verify application metrics are exported:
When deploying to staging or production, copy a template from deploy/environments/templates/, replace sensitive values via CI/CD secrets, and run docker-compose with the chosen .env.* file. Use environment-specific OTEL and Prometheus settings to avoid sending dev telemetry to production systems.

Final notes

This lesson provides the repository and step-by-step instructions so you can explore the app and its observability stack at your own pace. Subsequent modules dive deeper into each component (Prometheus, Grafana, Jaeger, Loki, Fluent Bit), show how to instrument code with OpenTelemetry, create meaningful alerts and dashboards, and correlate traces, logs, and metrics for effective incident analysis. For more on the tools used:

Watch Video