Book 4 · Lesson 4.9
Structured logging
- Configure RUST_LOG for ingestion and analyzer
- Correlate logs by event_id
- Use tracing levels for ops vs errors
Prerequisites: 4.7
Both services use tracing + tracing-subscriber:
RUST_LOG=millipede_ingestion=info,millipede_analyzer=info cargo run -p millipede-ingestion
TracingSpanTimeline — follow one event_id across services.
Structured fields
info!(event_id = %event_id, topic = %topic, "published event");
Enables grep/OTel export in Stage 5.
Teach-back prompt
What log line tells you Kafka was down but webhook still accepted?
Trace webhook logs
Lab complete — nice work.