The Silent Failure
Difficulty: MEDIUMID: obs-tracing-001
The Scenario
User reports: "I clicked 'Generate' and nothing happened."
Your API logs show: 200 OK.
The error happened deep in a microservice chain: API -> Orchestrator -> VectorDB -> LLM.
Without tracing, you have no idea which service failed or why.
The Problem
Your services swallow exceptions and return generic messages.
try:
call_downstream()
except Exception:
return None # The error is lost forever
The Goal
Implement Trace ID Propagation:
- Accept a
trace_idfrom the upstream caller. - Log the
trace_idwith every error message. - Pass the
trace_idto the downstream service.
Requirements:
- Function
process_request(trace_id) - Log errors using
print(f"[ERROR] [{trace_id}] ...") - Pass
trace_idtocall_service_b(trace_id)
solution.py
Loading...
⚠️ Do not include PII or secrets in your code.
SYSTEM_LOGS
5/5
// Waiting for execution trigger...