RUM Traces tab shows only 1 of 62 spans for long requests: span query uses a ~26 ms time window
Summary
Opening a trace from the RUM Session Replay Traces tab shows only a fraction of its spans when the request is long-running. The span query is issued with a time window of roughly 26 milliseconds, anchored at the RUM resource event's timestamp — which for fetch is when the request finished. Every span that started before that instant is filtered out.
For a short API call this is invisible, because start ≈ end and all spans fall inside the window. For a streaming request that lasts minutes, the window lands at the very end of the trace and almost nothing matches.
Observed
A streaming POST that ran for 138.7 seconds. The trace has 62 spans in the traces stream, but the panel header shows "1 span" and the waterfall renders only the RUM-derived nodes plus one stray backend span.
Timestamps (µs) for that trace:
spans actually cover 1786375986133000 … 1786376124828474 (138.7 s, 62 spans)
panel's query window 1786376124818474 … 1786376124844405 (25,931 µs ≈ 26 ms)
→ spans inside the window: 1 / 62 (61 spans start before the window opens)Running the panel's own SQL with a wider window returns everything:
| window | spans returned |
|---|---|
| the panel's 26 ms window | 1 |
| last 1 hour | 62 (ui 2, api-service 42, auth-service 18) |
The requests
Clicking a row in the Traces tab issues these. The four _rumdata queries use a ±60 s window around the anchor:
POST /api/{org}/_search?type=logs&search_type=RUM
SELECT * FROM "_rumdata" WHERE (_oo_trace_id = '84fe…') ORDER BY _timestamp ASC
start_time 1786376064818474 end_time 1786376184844405 ← 120 s…while the query that actually fetches the spans uses a window of ~26 ms around the same anchor:
POST /api/{org}/_search?type=traces&search_type=ui
SELECT * FROM "default" WHERE trace_id = '84fe…' ORDER BY start_time
start_time 1786376124818474 end_time 1786376124844405 ← 26 ms
size 50000size is generous, so the truncation comes purely from the time range. The preceding GET /api/{org}/{stream}/traces/latest?filter=trace_id='…'&size=1 is presumably where the narrow range originates.
Steps to reproduce
- Have a long-running request (10 s or more — a streaming/SSE endpoint works well) that is traced end-to-end, with the frontend RUM SDK propagating
traceparentand the backend exporting spans to the same org. - Make sure the request is triggered by a user action, so the resource event carries an
action_idand shows up in the Traces tab. - Open the session in RUM → Traces → click the row for that request.
Expected: the full waterfall. Actual: only the last span or two; the header reports "1 span".
The row itself is correct — it shows the right route and the right duration (2.31m in our case) — so the problem is isolated to the span fetch after the click.
Suggested fix
Derive the span query window from the trace's actual extent instead of a point in time. The RUM resource event already carries resource_duration, so [timestamp − duration, timestamp] (with a little padding) would cover it. Reusing the same ±60 s window that the sibling _rumdata queries in the same click already use would also fix the common cases.
Environment
- OpenObserve v0.92.0, self-hosted, single node
@openobserve/browser-rum0.4.1,propagatorTypes: ['tracecontext']- Backend spans arrive via OpenTelemetry Collector over OTLP/HTTP
- Chromium
Note
This is independent of the trace-id padding problem reported in #13733; that one is about ids never matching at all, this one is about the time window. Both had to be fixed/worked around before the Traces tab produced anything useful for us.
Source: openobserve/openobserve