Instrument A RAG Trace
Design a minimal trace for a RAG answer that supports incident diagnosis.
A RAG assistant cites an old policy, but the only trace span is POST /chat. The team cannot tell whether retrieval, prompt assembly, model generation, or policy checks failed. Instrument the answer path as a sequence of named spans with stable attributes. The common shortcut is to log raw prompts and final answers while skipping retrieval and policy metadata. That creates privacy risk and still leaves diagnosis weak. Before Single span: POST /chat, 4.8s, status=200. Raw log: 'answered policy question.' No prompt version, retrieval collection, document freshness, model route, or policy decision. After Trace spans: build_prompt, retrieve_docs, rerank_docs, generate_answer, policy_check.…
Sign up free — one personalized lesson every day, matched to your role and goals.
Already have an account? Sign in