hey guys, I'm trying to export spans data using the python sdk (get_spans_dataframe) and I'm getting a response which is 4 hours behind my most rencent run. I haven't added any filter and made sure to change the timezone. Is there a way to get the most recent data?
By default, Phoenix span queries use UTC for filtering, regardless of your local timezone. If you want to get the most recent data, explicitly set the start_time and end_time parameters in your query using UTC-aware datetimes. This ensures you retrieve the latest spans, not just those matching your local time offset. Example: LBKSfrom datetime import datetime, timedelta, timezone import phoenix as pxLBKSpx_client = px.Client() start = datetime.now(timezone.utc) - timedelta(hours=1) # last 1 hour in UTC spans_df = px_client.query_spans(start_time=start)LBKSAccording to the documentation, all time-based filters are applied in UTC, not your local timezone, so local adjustments alone won't affect the query results. Always use UTC when specifying time ranges for accurate, up-to-date data retrieval (source, source, source).Would you like more detail or troubleshooting steps?Sources:
- https://github.com/Arize-ai/phoenix/issues/3024
- https://arize.com/docs/phoenix/tracing/how-to-tracing/importing-and-exporting-traces/extract-data-from-spans#%3AS1%3A
- https://arize.com/docs/phoenix/how-to/extract-data-from-spans
馃挕聽Hint: Mention RunLLM in the thread for followups.
hey 馃敀[private user] when i use query_spans instead and specify the time range i dont get anything back. Can i pass start_time and end_time as parameters while using the get_spans_dataframe()?
Phoenix cloud.
sounds good, thanks. And yes they are since I'm getting a response when i use get_spans_dataframe
Suhrullekha C. What time zone are you in when running the Phoenix client + what time zone is your application emitting traces from?
Can you also show me the code you use to invoke get_spans_dataframe?
can you try adding timezone to datetime.now like this (from datetime import timezone)
datetime.now(timezone.utc)Xander S. I'm running it in "America/Toronto" timezone and this is how I set up the get_spans_dataframe
Roger Y. I'm still getting no response when i update the timezone and send it in to query_spans()
Suhrullekha C. What do your timestamps look like in the dataframe before you convert the timezone? Are they timezone-aware or timezone-naive?
Xander S. the time just shows up as this 2025-08-06 17:41:39.852124+00:00 which indicates its utc
just to clarify: when start and end time are not specified you鈥檙e getting data but the data is to old, is that correct?
but when start and end times are specified, no data is returned. is that correct?
