---
title: "How to: Tracing"
sidebarTitle: "Overview"
description: Guides on how to use traces
---

## Setup Tracing

Get started sending traces to Phoenix from your application.

<CardGroup cols={2}>
  <Card title="Setup Tracing" icon="telescope" href="/docs/phoenix/tracing/how-to-tracing/setup-tracing/setup-using-phoenix-otel">
    Configure tracing for Python and TypeScript applications
  </Card>
  <Card title="Auto Instrumentation" icon="wand-magic-sparkles" href="/docs/phoenix/integrations">
    Automatically capture traces from popular frameworks and LLM providers
  </Card>
  <Card title="Setup Projects" icon="folder" href="/docs/phoenix/tracing/how-to-tracing/setup-tracing/setup-projects">
    Organize traces into projects for different applications
  </Card>
  <Card title="Setup Sessions" icon="messages" href="/docs/phoenix/tracing/how-to-tracing/setup-tracing/setup-sessions">
    Group related traces into sessions for conversation tracking
  </Card>
</CardGroup>

---

## Customize Traces & Spans

Add metadata, tags, and custom attributes to your traces for better organization and filtering.

<CardGroup cols={2}>
  <Card title="Add Metadata, Tags & Users" icon="tags" href="/docs/phoenix/tracing/how-to-tracing/add-metadata/customize-spans">
    Set custom attributes on spans created by auto-instrumentors
  </Card>
  <Card title="Prompt Templates" icon="file-code" href="/docs/phoenix/tracing/how-to-tracing/add-metadata/instrumenting-prompt-templates-and-prompt-variables">
    Track prompt templates and variables in your traces
  </Card>
</CardGroup>

---

## Manual Instrumentation

Create and customize spans for full control over your tracing.

<Card title="Using Tracing Helpers" icon="at" href="/docs/phoenix/tracing/how-to-tracing/setup-tracing/instrument">
  Use decorators and helpers to easily instrument specific methods in Python
</Card>

---

## Querying Spans

Extract span data for analysis, evaluation, or export.

<Card title="Extract Data from Spans" icon="database" href="/docs/phoenix/tracing/how-to-tracing/importing-and-exporting-traces/extract-data-from-spans">
  Query spans to construct DataFrames for evaluation and analysis
</Card>

<Columns cols={2}>
  <Card title="Run a Query" href="/docs/phoenix/tracing/how-to-tracing/importing-and-exporting-traces/extract-data-from-spans#running-span-queries" icon="magnifying-glass" horizontal description="Span query examples"/>
  <Card title="Specify a Project" href="/docs/phoenix/tracing/how-to-tracing/importing-and-exporting-traces/extract-data-from-spans#how-to-specify-a-project" icon="folder" horizontal description="Project-scoped queries"/>
  <Card title="Query for Documents" href="/docs/phoenix/tracing/how-to-tracing/importing-and-exporting-traces/extract-data-from-spans#querying-for-retrieved-documents" icon="file-magnifying-glass" horizontal description="Document retrieval queries"/>
  <Card title="Apply Filters" href="/docs/phoenix/tracing/how-to-tracing/importing-and-exporting-traces/extract-data-from-spans#how-to-apply-filters" icon="filter" horizontal description="Filter query patterns"/>
  <Card title="Extract Attributes" href="/docs/phoenix/tracing/how-to-tracing/importing-and-exporting-traces/extract-data-from-spans#how-to-extract-attributes" icon="tags" horizontal description="Attribute extraction tips"/>
  <Card title="Use Pre-defined Queries" href="/docs/phoenix/tracing/how-to-tracing/importing-and-exporting-traces/extract-data-from-spans#pre-defined-queries" icon="list-check" horizontal description="Prebuilt query patterns"/>
</Columns>

---

## Annotate Traces

Add feedback, labels, and evaluation results to your traces.

<CardGroup cols={2}>
  <Card title="Annotating in the UI" icon="browser" href="/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/annotating-in-the-ui">
    Manually annotate traces through the Phoenix interface
  </Card>
  <Card title="Annotating via Code" icon="code" href="/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/capture-feedback">
    Programmatically log annotations using the Phoenix client
  </Card>
  <Card title="Log Evaluation Results" icon="chart-simple" href="/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/llm-evaluations">
    Attach LLM evaluation scores to spans and documents
  </Card>
  <Card title="Evaluating Traces" icon="magnifying-glass-chart" href="/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/evaluating-phoenix-traces">
    Run evaluations on trace data
  </Card>
</CardGroup>

---

## Import & Export Traces

Save, load, and transfer trace data.

<CardGroup cols={2}>
  <Card title="Export Traces" icon="file-export" href="/docs/phoenix/tracing/how-to-tracing/importing-and-exporting-traces/extract-data-from-spans">
    Export trace data for analysis or backup
  </Card>
  <Card title="Import Traces" icon="file-import" href="/docs/phoenix/tracing/how-to-tracing/importing-and-exporting-traces/importing-existing-traces">
    Load existing traces into Phoenix
  </Card>
  <Card title="Export Annotated Spans" icon="file-arrow-down" href="/docs/phoenix/tracing/how-to-tracing/importing-and-exporting-traces/exporting-annotated-spans">
    Export spans with their annotations
  </Card>
</CardGroup>

---

## Cost Tracking

Monitor token usage and costs for your LLM applications.

<Card title="Cost Tracking" icon="dollar-sign" href="/docs/phoenix/tracing/how-to-tracing/cost-tracking">
  Track token-based costs across your traces
</Card>

<Columns cols={2}>
  <Card title="Setup Cost Tracking" href="/docs/phoenix/tracing/how-to-tracing/cost-tracking#send-token-counts" icon="dollar-sign" horizontal description="Enable cost tracking"/>
  <Card title="Model Pricing" href="/docs/phoenix/tracing/how-to-tracing/cost-tracking#model-pricing-configuration" icon="tag" horizontal description="Pricing configuration"/>
  <Card title="Viewing Costs" href="/docs/phoenix/tracing/how-to-tracing/cost-tracking#viewing-cost-data" icon="chart-line" horizontal description="Cost visibility guide"/>
  <Card title="Session & Experiment Costs" href="/docs/phoenix/tracing/how-to-tracing/cost-tracking#session-level-costs" icon="chart-line" horizontal description="Session/experiment costs"/>
</Columns>

---

## Advanced

Advanced tracing configuration and techniques.

<CardGroup cols={2}>
  <Card title="Mask Span Attributes" icon="eye-slash" href="/docs/phoenix/tracing/how-to-tracing/advanced/masking-span-attributes">
    Hide sensitive data in your traces
  </Card>
  <Card title="Modify Spans" icon="pen" href="/docs/phoenix/tracing/how-to-tracing/advanced/modifying-spans">
    Transform spans before they are exported
  </Card>
  <Card title="Multimodal Tracing" icon="images" href="/docs/phoenix/tracing/how-to-tracing/advanced/multimodal-tracing">
    Trace applications with images and other media
  </Card>
  <Card title="Suppress Tracing" icon="ban" href="/docs/phoenix/tracing/how-to-tracing/advanced/suppress-tracing">
    Disable tracing for specific code blocks
  </Card>
  <Card title="Construct Shareable URLs" icon="link" href="/docs/phoenix/tracing/how-to-tracing/advanced/constructing-urls">
    Link to projects, traces, spans, and sessions by name or ID
  </Card>
</CardGroup>
