Hi Folks, I deployed the Phoenix server on GCP and I have IAP setup to secure the access to only people within the company. The transfer of traces to the {phoenix_server_collector_endpoint}:6006 is supposed to be done by using SSH tunneling from developer's workstation to the server (we use the server for a PoC and don't collect traces from the conversational apps yet). The SSH tunneling is done this way. It maps the localhost:6006 --> {phoenix_server_collector_endpoint}:6006 and any trace that is sent to localhost:6006 is supposed to be sent to the actual deployed server's endpoint. The issue is that when I set the os.environ["PHOENIX_COLLECTOR_ENDPOINT"] = "localhost:6006" or when I use px.Client(endpoint="http://localhost:6006").log_evaluations() in a notebook the client library creates a new local server and logs the traces there. So, when I open localhost:80 I can see the traces visualized but when I open localhost:6006 or {phoenix_server_collector_endpoint}:6006 I don't see anything. Do you have any idea what's going on here?
Hard to tell what might not be working but it looks like to me if you have a UI on port 80 you should be pointing your client there too. Essentially the UI port and the http port for the API are the same. Also if you have a remote instance there鈥檚 no need to call launch_app as that will create a local instance
I see, thanks. I am not using the launch_app() in my code. As an example I am using the following sample code i a notebook. Is there a way the local serve instance is spun up somehow behind the scene?
trace_jsonl_url = "https://storage.googleapis.com/arize-phoenix-assets/datasets/unstructured/llm/context-retrieval/trace.jsonl"
hallucination_eval_url = "https://storage.googleapis.com/arize-phoenix-assets/datasets/unstructured/llm/context-retrieval/hallucination_eval.parquet"
qa_correctness_eval_url = "https://storage.googleapis.com/arize-phoenix-assets/datasets/unstructured/llm/context-retrieval/qa_correctness_eval.parquet"
retrieved_documents_eval_url = "https://storage.googleapis.com/arize-phoenix-assets/datasets/unstructured/llm/context-retrieval/retrieved_documents_eval.parquet"
with urlopen(trace_jsonl_url) as response:
lines = [line.decode("utf-8") for line in response.readlines()]
trace_ds = TraceDataset(json_lines_to_df(lines))
# px.launch_app(port=80, trace=trace_ds)
os.environ["PHOENIX_COLLECTOR_ENDPOINT"] = "http://localhost:6006"
hallucination_eval_df = pd.read_parquet(hallucination_eval_url)
qa_correctness_eval_df = pd.read_parquet(qa_correctness_eval_url)
retrieved_documents_eval_df = pd.read_parquet(retrieved_documents_eval_url)
px.Client(endpoint="http://localhost:6006").log_evaluations(
SpanEvaluations(eval_name="Hallucination", dataframe=hallucination_eval_df),
SpanEvaluations(eval_name="QA Correctness", dataframe=qa_correctness_eval_df),
DocumentEvaluations(eval_name="Relevance", dataframe=retrieved_documents_eval_df),
I commented out the px.launch_app(port=80, trace=trace_ds) and use the Client to log traces.
Yup! I would just use the url for where you can see the UI. It should be the same
Hmm, I am not sure if I am following you here. Using the code above this happens: I can see the visualization at localhost:80 I don't see anything at localhost:6006 (supposed to be the legit URL mapping to the remote server). I don't see anything at {phoenix_server_URL}:80 I am only using the SSH tunneling for port 6006 and not expecting the localhost:80 to show the app's UI let alone any data. That's why I am suspecting that a local instance is also spun up. I will also take a look into the Client's source code to see how the local instance vs passing the URL to the Cleint works. Maybe because our URL has a localhost in it the cleint code thinks it should create a local instance.
Launch_app would be the only thing that starts a server. The client doesn鈥檛 contain any server code. It鈥檚 almost like your ssh tunnel remapped 6006 to 80 on localhost. But I would definitely start there
Have you tried pulling traces from "localhost:80" using the client?
Hi Mikyo , thank you for helping me here. I found the issues.
I had to reset the notebook kernel to kill the local instance of the server (that caused me a bit of confusion).
Then, when not using the launch_app I need to log the traces via Client.log_traces to see them on the server.
