Skip to content

Instantly share code, notes, and snippets.

@hamelsmu
Created September 6, 2024 20:09
Show Gist options
  • Save hamelsmu/fd228c88c62a8c35cb3590fa13f012cb to your computer and use it in GitHub Desktop.
Save hamelsmu/fd228c88c62a8c35cb3590fa13f012cb to your computer and use it in GitHub Desktop.
Export Traces

Export Traces

Export to Notebook

See our data API guide for function and argument level information.

After logging data to Arize, if you want to retrieve that data to use in code for evaluation, you can visit the LLM Tracing tab to see your traces and use the export button to get your export code.

Boilerplate code after export

Copy

# this will be prefilled by the export command. 
# Note: This uses a different API Key than the one above.
ARIZE_API_KEY = ''

# import statements required for getting your spans
import os
os.environ['ARIZE_API_KEY'] = ARIZE_API_KEY
from datetime import datetime
from arize.exporter import ArizeExportClient 
from arize.utils.types import Environments

# Exporting your dataset into a dataframe
client = ArizeExportClient()
primary_df = client.export_model_to_df(
    space_id='', # this will be prefilled by export
    model_id='', # this will be prefilled by export
    environment=Environments.TRACING, 
    start_time=datetime.fromisoformat(''), # this will be prefilled by export 
    end_time=datetime.fromisoformat(''), # this will be prefilled by export
)

Export to CSV

Users can download data directly as a CSV file from the Tracing page by selecting "Export to CSV" from the export dropdown menu. Please note that the CSV export is designed to capture only a sample of the data, specifically the top 1,000 rows currently displayed on the page. Before exporting, users can customize the output by selecting their desired columns using the table column selector.

PreviousFilter TracesNextTracing an Agent

Last updated 6 days ago

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment