Tempo trace query is recursively shifting the time on every new trace search #87608
Labels
area/explore
area/tracing
datasource/Tempo
needs investigation
for unconfirmed bugs. use type/bug for confirmed bugs, even if they "need" more investigating
type/bug
Describe the bug
When searching for traces, you click on a trace from the list, a right panel appears to query by trace id.
If
traceQuery.timeShiftEnabled
is enabled, it shifts the time range by subtracting time from therange.from
and adding torange.to
based on thespanStartTimeShift
andspanEndTimeShift
. However, on Grafana UI, the original calendar component (from the trace list search on the left side panel) also gets shifted. So every new trace keeps shifting the time recursively.To Reproduce
Steps to reproduce the behavior:
Open to Tempo datasource on Grafana Explorer, search for some traces (e.g. last 15 minutes).
Click on a trace, the time range on the calendar component will be decreased by one hour on "from" and "to", because the
spanStartTimeShift
is "1h" and it gets subtracted, andspanEndTimeShift
is "-1h" so it adds -1h, essentially subtracting too (in my screenshot, myspanEndTimeShift
is "1h" not "-1h", so it's indeed adding 1h to the end instead of subtracting).Click another trace from the left panel, the time range should go down by another hour.
Keep clicking different traces and notice the calendar time being shifted every time.
Expected behavior
The time shift should happen based on the original time range used for querying, shifting shouldn't be recursive.
Environment:
Additional Context
I can share some screenshots if needed.
The text was updated successfully, but these errors were encountered: