<liclass="toctree-l2"><aclass="reference internal"href="../../concepts/llm_providers/supported_providers.html">Supported Providers & Configuration</a></li>
<spanid="plano-overview-tracing"></span><h1>Tracing<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#tracing"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h1>
<h2>Overview<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#overview"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#overview'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h2>
<codeclass="docutils literal notranslate"><spanclass="pre">traceparent</span></code> header. This allows each component in the system to record its part of the request
<h2>Understanding Plano Traces<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#understanding-plano-traces"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#understanding-plano-traces'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h2>
<p>Plano creates structured traces that capture the complete flow of requests through your AI system. Each trace consists of multiple spans representing different stages of processing.</p>
<sectionid="inbound-request-handling">
<h3>Inbound Request Handling<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#inbound-request-handling"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#inbound-request-handling'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h3>
<p>When a request enters Plano, it creates an <strong>inbound span</strong> (<codeclass="docutils literal notranslate"><spanclass="pre">plano(inbound)</span></code>) that represents the initial request reception and processing. This span captures:</p>
<li><p>Initial validation and authentication</p></li>
</ul>
</section>
<sectionid="orchestration-routing">
<h3>Orchestration & Routing<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#orchestration-routing"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#orchestration-routing'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h3>
<p>For agent systems, Plano performs intelligent routing through orchestration spans:</p>
<ulclass="simple">
<li><p><strong>Agent Orchestration</strong> (<codeclass="docutils literal notranslate"><spanclass="pre">plano(orchestrator)</span></code>): When multiple agents are available, Plano uses an LLM to analyze the user’s intent and select the most appropriate agent. This span captures the orchestration decision-making process.</p></li>
<li><p><strong>LLM Routing</strong> (<codeclass="docutils literal notranslate"><spanclass="pre">plano(routing)</span></code>): For direct LLM requests, Plano determines the optimal endpoint based on your routing strategy (round-robin, least-latency, cost-optimized). This span includes:</p>
<h3>Agent Processing<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#agent-processing"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#agent-processing'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h3>
<p>When requests are routed to agents, Plano creates spans for agent execution:</p>
<ulclass="simple">
<li><p><strong>Agent Filter Chains</strong> (<codeclass="docutils literal notranslate"><spanclass="pre">plano(filter)</span></code>): If filters are configured (guardrails, context enrichment, query rewriting), each filter execution is captured in its own span, showing the transformation pipeline.</p></li>
<li><p><strong>Agent Execution</strong> (<codeclass="docutils literal notranslate"><spanclass="pre">plano(agent)</span></code>): The main agent processing span that captures the agent’s work, including any tools invoked and intermediate reasoning steps.</p></li>
</ul>
</section>
<sectionid="outbound-llm-calls">
<h3>Outbound LLM Calls<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#outbound-llm-calls"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#outbound-llm-calls'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h3>
<p>All LLM calls—whether from Plano’s routing layer or from agents—are traced with <strong>LLM spans</strong> (<codeclass="docutils literal notranslate"><spanclass="pre">plano(llm)</span></code>) that capture:</p>
<ulclass="simple">
<li><p>Model name and provider (e.g., <codeclass="docutils literal notranslate"><spanclass="pre">gpt-4</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">claude-3-sonnet</span></code>)</p></li>
<h3>Handoff to Upstream Services<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#handoff-to-upstream-services"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#handoff-to-upstream-services'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h3>
<p>When Plano forwards requests to upstream services (agents, APIs, or LLM providers), it creates <strong>handoff spans</strong> (<codeclass="docutils literal notranslate"><spanclass="pre">plano(handoff)</span></code>) that capture:</p>
<ulclass="simple">
<li><p>Upstream endpoint URL</p></li>
<li><p>Request/response sizes</p></li>
<li><p>HTTP status codes</p></li>
<li><p>Upstream response times</p></li>
</ul>
<p>This creates a complete end-to-end trace showing the full request lifecycle through all system components.</p>
</section>
</section>
<sectionid="behavioral-signals-in-traces">
<h2>Behavioral Signals in Traces<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#behavioral-signals-in-traces"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#behavioral-signals-in-traces'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h2>
<p>Plano automatically enriches OpenTelemetry traces with <aclass="reference internal"href="../../concepts/signals.html"><spanclass="doc">Signals™</span></a> — behavioral quality indicators computed from conversation patterns. These signals are attached as span attributes, providing immediate visibility into interaction quality.</p>
<p><strong>What Signals Provide</strong></p>
<p>Signals act as early warning indicators embedded in your traces:</p>
<p>When concerning signals are detected (frustration, looping, escalation, or poor/severe quality), Plano automatically appends a flag marker <strong>🚩</strong> to the span’s operation name. This makes problematic traces immediately visible in your tracing UI without requiring additional queries.</p>
<p><strong>Example Span with Signals</strong>:</p>
<p>For complete details on all available signals, detection methods, and best practices, see the <aclass="reference internal"href="../../concepts/signals.html"><spanclass="doc">Signals™</span></a> guide.</p>
<h2>Custom Span Attributes<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#custom-span-attributes"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#custom-span-attributes'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h2>
<p>Plano can automatically attach <strong>custom span attributes</strong> derived from request headers and <strong>static</strong> attributes
defined in configuration. This lets you stamp
traces with identifiers like workspace, tenant, or user IDs without changing application code or adding
custom instrumentation.</p>
<p><strong>Why This Is Useful</strong></p>
<ulclass="simple">
<li><p><strong>Tenant-aware debugging</strong>: Filter traces by <codeclass="docutils literal notranslate"><spanclass="pre">workspace.id</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">tenant.id</span></code>.</p></li>
<li><p><strong>Customer-specific visibility</strong>: Attribute performance or errors to a specific customer.</p></li>
<li><p><strong>Low overhead</strong>: No code changes in agents or clients—just headers.</p></li>
</ul>
<sectionid="how-it-works">
<h3>How It Works<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#how-it-works"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#how-it-works'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h3>
<p>You configure one or more header prefixes. Any incoming HTTP header whose name starts with one of these
prefixes is captured as a span attribute. You can also provide static attributes that are always injected.</p>
<ulclass="simple">
<li><p>The <strong>prefix is only for matching</strong>, not the resulting attribute key.</p></li>
<li><p>The attribute key is the header name <strong>with the prefix removed</strong>, then hyphens converted to dots.</p></li>
</ul>
<divclass="admonition note">
<pclass="admonition-title">Note</p>
<p>Custom span attributes are attached to LLM spans when handling <codeclass="docutils literal notranslate"><spanclass="pre">/v1/...</span></code> requests via <codeclass="docutils literal notranslate"><spanclass="pre">llm_chat</span></code>. For orchestrator requests to <codeclass="docutils literal notranslate"><spanclass="pre">/agents/...</span></code>,
these attributes are added to both the orchestrator selection span and to each agent span created by <codeclass="docutils literal notranslate"><spanclass="pre">agent_chat</span></code>.</p>
<h3>Configuration<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#configuration"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#configuration'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h3>
<p>Add the prefix list under <codeclass="docutils literal notranslate"><spanclass="pre">tracing</span></code> in your config:</p>
<h3>Notes and Examples<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#notes-and-examples"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#notes-and-examples'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h3>
<ulclass="simple">
<li><p><strong>Prefix must match exactly</strong>: <codeclass="docutils literal notranslate"><spanclass="pre">katanemo-</span></code> does not match <codeclass="docutils literal notranslate"><spanclass="pre">x-katanemo-</span></code> headers.</p></li>
<li><p><strong>Trailing dash is recommended</strong>: Without it, <codeclass="docutils literal notranslate"><spanclass="pre">x-katanemo</span></code> would also match <codeclass="docutils literal notranslate"><spanclass="pre">x-katanemo-foo</span></code> and
<h2>Benefits of Using <codeclass="docutils literal notranslate"><spanclass="pre">Traceparent</span></code> Headers<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#benefits-of-using-traceparent-headers"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#benefits-of-using-traceparent-headers'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h2>
<ulclass="simple">
<li><p><strong>Standardization</strong>: The W3C Trace Context standard ensures compatibility across ecosystem tools, allowing
traces to be propagated uniformly through different layers of the system.</p></li>
<li><p><strong>Ease of Integration</strong>: OpenTelemetry’s design allows developers to easily integrate tracing with minimal
changes to their codebase, enabling quick adoption of end-to-end observability.</p></li>
<li><p><strong>Interoperability</strong>: Works seamlessly with popular tracing tools like AWS X-Ray, Datadog, Jaeger, and many others,
making it easy to visualize traces in the tools you’re already usi</p></li>
</ul>
</section>
<sectionid="how-to-initiate-a-trace">
<h2>How to Initiate A Trace<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#how-to-initiate-a-trace"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#how-to-initiate-a-trace'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h2>
<li><p><strong>Enable Tracing Configuration</strong>: Simply add the <codeclass="docutils literal notranslate"><spanclass="pre">random_sampling</span></code> in <codeclass="docutils literal notranslate"><spanclass="pre">tracing</span></code> section to 100`` flag to in the <aclass="reference internal"href="../../concepts/listeners.html#plano-overview-listeners"><spanclass="std std-ref">listener</span></a> config</p></li>
<li><p><strong>Trace Context Propagation</strong>: Plano automatically propagates the <codeclass="docutils literal notranslate"><spanclass="pre">traceparent</span></code> header. When a request is received, Plano will:</p>
<li><p>Generate a new <codeclass="docutils literal notranslate"><spanclass="pre">traceparent</span></code> header if one is not present.</p></li>
<li><p>Extract the trace context from the <codeclass="docutils literal notranslate"><spanclass="pre">traceparent</span></code> header if it exists.</p></li>
<li><p>Start a new span representing its processing of the request.</p></li>
<li><p>Forward the <codeclass="docutils literal notranslate"><spanclass="pre">traceparent</span></code> header to downstream services.</p></li>
<li><p><strong>Sampling Policy</strong>: The 100 in <codeclass="docutils literal notranslate"><spanclass="pre">random_sampling:</span><spanclass="pre">100</span></code> means that all the requests as sampled for tracing.
<h2>Tracing with the CLI<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#tracing-with-the-cli"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#tracing-with-the-cli'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h2>
<p>The Plano CLI ships with a local OTLP/gRPC listener and a trace viewer so you can inspect spans without wiring a full observability backend. This is ideal for development, debugging, and quick QA.</p>
<sectionid="quick-start">
<h3>Quick Start<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#quick-start"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#quick-start'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h3>
<p>You can enable tracing in either of these ways:</p>
<olclass="arabic simple">
<li><p>Start the local listener explicitly:</p></li>
<h3>Inspect and Filter Traces<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#inspect-and-filter-traces"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#inspect-and-filter-traces'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h3>
<h3>Notes<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#notes"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#notes'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h3>
<ulclass="simple">
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">--where</span></code> accepts repeatable <codeclass="docutils literal notranslate"><spanclass="pre">key=value</span></code> filters and uses AND semantics.</p></li>
<p>Plano uses the W3C Trace Context standard for trace propagation, which relies on the <codeclass="docutils literal notranslate"><spanclass="pre">traceparent</span></code> header.
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">{version}</span></code>: The version of the Trace Context specification (e.g., <codeclass="docutils literal notranslate"><spanclass="pre">00</span></code>).</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">{trace-id}</span></code>: A 16-byte (32-character hexadecimal) unique identifier for the trace.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">{parent-id}</span></code>: An 8-byte (16-character hexadecimal) identifier for the parent span.</p></li>
<h3>Instrumentation<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#instrumentation"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#instrumentation'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h3>
<p>To integrate AI tracing, your application needs to follow a few simple steps. The steps
<li><p>Read the <codeclass="docutils literal notranslate"><spanclass="pre">traceparent</span></code> header from incoming requests.</p></li>
<li><p>Start new spans as children of the extracted context.</p></li>
<li><p>Include the <codeclass="docutils literal notranslate"><spanclass="pre">traceparent</span></code> header in outbound requests to propagate trace context.</p></li>
<li><p>Send tracing data to a collector or tracing backend to export spans</p></li>
<h4>Example with OpenTelemetry in Python<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#example-with-opentelemetry-in-python"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h4>
</span><spanid="line-21"><spanclass="nb">print</span><spanclass="p">(</span><spanclass="sa">f</span><spanclass="s2">"Payment service response: </span><spanclass="si">{</span><spanclass="n">response</span><spanclass="o">.</span><spanclass="n">content</span><spanclass="si">}</span><spanclass="s2">"</span><spanclass="p">)</span>
</span></code></pre></div>
</div>
</section>
</section>
</section>
<sectionid="integrating-with-tracing-tools">
<h2>Integrating with Tracing Tools<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#integrating-with-tracing-tools"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#integrating-with-tracing-tools'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h2>
<sectionid="aws-x-ray">
<h3>AWS X-Ray<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#aws-x-ray"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#aws-x-ray'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h3>
<li><p><strong>Deploy the Collector</strong>: Run the collector as a Docker container, Kubernetes pod, or standalone service.</p></li>
<li><p><strong>Ensure AWS Credentials</strong>: Provide AWS credentials to the collector, preferably via IAM roles.</p></li>
<li><p><strong>Verify Traces</strong>: Access the AWS X-Ray console to view your traces.</p></li>
</ol>
</section>
<sectionid="datadog">
<h3>Datadog<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#datadog"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#datadog'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h3>
</span><spanid="line-2"><spanclass="gp">$ </span><spanclass="nb">export</span><spanclass="w"></span><spanclass="nv">DD_SITE</span><spanclass="o">=</span>datadoghq.com<spanclass="w"></span><spanclass="c1"># Or datadoghq.eu</span>
</span></code></pre></div>
</div>
</li>
<li><p><strong>Deploy the Collector</strong>: Run the collector in your environment.</p></li>
<li><p><strong>Verify Traces</strong>: Access the Datadog APM dashboard to view your traces.</p></li>
<h3>Langtrace<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#langtrace"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#langtrace'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h3>
<p>Langtrace is an observability tool designed specifically for large language models (LLMs). It helps you capture, analyze, and understand how LLMs are used in your applications including those built using Plano.</p>
<li><p><strong>Configure Plano</strong>: Make sure Plano is installed and setup correctly. For more information, refer to the <aclass="reference external"href="https://github.com/katanemo/archgw?tab=readme-ov-file#prerequisites"rel="nofollow noopener">installation guide<svgfill="currentColor"height="1em"stroke="none"viewbox="0 96 960 960"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M188 868q-11-11-11-28t11-28l436-436H400q-17 0-28.5-11.5T360 336q0-17 11.5-28.5T400 296h320q17 0 28.5 11.5T760 336v320q0 17-11.5 28.5T720 696q-17 0-28.5-11.5T680 656V432L244 868q-11 11-28 11t-28-11Z"></path></svg></a>.</p></li>
</span><spanid="line-2"><spanclass="kn">from</span><spanclass="w"></span><spanclass="nn">langtrace_python_sdk</span><spanclass="w"></span><spanclass="kn">import</span><spanclass="n">langtrace</span><spanclass="c1"># Must precede any llm module imports</span>
</span><spanid="line-12"><spanclass="p">{</span><spanclass="s2">"role"</span><spanclass="p">:</span><spanclass="s2">"system"</span><spanclass="p">,</span><spanclass="s2">"content"</span><spanclass="p">:</span><spanclass="s2">"You are a helpful assistant"</span><spanclass="p">},</span>
<h2>Best Practices<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#best-practices"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#best-practices'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h2>
<ulclass="simple">
<li><p><strong>Consistent Instrumentation</strong>: Ensure all services propagate the <codeclass="docutils literal notranslate"><spanclass="pre">traceparent</span></code> header.</p></li>
<li><p><strong>Secure Configuration</strong>: Protect sensitive data and secure communication between services.</p></li>
<li><p><strong>Performance Monitoring</strong>: Be mindful of the performance impact and adjust sampling rates accordingly.</p></li>
<li><p><strong>Error Handling</strong>: Implement proper error handling to prevent tracing issues from affecting your application.</p></li>
</ul>
</section>
<sectionid="summary">
<h2>Summary<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#summary"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#summary'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h2>
<p>By leveraging the <codeclass="docutils literal notranslate"><spanclass="pre">traceparent</span></code> header for trace context propagation, Plano enables developers to implement
<p>For full command documentation (including <codeclass="docutils literal notranslate"><spanclass="pre">planoai</span><spanclass="pre">trace</span></code> and all other CLI commands), see <aclass="reference internal"href="../../resources/cli_reference.html#cli-reference"><spanclass="std std-ref">CLI Reference</span></a>.</p>
<p>Replace placeholders such as <codeclass="docutils literal notranslate"><spanclass="pre"><Your-Aws-Region></span></code> and <codeclass="docutils literal notranslate"><spanclass="pre"><Your-Datadog-Api-Key></span></code> with your actual configurations.</p>
<li><a:data-current="activeSection === '#benefits-of-using-traceparent-headers'"class="reference internal"href="#benefits-of-using-traceparent-headers">Benefits of Using <codeclass="docutils literal notranslate"><spanclass="pre">Traceparent</span></code> Headers</a></li>
<li><a:data-current="activeSection === '#how-to-initiate-a-trace'"class="reference internal"href="#how-to-initiate-a-trace">How to Initiate A Trace</a></li>
<li><a:data-current="activeSection === '#example-with-opentelemetry-in-python'"class="reference internal"href="#example-with-opentelemetry-in-python">Example with OpenTelemetry in Python</a></li>
</ul>
</li>
</ul>
</li>
<li><a:data-current="activeSection === '#integrating-with-tracing-tools'"class="reference internal"href="#integrating-with-tracing-tools">Integrating with Tracing Tools</a><ul>