Skip to main content

What is a Trace?

A trace represents the complete journey of a single request through your AI application. It captures every operation involved in handling that request—from the initial user input to the final response—including LLM calls, retrieval steps, tool executions, and database queries. Each trace is composed of spans, which represent discrete operations within the request lifecycle. Spans are organized hierarchically, showing parent-child relationships that reveal how operations are nested and sequenced. Netra’s tracing is built on OpenTelemetry standards, an industry-standard observability framework. This ensures compatibility with any OTLP-compliant backend and allows you to leverage existing OpenTelemetry tooling and instrumentation.

Why Tracing Matters for AI Applications

Traditional logging captures isolated events. Tracing connects them into a coherent story, which is essential for AI systems where:
  • Multiple LLM calls may happen in sequence or parallel
  • Agent decisions trigger unpredictable tool executions
  • RAG pipelines combine retrieval, embedding, and generation steps
  • Costs accumulate across many model invocations
With traces, you can:
CapabilityWhat It Enables
Diagnose failuresPinpoint exactly where and why a request failed
Analyze latencyIdentify slow operations across the request lifecycle
Audit agent behaviorReview the sequence of decisions and actions in agentic workflows
Track costsCorrelate token usage and costs to specific requests
Debug promptsSee exact inputs and outputs for each LLM call

Getting Started with Tracing

Setting up tracing in Netra takes just a few lines of code:
from netra import Netra

Netra.init(
    app_name="my-ai-app",
    environment="production",
)
Once initialized, Netra automatically instruments supported LLM providers, vector databases, and frameworks. Your traces will appear in the Netra dashboard within seconds.

Quick Start: Tracing

Follow the step-by-step guide to see your first trace

Viewing Traces in Netra

Access traces from the Netra dashboard by navigating to Observability → Traces. The Traces page provides:
  • Trace list - All captured traces with timestamps, duration, status, and token usage
  • Search and filters - Find traces by name, time range, status, or custom attributes
  • Configurable columns - Customize which fields are visible
  • Saved views - Persist filter and column configurations for recurring workflows
Selecting a trace opens the Trace Timeline, showing the hierarchical span structure, timing waterfall, and detailed metadata for each operation.

Tracing Methods

Netra offers three ways to add tracing to your application:
MethodBest ForEffort
Auto InstrumentationQuick setup, supported librariesZero code changes
DecoratorsFunctions and classesMinimal code changes
Manual TracingCustom operations, fine-grained controlFull control

Learn More

Tutorials

Last modified on January 30, 2026