Concept
Observability is not a dependency list. It is the ability to answer a question after something goes wrong. Phase 6 makes request identity, status, timing, cache behavior, and database path visible enough to reconstruct an incident.
Task
- Expose health and info publicly, and keep Prometheus available only to authenticated scrapes.
- Add ECS structured logging and a correlation-ID filter backed by MDC.
- Add a Caffeine-backed showtime read path and a custom hit/miss metric.
- Prove eviction after writes with a Testcontainers-backed test.
- Write two transcripts that start from debugging questions.
Run
./gradlew test --tests "*CorrelationIdFilterTest"./gradlew test --tests "*DemoReadOnlyProfileTest"./gradlew dockerTest --tests "*ShowtimeObservabilityTest"Expected Result
- The Prometheus endpoint contains `palabas_showtime_lookups_total`.
- The transcripts can locate status, endpoint, timing, and cache result without reading source code.
Common Traps
- Adding Actuator and calling that observability.
- Logging request IDs without returning them to the caller.
- Caching reads without naming the write path that invalidates them.
Hint Ladder
Hint 1
Start from the incident question, then choose the metric or log field.
Hint 2
MDC only matters if the log format includes it.
Hint 3
A cache test should prove both hit/miss behavior and eviction.
Solution
See observability-notes.md and ShowtimeObservabilityTest.java.
Boot 3 to 4 Delta
Boot 4 keeps Actuator and Micrometer familiar while adding first-class structured logging settings. The course uses that native logging path instead of adding a logging framework detour.