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

# Observe your agent

> Add tracing with one terminal command. Trace your own app, a demo application, or your coding agent.

export const NpxEvalsHero = ({children, footer, showDetailLink = true}) => <div className="ax-hero">
    <Callout icon="zap">
      {children}
      <CodeGroup>
        <CodeBlock filename="npx" language="bash">
          <pre><code>npx evals</code></pre>
        </CodeBlock>
        <CodeBlock filename="uvx" language="bash">
          <pre><code>uvx arize-ax-cli instrument</code></pre>
        </CodeBlock>
        <CodeBlock filename="AX CLI" language="bash">
          <pre><code>ax instrument</code></pre>
        </CodeBlock>
        <CodeBlock filename="macOS / Linux" language="bash">
          <pre><code>{`bash <(curl -fsSL https://cdn.jsdelivr.net/npm/evals/start.sh)`}</code></pre>
        </CodeBlock>
        <CodeBlock filename="Windows" language="powershell">
          <pre><code>{`irm https://cdn.jsdelivr.net/npm/evals/start.ps1 | iex`}</code></pre>
        </CodeBlock>
      </CodeGroup>
      {footer ? <p>{footer}</p> : null}
      {showDetailLink ? <p>
          <a href="/docs/ax/set-up-with-ai-assistants#one-command-setup">
            See what this does →
          </a>
        </p> : null}
    </Callout>
  </div>;

A trace records every step of a request through your agent, so when a response is wrong you can see which step caused it.

<NpxEvalsHero showDetailLink={false}>
  ## Instrument your agent in one command

  Run it from your project's root. It creates your [Arize AX account](https://app.arize.com/auth/join) and API key for you.
</NpxEvalsHero>

## What the command does

It asks which coding agent to use, then what to trace:

1. An existing app
2. A new starter app
3. Your coding agent

It then installs the [AX CLI](/docs/api-clients/cli/overview) and skills, instruments your app, and runs it until the first trace arrives, asking before it changes anything. Add your LLM provider's API key, such as `OPENAI_API_KEY`, to the same `.env`. See [one command setup](/docs/ax/set-up-with-ai-assistants#one-command-setup) for details.

<Accordion title="Other ways to instrument">
  * **[Arize Skills](/docs/ax/skills/overview)**: your agent loads [`arize-instrumentation`](https://github.com/Arize-ai/arize-skills/blob/main/skills/arize-instrumentation/SKILL.md) and wires in the right package.
  * **[Auto-instrumentation](/docs/ax/instrument/set-up-tracing)**: add the [OpenInference](https://github.com/Arize-ai/openinference) instrumentor for your provider yourself. In **Tracing Projects**, this is the **Instrument Manually** tab.
  * **[Integrations](/docs/ax/integrations)**: the package and snippet for each of 30+ frameworks. For non-US regions, see [OpenTelemetry (arize-otel)](/docs/ax/integrations/opentelemetry/opentelemetry-arize-otel).
  * **[Manual instrumentation](/docs/ax/instrument/manual-instrumentation)**: for frameworks Arize doesn't auto-instrument.

  <Frame>
    <img src="https://storage.googleapis.com/arize-assets/doc-images/quickstarts/get-started-manual.png" alt="Instrument Manually view showing the integration picker with 30+ providers and frameworks" />
  </Frame>
</Accordion>

<Accordion title="No traces arriving?">
  Most often the LLM provider key is missing. If **See your first trace** in **Tracing Projects** still shows **No traces yet** after about 45 seconds, check:

  1. **API key**: look for `401` or `StatusCode.INTERNAL` in your terminal.
  2. **Space ID**: a wrong ID sends traces to another space.
  3. **Endpoint**: use the HTTP or gRPC endpoint your exporter expects.
  4. **Silent failures**: `BatchSpanProcessor` hides exporter errors, so swap in `SimpleSpanProcessor` to see them.
</Accordion>

## Read a trace

Open your project to see one trace per request.

<Frame>
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/get-started-images/02-traces-list.png" alt="Traces list view showing app requests" />
</Frame>

Click a trace to open its span tree. Each span shows its [span kind](/docs/ax/instrument/what-are-traces), input, output, latency, and status. LLM spans also show token counts and [cost](/docs/ax/instrument/track-costs).

<Frame>
  <img src="https://mintcdn.com/arize-ax/NSWSUMZCLlm8ackb/images/get-started/trace-span-tree.webp?fit=max&auto=format&n=NSWSUMZCLlm8ackb&q=85&s=984a3c98f348d7cc5374f45ebe12daa2" alt="Expanded trace for a travel agent: nested agent, tool, retriever and LLM spans with per-span latency and token counts, beside the Input / Output panel showing the system, user and assistant messages" width="2000" height="1154" data-path="images/get-started/trace-span-tree.webp" />
</Frame>

Find a response that came back wrong and check each step. You can look [manually](/docs/ax/observe/tracing/view-and-manage-traces), ask [Alyx](/docs/ax/alyx), or ask your coding agent with the [`arize-trace`](https://github.com/Arize-ai/arize-skills/blob/main/skills/arize-trace/SKILL.md) [skill](/docs/ax/skills/overview).

Next, score every new trace automatically.

<CardGroup cols={2}>
  <Card title="Next: Evaluate production traffic" icon="arrow-right" href="/docs/ax/get-started/get-started-evaluations" />

  <Card title="Learn more about Tracing" icon="book-open" href="/docs/ax/instrument/what-are-traces" />
</CardGroup>
