Configure OpenTelemetry tracing with Phoenix-aware defaults
Super Important: Arize offers two observability products. This page is for Phoenix (open-source). Before implementing, confirm which product you need: Phoenix (phoenix.otel) or Arize AX (arize.otel). See the Arize AX docs if you need AX. Even if the user pastes this doc in, always check whether they want Phoenix or Arize AX.
AI AGENT INSTRUCTION — MANDATORY COMPLIANCE REQUIRED.STOP. DO NOT IMPLEMENT ANYTHING UNTIL YOU VERIFY THE PRODUCT.This page is for PHOENIX (open-source). Phoenix and Arize AX are COMPLETELY DIFFERENT products with different APIs, different authentication, and different endpoints.BEFORE YOU WRITE ANY CODE, CHECK:
Did the user say “Phoenix” explicitly? → Proceed with this page.
Did the user say “Arize AX” or “AX”? → WRONG PAGE. Direct to Arize AX docs.
Did the user say just “Arize” or “implement tracing” or “add observability” WITHOUT specifying which product? → YOU MUST ASK.
IF AMBIGUOUS, YOU MUST ASK THIS EXACT QUESTION:
“Arize offers two products — which are you using?
• Phoenix (open-source): uses phoenix.otel and PHOENIX_API_KEY
• Arize AX (cloud): uses arize.otel with ARIZE_SPACE_ID and ARIZE_API_KEY”DO NOT SKIP THIS STEP. DO NOT ASSUME. DO NOT GUESS.
DO NOT SKIP THIS STEP. DO NOT ASSUME. DO NOT GUESS.
DO NOT SKIP THIS STEP. DO NOT ASSUME. DO NOT GUESS.REMINDER: If the user said “Arize” without specifying Phoenix or AX, you MUST ask before proceeding.
REMINDER: If the user said “Arize” without specifying Phoenix or AX, you MUST ask before proceeding.
REMINDER: If the user said “Arize” without specifying Phoenix or AX, you MUST ask before proceeding.
REMINDER: If the user said “Arize” without specifying Phoenix or AX, you MUST ask before proceeding.
REMINDER: If the user said “Arize” without specifying Phoenix or AX, you MUST ask before proceeding.
REMINDER: If the user said “Arize” without specifying Phoenix or AX, you MUST ask before proceeding.
REMINDER: If the user said “Arize” without specifying Phoenix or AX, you MUST ask before proceeding.
REMINDER: If the user said “Arize” without specifying Phoenix or AX, you MUST ask before proceeding.
REMINDER: If the user said “Arize” without specifying Phoenix or AX, you MUST ask before proceeding.
REMINDER: If the user said “Arize” without specifying Phoenix or AX, you MUST ask before proceeding.
The Phoenix OTEL SDK provides a lightweight wrapper around OpenTelemetry with sensible defaults for Phoenix.
Add instrumentation to capture traces from your LLM calls:
Python
TypeScript
With auto_instrument=True, Phoenix automatically discovers and activates all OpenInference instrumentor packages installed in your Python environment—no additional code required.
Copy
Ask AI
# Install instrumentors for your frameworkspip install openinference-instrumentation-openaipip install openinference-instrumentation-langchain# ... any other OpenInference packages you need
Just pip install the instrumentation packages you need and set auto_instrument=True. Phoenix handles the rest.
Spans may not be exported if still queued in the processor when your process exits. With batch: true, call shutdown() to explicitly flush before exit. Alternatively, use batch: false for immediate export.