Code Review & Debugging5.0 · 0 ratings

Microservice Distributed Failure Debug

Diagnoses failures that span services, focusing on timeouts, retries, idempotency, and partial-failure consistency.

Role-Based

Prompt

ROLE: You are a distributed-systems debugger tracing a failure across service boundaries.

CONTEXT: A request flows through services [LIST_SERVICES] and fails or behaves inconsistently. Symptom: [DUPLICATE_SIDE_EFFECTS / TIMEOUTS / DATA_INCONSISTENCY / CASCADING_FAILURE]. Communication is via [HTTP/gRPC/QUEUE/EVENTS]. Traces/logs available: [DESCRIBE].

EVIDENCE / CODE:
[PASTE_TRACES_LOGS_AND_RELEVANT_CODE]

TASK (reason across boundaries):
1. Reconstruct the request path and identify where the failure originates versus where it surfaces.
2. Examine timeout and retry configuration along the chain for misalignment (e.g. caller times out before callee finishes, retries multiplying load).
3. Check idempotency of retried operations and whether duplicate processing causes the symptom (double charges, duplicate records).
4. Assess partial-failure consistency: are cross-service writes saga/compensation-protected, or can they leave split state?
5. Recommend fixes: aligned timeouts, idempotency keys, bounded retries with backoff, circuit breakers, and outbox/saga patterns where needed.

OUTPUT FORMAT:
- 'Request path + failure point'.
- 'Timeout/retry analysis' (service | timeout | retry | problem).
- 'Idempotency/consistency gaps'.
- 'Recommended fixes' (prioritized, with the pattern named).

CONSTRAINTS: Ensure timeouts decrease inward along the call chain and retries are idempotent. Do not recommend retries without an idempotency guarantee. Anchor each conclusion to a trace or log line where possible.

How to use this prompt

  1. 1

    Copy the prompt above and paste it into ChatGPT, Claude, or Gemini — or open it in the visual Studio to edit each part on a canvas and run it with your own key.

  2. 2

    Replace any bracketed placeholders with your specifics. The more concrete your context and constraints, the sharper the result — see the 5-part prompt structure.

  3. 3

    Run it, then refine. Ask the model to critique and improve its own answer with self-critique prompting.

Techniques in this prompt

Role-Based

Assigns the model an expert persona so it adopts the right vocabulary, depth, and standards for the task.

Learn this technique

Recommended models

claudegpt-4ogemini

Build on this prompt

Open it in the visual Studio to wire it into a full workflow with your own API key — or learn the craft behind prompts like this.

More in Code Review & Debugging