Hi Team, I am using the following code for Arize tracing as mentioned here https://colab.research.google.com/github/Arize-ai/tutorials/blob/main/python/llm/tracing/openai/openai-tracing.ipynb#scrollTo=4e13d[鈥b-357038646ad2 I have verified all the keys are correct. However, the project itself does not show on the Arize UI. Is there something I am missing here?
!pip install -qq opentelemetry-sdk opentelemetry-exporter-otlp openai openinference-instrumentation-openai arize-otel
import os
from getpass import getpass
SPACE_ID = globals().get("SPACE_ID") or getpass(
":key: Enter your Arize Space ID: "
)
API_KEY = globals().get("API_KEY") or getpass(":key: Enter your Arize API Key: ")
OPENAI_API_KEY = globals().get("OPENAI_API_KEY") or getpass(
":key: Enter your OpenAI API key: "
)
os.environ["OPENAI_API_KEY"] = OPENAI_API_KEY
# Import open-telemetry dependencies
from arize.otel import register
# Setup OTEL via our convenience function
tracer_provider = register(
space_id=SPACE_ID, # in app space settings page
api_key=API_KEY, # in app space settings page
project_name="tracing-haiku-tutorial", # name this to whatever you would like
)
# Import the automatic instrumentor from OpenInference
from openinference.instrumentation.openai import OpenAIInstrumentor
# Finish automatic instrumentation
OpenAIInstrumentor().instrument(tracer_provider=tracer_provider)
import openai
# Run OpenAI completion
openai_client = openai.OpenAI()
response = openai_client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[{"role": "user", "content": "Write a haiku."}],
max_tokens=20,
)
print(response.choices[0].message.content)If your project does not appear in the Arize (Phoenix) UI after running the tracing code, the most common causes are: (1) traces are not being sent to the correct endpoint, (2) authentication (API key/space ID) issues, or (3) the project only appears after the first successful trace is received. According to the documentation, projects are created automatically when the first trace arrives鈥攖here is no need to pre-create them. Double-check that your API key and space ID are correct, and ensure you are using the correct tracing package for Arize (not Phoenix Cloud) as the code uses arize-otel, not arize-phoenix-otel or phoenix. Also, make sure you are not behind a firewall or proxy that blocks outgoing requests to Arize's collector endpoint, and that you are not mixing up Arize and Phoenix endpoints or keys (source, source).If you have verified all keys and run the code, try searching for the project name in the UI after a few minutes, as there may be a short delay. If the project still does not appear, check for errors in your notebook output or logs鈥攁uthentication or network errors will prevent traces from being ingested and thus the project from being created. Would you like more detail on troubleshooting steps or how to verify trace delivery?Sources: - Trace a Deployed App - https://arize-ai.slack.com/archives/C04R3GXC8HK/p1721810975.988929
馃挕聽Hint: Mention RunLLM in the thread for followups.
If you have verified your keys and endpoints but the project still doesn't show, the most likely reasons are: (1) traces are not being sent due to a missing or incorrect authentication header, (2) the tracing code is not actually generating or exporting spans, or (3) there is a network/firewall issue blocking trace delivery. Projects in Arize/Phoenix only appear after the first trace is successfully received (source).Check your notebook or script output for errors or warnings related to OpenTelemetry, authentication, or network connectivity. Also, ensure you are using the correct tracing package (arize-otel for Arize, arize-phoenix-otel for Phoenix) and that your code is not running in an environment (like some notebooks) where background threads or batching may delay or prevent trace export (source). Would you like step-by-step troubleshooting instructions?Sources:
- https://arize-ai.slack.com/archives/C04R3GXC8HK/p1721810975.988929
馃挕聽Hint: Mention RunLLM in the thread for followups.
Hi 馃敀[private user], I tried your code as well, it still shows no projects for me. Am I missing some permissions maybe? I am free to pair whenever you are available
yes
like the code in colab compiles successfully and gives the right output, just that I am not able to see the traces in Arize UI
IST
Indian Standard Time
