Hi, I tried to copy all traces from a source project to a destination project in the same phoenix instance (I use the self hosted docker container). After running following code, I can see that the destination project is created but there is no traces loaded into it. df does contain data during debug. Does anyone know what could be the reason?
client = px.Client()
df = client.get_spans_dataframe(project_name=source_project_name)
print(df.head())
client.log_traces(trace_dataset=px.TraceDataset(df), project_name=dest_project_name)This behavior is expected: Phoenix does not allow the same trace (trace_id/span_id) to exist in multiple projects within the same instance. When you use log_traces to copy traces from one project to another, traces already present in the source project will not appear in the destination project unless you change their trace/span IDs before ingestion. This is by design to keep traces immutable and uniquely linked to a single project after ingestion (GitHub Issue #3645).To work around this, you can either (1) change the trace/span IDs in your DataFrame before logging to the destination project, or (2) use separate Phoenix working directories/databases for each project if running locally. Would you like more detail or a code example for changing IDs?Sources:
- GitHub Issue #3645
馃挕聽Hint: Mention RunLLM in the thread for followups.
Hey Shanshan S. - chan you check the time range of your project? It could be that the traces are not recent
Hi Mikyo, the time range of my source project was from yesterday and the destination project was created when I first ran the log_traces code. Why the old traces could cause problem? The answer from RunLLM seems make sense. I'll try to change the trace id.
Got it. Yes traces and spans must be unique so you will have to modify them
Shanshan S. what version of phoenix are you using?
Hi 馃敀[private user] Thank you for the offer. 馃榾 Sorry I was on other things as this issue is not super important now. I will reach out later when I need it.
