I'm trying to set up openinference tracing, and I would expect to see something show up in my dashboard when I run my tests, but I don't see my new project being created. Does Arize automatically skip tracing when code is being run from e.g. pytest? Or do I need to do something else to enable it?
Arize does not automatically skip tracing when code is run from testing frameworks like pytest. To ensure that your traces are captured and sent to the Phoenix dashboard, you need to verify a few things: 1. Tracer Initialization: Ensure that the tracer is correctly initialized before any code that you want to trace is executed. This includes setting up the tracer provider and span processor as shown in the Phoenix documentation.2. Environment Variables: Make sure that the necessary environment variables, such as PHOENIX_COLLECTOR_ENDPOINT, are correctly set. This endpoint should point to your Phoenix server, for example, http://localhost:6006/v1/traces.3. Project Configuration: Ensure that the project name is correctly set in your tracing setup. Projects in Phoenix are created when traces are sent with a new project name. You can set the project name using the register function from the phoenix.otel module, as described in the setup guide.Would you like more detail on any specific part of this setup?Sources:
- Phoenix documentation
馃挕聽Hint: Mention RunLLM in the thread for followups.
I already did all of those things. That's why I'm asking here.
I would've expected to see a 'hello world' example to make sure tracing is hooked up as expected.
Hey Samantha Z. - sorry for the dumb question but is the code that is run during your testing (e.g. pytest) actually initialize opentelemetry?
As in you will have to have something like
import os
from phoenix.otel import register
# configure the Phoenix tracer
tracer_provider = register(
project_name="my-pytest",
) at the beginning of the tests
That's what I wanted to know, if we just have it in our main code, and the tests call that code, is that good enough? Sounds like it's not.
Thanks!
If you run experiments as part of CI (https://docs.arize.com/phoenix/datasets-and-experiments/how-to-experiments/run-experiments_) then the setup is done for you automatically based on env vars but if you are rolling your own tests it would need some setup code to setup tracing. Hope that makes sense
This is still not working. I'm also struggling to find the instructions on how to run a local server vs. using the Arize endpoint.
you can run phoenix locally by just running phoenix serve and that will run a local phoenix instance using sqlite or what's configured in your environment variables. Could you post a code snippet of what a test looks like for you?
Hey Samantha Z. sorry we didn't get to a resolution later. Happy to help in any way. Copying my colleague John G. - let us know if there's anything we can do!
Samantha Z. - let us know if it would be helpful to jump on a call and debug live!
Thanks! I think I need to try it one more time, and in the meantime we have a shared self-hosted version that we should be able to use, so I'm going to try that, also
ok I got it working. Turned out it was a problem with my virtual environment configuration. yay! Thanks for helping me check my work.
