Week 3: Logging — Loki + ELK Stack

Theme: Centralized logging with Loki (cloud-native) and ELK (traditional).

Learning Objectives

  1. Deploy Loki + Promtail + Grafana (LPG stack) using helm
  2. Write structured JSON logs from Go and Python apps
  3. Query logs with LogQL
  4. Understand ELK stack architecture (Elasticsearch, Logstash, Kibana)

Reading Materials

Finger Exercises (choose 2)

  1. Update the Go app to use slog with structured JSON output. Include request_id, user_id, latency, endpoint.
  2. Write 5 LogQL queries on your own logs: line contains "error", rate of errors per minute, top 3 slowest endpoints.
  3. Deploy ELK stack (using docker-compose from elastic) and ship logs from the Python worker.

Project

Time Budget

ActivityTime
Reading1.5 hrs
Finger exercises2 hrs
Project2.5 hrs
Total6 hrs