Back to docs

Recipe: Stack trace diagnoser

Build a self-serve tool that ingests a raw stack trace and returns actionable root-cause hypotheses — no human triage required.

Ingredients

  • Raw stack trace text (copy-paste from any log source)
  • Symbol map or PDB-derived function-name index
  • Error-signature corpus (known crash fingerprints)
  • LLM prompt template tuned for triage classification

Steps

  1. Parse the trace — extract module names, offsets, and exception codes via regex.
  2. Resolve symbols — map each offset to the closest known function using the symbol index.
  3. Fingerprint — hash the resolved call chain and compare against the error-signature corpus.
  4. Classify — feed the trace, resolved symbols, and closest fingerprint matches into the LLM prompt. Request a structured JSON response with root-cause category, confidence score, and suggested remediation.
  5. Render — display the hypothesis card with expandable raw trace, symbol mapping, and a one-click copy for the engineering team.

Pro tips

  • Cache symbol resolutions in a local SQLite DB to keep latency under 200 ms.
  • Strip PII and hostnames from traces before sending to any external LLM endpoint.
  • Maintain a feedback loop — let engineers mark hypotheses as correct/incorrect to retrain the fingerprint corpus.