← Table of Contents · Page 295 of 868
TRACING AND SPANS
Part 9 of 10
ARTIFICIAL INTELLIGENCE ASSISTANT PROMPTS
[START OF PROMPT]
Analyze this trace (list of spans with timing and status) and identify the latency bottleneck span(s) and any span with an elevated error rate: [PASTE LAB OR PRODUCTION TRACE DATA HERE]. Output format: a ranked list of spans by time contribution, plus a one-sentence root-cause hypothesis for the slowest or most error-prone span.
[END OF PROMPT]
[START OF PROMPT]
Review this tracing/span-instrumentation code for missing fields (span identifier (ID), parent span ID, start/end time, input, output, status, error message) that a production-quality tracing system needs: [PASTE LAB TRACING CODE HERE]. For each missing field, state the specific debugging scenario it would make harder to diagnose without it. Output format: a gap table (Field, Present? Y/N, Debugging Scenario Affected).
[END OF PROMPT]
CHAPTER SUMMARY
A span records one unit of work, and a trace is the full chain of spans for one request.
Parent and child identifiers let spans form a tree.
Each span should record identifiers, timing, input, output, status, and errors.
Traces quickly reveal bottlenecks and failures, while privacy must be protected.
KEY TERMS REVIEW
Span: a record of one unit of work.
Trace: the chain of spans for one request.
Parent span: a span that contains other spans.
Step-level tracing: recording every step of the agent's work.
Bottleneck: the step that limits overall speed.
Advertisement
Read Aloud:
0:00 / 0:00