Skip to content

Latest commit

 

History

History
41 lines (21 loc) · 1.79 KB

File metadata and controls

41 lines (21 loc) · 1.79 KB

🎤 Interview Q&A - Lab 21: Structured Logging and Correlation IDs

1. What is structured logging?

Answer: Structured logging records events in a consistent machine-readable format, such as JSON, instead of plain free-form text.

2. Why are correlation IDs important?

Answer: Correlation IDs let you tie related events together across multiple services and follow one request from start to finish.

3. What did the main service do in this lab?

Answer: The main service handled the order workflow, generated or accepted a correlation ID, and forwarded it to the downstream service.

4. What was the role of the downstream service?

Answer: It simulated an upstream dependency by handling an inventory check and logging events with the same correlation ID.

5. How was the correlation ID propagated?

Answer: It was read from the incoming request or generated locally, stored in request context, and sent onward through the X-Correlation-ID header.

6. Why use JSON logs instead of plain text logs?

Answer: JSON logs are easier to search, parse, group, and analyze in automation or centralized logging systems.

7. What did analyze_logs.py do?

Answer: It grouped combined logs by correlation ID and reconstructed request flow across both services.

8. How did you verify propagation worked?

Answer: I checked that both service logs showed the same correlation ID for the same end-to-end request flow.

9. What production problem does this lab address?

Answer: It addresses the difficulty of troubleshooting distributed applications when related log events are spread across services.

10. What was the final result of the lab?

Answer: The final result was a traceable two-service logging workflow with structured logs and analyzable request correlation.