> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getnetra.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Traces Overview

> Understand distributed tracing for AI applications in Netra. Learn how traces and spans capture every LLM call, tool use, and retrieval operation.

## 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](https://opentelemetry.io/) 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:

| Capability               | What It Enables                                                   |
| ------------------------ | ----------------------------------------------------------------- |
| **Diagnose failures**    | Pinpoint exactly where and why a request failed                   |
| **Analyze latency**      | Identify slow operations across the request lifecycle             |
| **Audit agent behavior** | Review the sequence of decisions and actions in agentic workflows |
| **Track costs**          | Correlate token usage and costs to specific requests              |
| **Debug prompts**        | See exact inputs and outputs for each LLM call                    |

## Getting Started with Tracing

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

<CodeGroup>
  ```python Python theme={null}
  from netra import Netra

  Netra.init(
      app_name="my-ai-app",
      environment="production",
  )
  ```

  ```typescript TypeScript theme={null}
  import { Netra } from "netra-sdk";

  await Netra.init({
    appName: "my-ai-app",
    environment: "production",
  });
  ```
</CodeGroup>

Once initialized, Netra automatically instruments a **curated default set** of supported LLM providers, agent frameworks, vector databases, and web frameworks. Only AI-relevant libraries are instrumented out of the box, not every library in your environment. Your traces will appear in the Netra dashboard within seconds.

<Card title="Quick Start: Tracing" icon="rocket" href="/quick-start/QuickStart_Tracing">
  Follow the step-by-step guide to see your first trace
</Card>

## Viewing Traces in Netra

Access traces from the Netra dashboard by navigating to **Observability → Traces**.

<video autoPlay muted loop playsInline className="w-full aspect-video rounded-xl" src="https://mintcdn.com/netra/XTkLfH0aAT4vWndN/videos/trace_list_gif.mp4?fit=max&auto=format&n=XTkLfH0aAT4vWndN&q=85&s=1a948ef30e95edb5d1af36e3ead297d6" data-path="videos/trace_list_gif.mp4" />

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:

| Method                                                             | Best For                                           | Effort               |
| ------------------------------------------------------------------ | -------------------------------------------------- | -------------------- |
| [Auto Instrumentation](/Observability/Traces/auto-instrumentation) | Quick setup with curated defaults for AI libraries | Zero code changes    |
| [Decorators](/Observability/Traces/decorators)                     | Functions and classes                              | Minimal code changes |
| [Manual Tracing](/Observability/Traces/manual-tracing)             | Custom operations, fine-grained control            | Full control         |

## Learn More

<CardGroup cols={2}>
  <Card title="Spans" icon="layer-group" href="/Observability/Traces/spans">
    Understand span types, attributes, and hierarchy
  </Card>

  <Card title="Configuration" icon="gear" href="/Observability/Traces/configuration/initialization">
    Configure tracing behavior and export options
  </Card>
</CardGroup>

### Tutorials

* [Comparing Traces](/Tutorials/comparing-traces) - Debug regressions by comparing traces side-by-side
* [Custom Trace Views](/Tutorials/custom-trace-views) - Create saved views for your team's workflows
