Commit Graph
976 Commits
Author SHA1 Message Date
Omkar KesarkhaneandClaude Sonnet 5 46c4ae4a96 fix: make tooltip request count match node label in service graph (#13122)
## What changed

Fixed a mismatch between the request count displayed on a service graph
node label and the request count shown in the tooltip when hovering over
that node in the tree view.

## Why

In the service graph tree view, node labels use a direction-aware
`value` (e.g., requests from service A → service B), while the tooltip
was reading `node.requests` — the backend's node-level aggregate (sum of
all directions). This caused the two displays to show different numbers
for the same node.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 08:10:19 +00:00
3f03b77320 feat: Revamp metrics explorer (#13144)
Revamp the metrics explorer to enable faster visualization and
exploration of metrics.
Design at: metrics_cards_prd.md file

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: ktx-abhay <abhay.padamani@kiara.tech>
Co-authored-by: Abhay Padamani <141122205+ktx-abhay@users.noreply.github.com>
2026-07-14 07:50:56 +00:00
Ashish Kolhe 8335e01d18 fix: styling changes (#13160) 2026-07-14 06:39:29 +00:00
ktx-mihirandAbhay Padamani e483e26b9d fix: pipeline module form migration with zod (#13077)
- form migration with zod schema for pipeline module

---------

Co-authored-by: Abhay Padamani <141122205+ktx-abhay@users.noreply.github.com>
2026-07-13 12:03:24 +00:00
ktx-mihirandAbhay Padamani 44866b482e fix: billing and others form migration with zod (#12905)
- form migration with zod schema for billing , marketplaces and other
module

---------

Co-authored-by: Abhay Padamani <141122205+ktx-abhay@users.noreply.github.com>
2026-07-13 11:38:38 +00:00
ktx-vaidehi 67aec54d27 fix: ui header inconsistency (#13150) 2026-07-13 11:33:39 +00:00
ktx-vaidehi 5ec3e960c7 fix: ui improvement (#13106) 2026-07-09 11:00:22 +00:00
Omkar Kesarkhane be8e0adda3 fix: Removed native scrollIntoView from SpanBlock onMounted as it was blocking scroll (#12837)
## What changed

- **Removed** the native `scrollIntoView()` call from `SpanBlock.vue`'s
`onMounted` hook, which was fighting the user's manual scroll in a
virtualized list.
- **Added** `cancelScroll()` to `TraceTree.vue` — clears pending
timeouts and aborts the TanStack virtualizer retry loop by resetting
`currentScrollToIndex`.
- **Wired cancellations** in `TraceDetails.vue` — calls
`traceTreeRef.value?.cancelScroll?.()` when the sidebar closes, trace
details reset, or a new trace is loaded.
- **Added `onBeforeUnmount`** cleanup in `TraceTree.vue` so a queued
scroll can't fire against a torn-down virtualizer.
- **Added regression tests** in `SpanBlock.spec.ts`,
`TraceTree.spec.ts`, and `TraceDetails.spec.ts` covering all
scroll-cancellation paths.

## Why

When `TraceDetails.vue` is opened with a `span_id` query parameter,
`SpanBlock.vue` called `element.scrollIntoView()` on mount. Because rows
are virtualized via `@tanstack/vue-virtual`, a `SpanBlock` remounts
every time it scrolls into the viewport — so each remount snapped the
viewport back to the pre-selected span, fighting the user's manual
scroll. The issue only manifested when a `span_id` was pre-selected at
page load.
2026-07-09 05:33:35 +00:00
Omkar KesarkhaneandClaude Sonnet 5 9a8aa0a11d fix: Traces run query button UI fix (#13103)
## What changed

- **`web/src/plugins/traces/SearchBar.vue`**: Fixed the Run Query button
by changing `variant="ghost"` to `variant="primary"`, restoring its
primary action styling (matches Logs SearchBar behavior).
- **`web/src/components/TenstackTable.vue`**: Fixed skeleton loader
background color to match the logs version. Added
`bg-(--o2-log-table-row-bg)` and `border-(--o2-log-table-row-border)`
tokens to skeleton rows. Replaced inline shimmer gradients with a
reusable `.o2-skel-pill` CSS class that uses OTable skeleton token
variables (`--color-skeleton-base`, `--color-skeleton-highlight`).

## Why

The Traces Run Query button had lost its primary styling and appeared
visually broken — it was rendering as a ghost button instead of the
prominent primary action button. The generic `TenstackTable.vue`
skeleton loaders had a different background color than the logs-specific
`TenstackTable.vue`, causing visual inconsistency.

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-09 05:19:08 +00:00
ktx-vaidehi 3ebb8158f9 fix: table listing missing refresh and column toggle (#13065) 2026-07-08 12:53:23 +00:00
Ashish Kolhe 37a92fa87b chore: service graph fixes (#13070) 2026-07-08 05:49:13 +00:00
Bhargav 5c288c3444 fix: logs table FF. UI fix (#13067) 2026-07-08 04:22:15 +00:00
2c087d6953 fix: empty states (#13058)
Co-authored-by: ktx-vaidehi <134508096+ktx-vaidehi@users.noreply.github.com>
Co-authored-by: ktx-vaidehi <vaidehi.akhani@kiara.tech>
2026-07-07 15:38:39 +00:00
5229a8d1e3 fix:tw prefix removal (#13017)
Co-authored-by: ktx-riya <riya.kukadiya@kiara.tech>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-06 08:51:22 +00:00
Sai Nikhil f16f156693 fix: ai observabilty session list cache (#13023) 2026-07-06 05:48:10 +00:00
Bhargav 26ab4864e6 fix: Rum > sessions UI improvement (#13028) 2026-07-03 13:48:02 +00:00
Bhargav 04718da854 fix: no stream selection banner should come when there is no stream s… (#13025)
…elected
2026-07-03 13:43:59 +00:00
Abhay Padamani 70a716f76c fix: tabs issue for tables, forms and date time picker (#13022) 2026-07-03 12:58:51 +00:00
Bhargav cffab89a57 fix: histogram no data availavble fix (#13020) 2026-07-03 09:23:42 +00:00
Omkar Kesarkhane cb60a1a042 fix: fixed correaltion tabs height (#12993) 2026-07-03 06:19:18 +00:00
Shrinath RaoandClaude Opus 4.8 81e2d7a42f test: heal E2E regressions + ENT shard failures from scoped SCSS removal (#12764) & OTag refactors (#12999)
## What this fixes

The scheduled **regression suite** started failing on `main` after
**#12764 (scoped scss styles removal)**, and validating the fix on the
**enterprise build** surfaced several more failures in the same family
(plus a couple unrelated ones). This PR heals **all of them**. Every fix
is either a page-object selector update or a small, inert `data-test`
hook — **no product behaviour changes**.

## Everything fixed

| Area | Test | Root cause | Fix | Verified |
|---|---|---|---|---|
| **Streams** regression | `query expand icon #9337` | #12764 replaced
`.editor-fullscreen` class with inline classes on `isFocused` |
`data-fullscreen` hook on the container + detect via it | ✅ local |
| **Alerts** regression | `Bug #9967 PromQL alert` | #12764 turned the
PromQL operator into `<OSelect
data-test="alert-threshold-operator-select">`, dropping
`.alert-v3-select` | data-test + popover-option pattern (+ fail-fast
fallback) | ✅ local |
| **RUM** (ENT) | 3× `sourcemap-ui` | #12764 moved
`.error-viewer-container` → data-test and dropped `.tags-title` |
rumPage selectors + `data-test="error-tags-title"` hook | ✅ local |
| **Logs-Features** (ENT) | `searchPatterns … wildcard chips` | chip
moved from `.wildcard-chip` class to `<OTag
data-test="pattern-card-wildcard-chip">` | target the data-test hook | ✅
local |
| **Traces** (ENT) | `service-graph` user/search-service status | health
badge moved from `.health-badge.<status>` classes to `<OTag
data-test="service-health-badge">` | read status from the badge's text |
⚙️ ENT CI¹ |
| **Dashboards-Core** | `line chart … camelCase zero values` | *(not
#12764)* a line chart whose series are entirely zero renders "No Data" |
one series counts all rows so the chart always renders | ✅ local |

¹ Traces service-graph needs an enterprise daemon that isn't available
locally; validated against the component's own unit spec
(`ServiceGraphNodeSidePanel.spec.ts`), confirmed on ENT CI.

## Root-cause themes
1. **#12764 (scoped SCSS removal)** deleted/renamed CSS classes that E2E
page objects targeted. It added `data-test` hooks to *some* elements but
not others — so tests anchored on bare `.class` selectors broke. The fix
everywhere is to move those anchors to durable `data-test` hooks.
2. **`OTag`/`OSelect` component migrations on `main`** continued this:
the components gained `data-test` hooks but the (enterprise-only) page
objects were never updated. Because those specs are `@enterprise`, OSS
CI never runs them — so they merged broken and only surfaced on the
enterprise build.

## Product-code touched (test hooks only, inert)
- `SearchBar.vue` — `data-fullscreen` attribute (no CSS/JS/snapshot
consumers; styling still driven by the existing `isFocused` class
binding)
- `ErrorTags.vue` — `data-test="error-tags-title"`

Everything else is under `tests/ui-testing/`.

## Verification
Verified locally against a fresh frontend build (all green): Streams
`#9337`, Alerts `#9967`, RUM (3), Dashboards-Core, Logs-Features
searchPatterns. Traces service-graph is validated via its component unit
spec + the enterprise CI run (it can't run locally without the
service-graph daemon).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 14:40:10 +00:00
ktx-vaidehi d5be6d53ca fix: build warning and remove unnecessary log (#12991) 2026-07-02 13:26:11 +00:00
Abhay Padamani 8645ae3201 fix: incident page ui improvement (#12927)
- incident page ui improvements
- play/resume button green across application
- pause button red across application
- Chip/Badge migration
2026-07-02 11:43:40 +00:00
de5f4037c9 feat: FE shortcut support (#12460)
Design at:
https://github.com/openobserve/designs/blob/main/ux/keyboard-shortcuts/design.md

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 07:18:36 +00:00
da867fb16a fix: scoped scss styles removal (#12764)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: ktx-mihir <mihir.patel@kiara.tech>
Co-authored-by: ktx-abhay <abhay.padamani@kiara.tech>
Co-authored-by: ktx-vaidehi <vaidehi.akhani@kiara.tech>
Co-authored-by: ktx-vaidehi <134508096+ktx-vaidehi@users.noreply.github.com>
Co-authored-by: Bhargav <BJP232004@GMAIL.COM>
Co-authored-by: ktx-akshay <akshay.patil@kiara.tech>
2026-07-02 06:21:33 +00:00
5122275d05 feat: agent level filters (#12691)
- **add agent filters, agent name mapping and normalization**
- **chore: update translations from en.json**
- **agent filter, rebased**

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: sai nikhil kethe <nikhil@openobserve.ai>
Co-authored-by: ktx-abhay <abhay.padamani@kiara.tech>
2026-07-01 18:08:46 +00:00
Omkar KesarkhaneandClaude e5319388dd fix: RED queries missing filter/date after brush selection in traces (#12967)
#12854 

## What changed

Fixes a race condition where RED (metrics) queries were missing the
error filter on first click when `auto_query_enabled` is true. The root
cause was that `onDataZoom` in `TracesMetricsDashboard.vue` emitted
`"time-range-selected"` *after* `"filters-updated"`, so queries
triggered by the filter change ran with stale time range data. The fix
reorders these two events and adds `await nextTick()` between them.
Additionally, the `filter` and `timeRange` props were removed from
`TracesMetricsDashboard.vue` — the component now reads `editorValue` and
`datetime` directly from `searchObj.data`, and the `setCustomDate.vue`
component moves `markProgrammaticDateChange` to the end of the save
flow.

## Why

The bug (RED queries not receiving the latest error filter on first
auto-query) was caused by event ordering: `"time-range-selected"` fired
after `"filters-updated"`, meaning the query triggered by the filter
change used the previous time range. The second click worked because by
then the cached time range had caught up. The decision to remove
`filter`/`timeRange` props was driven by a dependency on `searchObj`
data that is always available; passing them as separate props introduced
an unnecessary synchronization risk.

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-01 09:03:10 +00:00
Bhargav cb06f07118 fix: logs menu item pin option & theme related minor fixes (#12964) 2026-07-01 07:48:51 +00:00
Bhargav 7db90b20d0 fix: added SQL toggle button (#12923) 2026-06-29 10:12:56 +00:00
5e7e147c9d fix: table column visual changes + chip changes (#12907)
Co-authored-by: Kirtan Thakkar <kirtan@kiara.tech>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 14:34:35 +00:00
BhargavandClaude Opus 4.8 45793bf76c fix: persist theme selection by name with redesigned theme drawer (#12890)
Theme selection across light and dark modes is now persisted by name
instead of numeric ID. A shared registry (constants/themes.ts) owns the
single source of truth for all predefined theme definitions, and
utils/themeManager.ts provides a central applyCurrentTheme() /
applyThemeForMode() API that replaces scattered inline resolution logic
in App.vue and PredefinedThemes.vue. Custom themes continue to store
their hex color as the source of truth, marked with the
CUSTOM_THEME_NAME sentinel.

The theme drawer is redesigned: a segmented Light/Dark toggle replaces
the tabs, each theme is a single clickable row (no per-row Apply
button), the applied theme is highlighted with a primary ring plus an
Applied badge, long names truncate instead of wrapping, and the custom
color row opens the picker with an Apply/Cancel dialog.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 12:12:32 +00:00
Bhargav 8da9959293 fix: timestamp in human redable format based on selected timezone (#12899) 2026-06-26 12:08:47 +00:00
Bhargav 1473034459 fix: empty state changes (#12898) 2026-06-26 08:18:55 +00:00
Bhargavandgithub-actions[bot] befc4604c0 fix: Logs traces empty pages and timestamp changes synced (#12885)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-25 16:00:28 +00:00
f5a14afbe9 chore: logs page displays fts default columns (#12857)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Shrinath Rao <shnath@openobserve.ai>
2026-06-25 14:13:33 +00:00
Ashish Kolhe 060e02c655 chore: correlated metrics tab fixes (#12866) 2026-06-24 22:08:17 +05:30
Bhargavandgithub-actions[bot] c494fe93f9 fix: Issue 12803 language translation fix (#12839)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-24 10:03:43 +00:00
2975f75b92 chore: service catalog progress bars + alert history flapping timeline (#12844)
## Summary

- **Service Catalog**: Add progress bars to latency and error rate
columns (P50, P95, P99, Avg Duration, Max Duration, Error Rate), scaled
relative to the column maximum across all filtered services. Raw count
columns (Requests, Errors) kept as plain text to avoid misleading
comparisons.
- **Service Graph Side Panel**: Extend the same progress bar treatment
to the Operations tab and K8s/resource tabs. Remove the outer border box
from RED charts using `:frame="false"` on `RenderDashboardCharts`.
- **Alert History Timeline**: Add a colored strip visualization above
the history table showing firing (red), ok (green), and flapping
(purple) zones across the selected time range. Flapping zones are
detected automatically based on rapid state alternation and shown as a
single collapsed row in the table with transition count and duration.
Status labels normalized — `completed` → Firing,
`condition_not_satisfied` → Ok.

## Changes

### New files
- `web/src/plugins/traces/components/ServiceCatalogBarCell.vue` —
reusable bar cell (label + OProgressBar, scaled to column max)
- `web/src/components/alerts/AlertHistoryTimeline.vue` — state strip
with flapping zone detection, hover tooltips, transition timestamps

### Modified files
- `web/src/plugins/traces/ServicesCatalog.vue` — column maxes computed,
bar cells wired up, column order adjusted
- `web/src/plugins/traces/ServiceGraphNodeSidePanel.vue` — progress bars
on ops/resource tabs, `:frame="false"` on RED charts
- `web/src/components/alerts/AlertHistoryDrawer.vue` — timeline
integrated, flapping row grouping, status label normalization

## Test plan

- [ ] Service Catalog: verify progress bars scale correctly when
filtering services, bars absent on Requests/Errors columns
- [ ] Service Graph side panel: progress bars visible on Operations tab
P95/P99/P75; RED charts have no outer border box
- [ ] Alert History: open an alert with mixed firing/ok history —
timeline strip appears above table
- [ ] Alert History: open an alert with rapid firing↔ok alternation —
purple Flapping zone visible in strip, flapping rows collapsed in table
with expand chevron
- [ ] Alert History: status badges show "Firing" for
completed/error/anomaly, "Ok" for condition_not_satisfied
- [ ] Dark mode: all components render correctly with theme tokens

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: ktx-vaidehi <vaidehi.akhani@kiara.tech>
2026-06-24 09:25:21 +00:00
Bhargav f34da4129c fix: fixed run query and cancel query button UI (#12827) 2026-06-23 09:18:25 +00:00
Ashish Kolheandgithub-actions[bot] 0e0f9d2762 chore: menu bar font size (#12795)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-22 09:46:19 +00:00
ktx-mihirandgithub-actions[bot] 8b3bd75783 fix: ux revamp form validation migration v1 (#12747)
- Form with zod validation migration for dashboards , getstarted ,
createdestination(pipeline) , addregexpattern

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-19 11:30:27 +00:00
Bhargav 29475e9b8e fix: Logs page UI fixes (#12757) 2026-06-19 05:07:20 +00:00
Sai Nikhil 78aa35cd00 fix: ai observability issues (#12762)
1. The name is missing on score config list table

datetime error when user is clicking on arrow in quality page / any one
of the score config overview

replace hardcoded badges to obadge in all list page

when user goes to llm sessions it is taking user to traces submenu
2026-06-18 18:15:04 +00:00
Omkar Kesarkhane ea6c34ef90 fix: added streaming progress bar in logs explorer (#12741)
## What changed

Adds a streaming progress bar (the same `LoadingProgress.vue` used by
dashboard panels) to the logs results table and histogram chart. The
skeleton loader in `TenstackTable.vue` now hides once any rows exist,
keeping data visible while streaming updates replace values in-place.

## Why

During `streaming_aggs`, hits arrive and replace chunk-by-chunk while
`loading` stays `true` until the stream `end` signal. The full skeleton
covered the table on every refresh, so users couldn't watch the
incremental updates. The progress bar signals an in-progress refresh
without hiding existing data.
2026-06-18 05:58:54 +00:00
Omkar Kesarkhane 72c028b244 fix: Field list field-expansion fixes (#12731)
## What changed

- **FieldValuesPanel.vue** — Added `tw:relative` to the loading wrapper
so the `OInnerLoading` overlay (which is `absolute inset-0`) is
contained within the expanded section instead of spilling over the
entire field row.
- **IndexList.vue** — Reworked `cancelTraceId` to use
`cancelStreamQueryBasedOnRequestId` (HTTP stream abort) instead of the
now-removed `cancelSearchQueryBasedOnRequestId`. Updated
`cancelFilterCreator` to call `cancelTraceId`, clear `isLoading`, and
empty `traceIdMapper` entries.
- **FieldValuesPanel.spec.ts** — Regression test asserting the loading
wrapper carries `tw:relative`.
- **IndexList.spec.ts** — Un-skipped two previously skipped cancel tests
and updated them to assert on `mockCancelStreamQueryBasedOnRequestId`.
Added new regression tests for the `cancelFilterCreator` →
`cancelTraceId` flow on collapse.

## Why

The loading overlay (`OInnerLoading`) uses `absolute inset-0`
positioning. Without a positioned ancestor, it escaped to the nearest
parent (`.o-field-list__row`), covering the field row and the collapse
toggle. This made it impossible for users to collapse a slow-loading
field to cancel the request. The cancel logic itself was also broken —
it referenced a WebSocket-based cancel function that no longer matched
the actual HTTP-stream transport used for field values.
2026-06-17 10:04:10 +00:00
Bhargavandhengfei yang aed1c82562 fix: auto non-sql mode fix (#12725)
Co-authored-by: hengfei yang <hengfei.yang@gmail.com>
2026-06-17 08:50:49 +00:00
Omkar Kesarkhaneandgithub-actions[bot] b444ad3063 fix: added no state components for Service Graph and Services Catalog (#12662)
## What changed

- Created `useWidenRange` composable with extracted `periodToLabel` /
`nextWiderPeriod` pure functions to eliminate duplicate widen-range
logic across `ServiceGraphNoDataState`, `ServicesCatalogNoDataState`,
`TracesNoEventsState`, and `LogsNoEventsState`.
- Added `getEffectiveTimeRange` to `utils/date.ts` to deduplicate inline
datetime-parsing if/else blocks in `ServiceGraph.vue` and
`ServicesCatalog.vue`.
- Created two new animated SVG illustrations (`EmptyServiceGraph.vue` —
horizontal tree topology with one root node calling two children;
`EmptyServicesCatalog.vue` — table card with three service rows and
pulsing status dots), registered them in the OEmptyState preset system,
and added i18n keys across all 12 languages.
- Added dedicated empty-state components `ServiceGraphNoDataState.vue`
and `ServicesCatalogNoDataState.vue` with an "Expand time range" action
card (matching the `TracesNoEventsState.vue` pattern), wired via emit
chain through `ServiceGraph.vue` / `ServicesCatalog.vue` up to
`Index.vue`'s `onWidenTracesRange`.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-17 04:50:54 +00:00
Omkar Kesarkhane cec4fa5fe7 fix: Telemetry correlation header UI fixes (#12709)
## What changed

- Passes `matchedSetId` and `chipDimensions` as new computed props from
`IncidentDetailDrawer.vue` to the embedded
`TelemetryCorrelationDashboard`, enabling the "View by" subject tabs in
the incident view
- Adds an `OBadge` showing the selected subject as `label = value` after
the subject toggle tabs in `CorrelationEventHeader.vue`
- Fixes the responsive overflow logic so the first context chip can
overflow when space runs out, and the overflow indicator shows "N
Fields" when all chips are hidden instead of a bare "+N"
- Renders hidden overflow chips as stacked `OBadge` components in
`OTooltip`'s `#content` slot instead of a `\n`-joined string

## Why

Incidents opened without a source trace or log event had no
`matchedSetId` / `chipDimensions` passed to the correlation dashboard,
so the "View by" subject toggle (Pod, Node, etc.) never rendered. The
badge was also missing to visually indicate which subject is active.
2026-06-17 04:12:59 +00:00
Omkar Kesarkhane 7207ea1aba fix: traces error filter not getting reset on resetting query (#12702)
#12703 

## What changed

Removed the `showErrorOnly` key from `searchObj.meta` state and replaced
it with a `computed` property that derives from
`activeIncludeFilterValues` — specifically checking whether
`span_status` includes `"ERROR"`. The `SearchResult.vue` component now
receives `showErrorOnly` as a prop from `Index.vue` instead of reading
it from the shared composable state. `TracesMetricsDashboard.vue` had
its own writable `showErrorOnly` computed removed since it no longer
needs to sync a top-level state key.

## Why

The user identified that `showErrorOnly` was redundant state — the
information is already encoded in
`activeIncludeFilterValues["span_status"]`. Keeping both in sync was
unnecessary maintenance burden. Deriving it from the existing filter
state is the single source of truth and eliminates the risk of the flag
and the actual query filters diverging.
2026-06-16 12:21:43 +00:00
Windforce17andHengfei Yang 2fad21a807 perf(traces): order spans by timestamp column instead of start_time (#12692)
## What

In the traces **spans-mode** list view, the query was built as:

```sql
SELECT * FROM "<stream>" [WHERE ...] ORDER BY start_time <dir>
```

`start_time` is a regular column, so the engine has to perform a full
re-sort of the result set. This change makes the query order by the
configured timestamp column (`_timestamp`) whenever the active sort
column is the default `start_time`:

```sql
SELECT * FROM "<stream>" [WHERE ...] ORDER BY _timestamp <dir>
```

## Why

- Span data is physically stored sorted by the timestamp column, and the
  backend has a dedicated optimizer for timestamp-sorted segments.
- A span's `_timestamp` is monotonically equivalent to its `start_time`,
  so the **visible row order is unchanged**.
- This avoids the costly full re-sort that `ORDER BY start_time` forces,
  improving query latency for the trace/spans view.

## Scope / Notes

- Change is contained to `web/src/plugins/traces/Index.vue`
  (spans-mode query builder in `getQueryData`).
- Only the default `start_time` sort is remapped. Any explicit
  non-`start_time` sort column the user picks is passed through
  unchanged.
- The `sortBy` UI state still reports `start_time`, so the sort
  indicator and reset logic are unaffected.
- Not in scope: the single-trace span fetch in `TraceDetails.vue` still
  uses `ORDER BY start_time` (can be addressed separately).

## Testing

- Verified the generated spans SQL now uses the timestamp column for the
  default sort and produces the same visible ordering.

Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
2026-06-16 08:21:41 +00:00