← Table of Contents · Page 289 of 868

TRACING AND SPANS

Part 3 of 10

NAMING AND CONNECTING SPANS Good names make traces readable. Name spans after what they do, such as model_call or tool_call, and put the specific detail in attributes, such as tool_name equals search_web. Use the same names every time so that you can search and count them. Pass the identifier of the trace down through every step, including calls to other services and to other agents, so that the pieces join into one picture. When this connection is missing, you end up with many small traces that nobody can piece together. An open standard called OpenTelemetry describes common ways to produce and carry this kind of data, and many tools understand it, which makes it easier to switch viewers later. SAMPLING AND COST Recording every detail of every run can be expensive in storage and in money. Sampling means keeping the full detail for only some runs. A sensible plan keeps full traces for every failed run and every slow run, and for a small random share of the successful ones. This keeps the interesting cases while controlling cost. Be careful that the sample is not biased, because looking only at failures can hide how often things go right.
Advertisement
Read Aloud:
0:00 / 0:00