> ## 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.

# Quick Start: Tracing

> Send your first AI trace to Netra in under 5 minutes. Install netra-sdk, initialize with your API key, and start monitoring LLM calls instantly.

This guide walks you through sending your first trace to Netra.

## Prerequisites

Before you begin, make sure you've completed the initial setup from the [Getting Started guide](/quick-start/Overview):

* Created your API key
* Configured environment variables
* Installed the Netra SDK

<Accordion title="Quick setup recap">
  **1. Install the SDK**

  <CodeGroup>
    ```bash pip theme={null}
    pip install netra-sdk
    ```

    ```bash poetry theme={null}
    poetry add netra-sdk
    ```

    ```bash npm theme={null}
    npm install netra-sdk
    ```

    ```bash yarn theme={null}
    yarn add netra-sdk
    ```
  </CodeGroup>

  **2. Set environment variables**

  <CodeGroup>
    ```bash US Region theme={null}
    export NETRA_API_KEY="your-api-key-here"
    export NETRA_OTLP_ENDPOINT="https://api.getnetra.ai/telemetry"
    ```

    ```bash EU Region theme={null}
    export NETRA_API_KEY="your-api-key-here"
    export NETRA_OTLP_ENDPOINT="https://api.eu.getnetra.ai/telemetry"
    ```
  </CodeGroup>
</Accordion>

## Send Your First Trace

Add Netra initialization at the start of your application, then run a simple LLM call. Netra will automatically capture the trace.

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

  # Initialize Netra
  Netra.init(
      app_name="my-ai-app",
      environment="development",
      headers=f"x-api-key={os.getenv('NETRA_API_KEY')}",
  )

  # Make an LLM call - this will be automatically traced
  client = OpenAI()

  response = client.chat.completions.create(
      model="gpt-4",
      messages=[{"role": "user", "content": "Hello, how are you?"}],
  )

  print(response.choices[0].message.content)
  ```

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

  async function main() {
    // Initialize Netra (must await to ensure instrumentations are ready)
    await Netra.init({
      appName: "my-ai-app",
      environment: "development",
      headers: `x-api-key=${process.env.NETRA_API_KEY}`,
    });

    // Make an LLM call - this will be automatically traced
    const client = new OpenAI();

    const response = await client.chat.completions.create({
      model: "gpt-4",
      messages: [{ role: "user", content: "Hello, how are you?" }],
    });

    console.log(response.choices[0].message.content);
  }

  main();
  ```
</CodeGroup>

<Tip>
  Netra automatically instruments popular LLM libraries like OpenAI, Anthropic, LangChain, and more. See [Auto Instrumentation](/Observability/Traces/auto-instrumentation) for the full list.
</Tip>

## View Your Trace

Open the [Netra Dashboard](https://app.eu.getnetra.ai/login) and navigate to **Observability → Traces**. You should see your trace appear within a few seconds.

<img src="https://mintlify.s3.us-west-1.amazonaws.com/netra/images/first-trace.png" alt="First Trace" />

Click on the trace to see the full timeline, including:

* LLM call details and parameters
* Token usage and cost
* Latency breakdown
* Full prompt and response content

## Troubleshooting

| Issue                  | Solution                                                             |
| ---------------------- | -------------------------------------------------------------------- |
| No traces appearing    | Verify `NETRA_API_KEY` and `NETRA_OTLP_ENDPOINT` are set correctly   |
| LLM calls not traced   | Ensure `Netra.init()` is called **before** importing the LLM library |
| Missing prompt content | Set `traceContent: true` in initialization                           |

## Learn more

<CardGroup cols={2}>
  <Card title="Traces Overview" icon="map" href="/Observability/Traces/overview">
    Learn what traces are and how to use them
  </Card>

  <Card title="Auto Instrumentation" icon="wand-magic-sparkles" href="/Observability/Traces/auto-instrumentation">
    See all supported libraries and frameworks
  </Card>

  <Card title="Decorators" icon="at" href="/Observability/Traces/decorators">
    Add semantic context with @workflow, @agent, @task
  </Card>

  <Card title="Manual Tracing" icon="code" href="/Observability/Traces/manual-tracing">
    Create custom spans for fine-grained control
  </Card>
</CardGroup>
