Skip to main content
After tracing your application, the next step is to look at your data to understand system behavior and identify issues. Because there can be a lot of spans to navigate, it’s helpful to query traces by specific attributes or narrow results to a particular time range to focus your investigation. You can also export trace data for further analysis outside the platform.

Query Traces

Querying traces allows you to focus your analysis on specific system behaviors. Start by defining your goals, such as identifying performance bottlenecks or isolating spans that contain errors.
Image

Construct Queries

To start querying your traces, click on the filter bar. You can type, select, or use Alyx to help you craft filters that express your question clearly.

General Syntax

  • Format: "dimension name" = 'value'
  • Enclose the dimension in double quotes (") and the value in single quotes (').

Examples:

  • Equals: "dimension_name" = 'value'
  • Not Equals: "dimension_name" != 'value'
  • Contains: "dimension_name" contains 'substring'
  • Null: "attributes.input.value" = null or "attributes.input.value" is null
  • IN: "dimension_name" IN ('value_1', 'value_2')
  • AND/OR Support: Combine multiple conditions using AND or OR.

Operators:

  • = : Equals
  • != : Not equals
  • < : Less than
  • > : Greater than
  • IN : Includes

Functions:

  • Contains: Use contains to check if a string column contains a substring
✨ You can use AI Search to automatically generate query filters!Example**:** “Filter for LLM spans”

Multi-Span Filters

For advanced filtering, you can create multiple span queries and define relationships between them. This is useful when you need to find traces based on complex patterns, such as traces where an LLM call follows a retrieval operation, or traces that contain certain spans but exclude others. Screenshot 2025-12-14 at 8.36.42 PM.png To use multi-span filters:
  1. Define your first Span Query using the standard query syntax
  2. Click Add Span Query to create additional queries (up to 5 total)
  3. Each query is labeled automatically (A, B, C, D, E)
  4. Use the Find Traces Matching field to define relationships using operators

Operators

Combine span queries using these operators:
  • AND - Traces containing at least one span matching A and one matching B
    • Example: A AND B finds traces with both LLM calls and errors
  • OR - Traces containing at least one span matching A or one matching B
    • Example: A OR B finds traces using either OpenAI or Anthropic
  • NOT - Traces that do not contain spans matching the query
    • Example: NOT A finds traces without errors
  • -> (Indirectly Calls) - Spans matching A start before spans matching B (temporal ordering)
    • Example: A -> B finds traces where retrieval happens before LLM generation
  • => (Directly Calls) - Spans matching A are the direct parent of spans matching B (hierarchical relationship)
    • Example: A => B finds traces where an agent directly calls a tool

Complex Queries

You can combine operators with parentheses for sophisticated filtering logic:
  • (A AND B) OR C - Traces where (A and B both occur) or (C occurs)
  • A AND NOT(B -> C) - Traces containing A but without the pattern where B precedes C
  • (A => B) AND (B -> C) - Traces where A directly calls B, and B starts before C

Saved Filters

When you find yourself using the same filters repeatedly — for example, to track specific spans or error types — you can save them. Saved filters act like shortcuts to your go-to queries, so you can eliminate the need to recreate complex filter queries repeatedly. To save a filter for future use:
  1. Configure your desired filter using the query filter syntax
  2. Click the Save button in the filter interface
  3. Choose one of the following options:
    • Add a new saved filter view: Create a completely new saved filter with a custom name
    • Update an existing filter: Modify an existing saved filter with your current configuration
  4. You can save and pin up to 7 filters at a time for quick access. (Note: Filters cannot currently be deleted from the pinned view)

Time Filters

Time filters let you focus analysis on the period that matters. The Time Selector makes it quick to define that window. Choose from presets, use the calendar picker, or type a custom range directly.
Image
  • Typing Custom Range: You can define exact time windows by typing directly into the selector. Supported formats:
    • Dates: 4/1 or 2025-04-01
    • Date and time: 4/1 3:00 AM or 2025-04-01 15:00
    • Ranges: 4/1 - 4/6 or 4/1 3:00 AM - 4/6 5:00 PM
  • Relative Time Shortcuts: For rolling time windows, use shorthand notation in the selector.
    • 15m, 15min, 15minutes → last 15 minutes
    • 1 h, 1 hr, 1 hour, 1 hours → last hour
    • 10d, 10day, 10days → last 10 days
  • Time Zone Support: You can set your preferred timezone, and the selection persists across sessions to ensure data is always shown in your local context.

Export Traces

It can be helpful to export the trace data from Arize for a variety of reasons. Common use cases include:
  • Testing out evaluations with a subset of the data
  • Create a dataset of few-shot examples programmatically
  • Augment trace data with metadata programmatically
  • Fine-tune a smaller model with production traces from Arize
Arize AX supports Exporting to a notebook and Exporting to a CSV from the UI:
Image

Export to Notebook

You can export data into code from the Tracing page by selecting Export to Notebook from the export dropdown menu. You will be provided with a prefilled function to export your trace data to a dataframe.
# Install Arize SDK
! pip install "arize[Tracing]>=7.1.0"

import os
os.environ['ARIZE_API_KEY'] = 'YOUR_API_KEY'

from datetime import datetime
from arize.exporter import ArizeExportClient
from arize.utils.types import Environments

client = ArizeExportClient()

print('#### Exporting your primary dataset into a dataframe.')

primary_df = client.export_model_to_df(
    space_id= '',  # pre-filled space_id
    model_id='', # pre-filled model_id
    environment=Environments.TRACING,
    start_time= '', # pre-filled start_time
    end_time '', # pre-filled end_time
    # Optionally specify columns to improve query performance
    # columns=['context.span_id', 'attributes.llm.input']
)