## Summary
- Enhanced existing scheduled pipeline query builder tests with exact
default query format assertions (`max(_timestamp)`, `count(_timestamp)`,
`histogram(_timestamp)`)
- Added new P2 test verifying Run Query button transitions from disabled
to enabled after stream selection and default query population
- Verifies behavior described in Issue #11575
## Test plan
- [x] All 4 tests pass (verified on test environment)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
## Summary
- Normalize `ZO_FILE_FORMAT` to `parquet` for non-enterprise builds.
- Preserve configured file format values for enterprise builds.
- Add targeted tests for both non-enterprise and enterprise behavior.
## Why
Non-enterprise builds should not fail startup because `ZO_FILE_FORMAT`
is configured to an enterprise-only format. Instead, they now continue
with parquet as the supported storage format.
## Validation
- `cargo test -p config test_non_enterprise_file_format_forces_parquet`
- `cargo test -p config --features enterprise
test_enterprise_file_format_preserves_configured_value`
- `git diff --check`
Note: the test run reports an existing unrelated unused import warning
in `src/config/src/meta/user.rs`.
## What changed
Fixed `addFieldTerm` in `SearchBar.vue` so that include/exclude search
terms are inserted at the correct position in SQL aggregation queries.
Previously the code checked for `ORDER BY` before `GROUP BY`, causing
the injected `WHERE` clause to land after `GROUP BY` (invalid SQL). The
fix scans all terminating clauses (`GROUP BY`, `HAVING`, `ORDER BY`,
`LIMIT`) and inserts `WHERE` before whichever appears earliest. The
remaining diff is Prettier-driven reformatting with no logic changes.
## Why
The old sequential `if/else if` checked `ORDER BY` first. On a query
containing both `GROUP BY` and `ORDER BY`, it would split at `ORDER BY`
and produce `… WHERE <filter> ORDER BY … GROUP BY …` — structurally
invalid SQL. The fix enforces correct SQL clause ordering (`FROM → WHERE
→ GROUP BY → HAVING → ORDER BY → LIMIT`).
## Approach
The new algorithm iterates over all four terminating clauses, records
the index of each that is present, picks the one with the smallest index
(`firstClause`), then uses the existing `queryIndexSplit` utility to
splice the `WHERE <filter>` token in before it. If no terminating clause
exists the filter is appended. The spec file was extended with 14 new
unit tests covering the core bug scenario (GROUP BY + ORDER BY
together), each individual clause in isolation, all-clauses-present,
AND-append paths, and edge cases (case-insensitive matching, column
names containing clause keywords, special characters in filter values).
## Risk
The logic change is isolated to the `else` branch of `addFieldTerm` that
handles queries with no existing `WHERE` clause. Queries that already
have a `WHERE` clause follow a separate code path and are unaffected.
Reviewers should confirm the `queryIndexSplit` utility is
case-insensitive-safe (the fix lowercases only for the index scan, then
splits the original string) and verify the preserved trailing
`afterClause` string includes the space/newline that was previously part
of the `" order by"` / `" group by"` literals.
## Summary
- Add API tests verifying that stream settings fields (index_fields,
bloom_filter_fields, full_text_search_keys) are deduplicated when the
same field is added multiple times
- Tests cover: single field dedup, multiple fields, repeated adds (4x),
remove+re-add, empty payloads, and partial updates
- All tests use existing schema fields from the seed data stream
(`stream_pytest_data`)
## Test plan
- [x] All 10 tests pass against testing environment
- Tests run via `cd tests/api-testing && rye run pytest
tests/test_stream_settings_dedup.py -v`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude <noreply@anthropic.com>
design at: designs/anomaly-detection
## Summary
Adds super cluster sync support for anomaly detection configs and fixes
a missing FK constraint on `anomaly_detection_config.folder_id`.
**Super cluster sync:**
- Add `infra::table::anomaly_detection` module with config CRUD ops
(`create`, `create_if_not_exists`, `update`, `put`, `delete`,
`get_by_id`, `list`)
- Add `super_cluster_queue::anomaly_detection` handler for
`ConfigCreate`, `ConfigUpdate`, and `ConfigDelete` events
- Refactor `service::anomaly_detection` and `scheduler::handlers` to use
the new table module instead of raw SeaORM entity queries
- Refactor `super_cluster_queue::scheduler` to use new table module
- Reschedule trigger instead of deleting when config not found locally —
handles SC race where trigger row arrives before `ConfigCreate` NATS
message is processed
**Migration / referential integrity fix:**
- Add migration `m20260504` to retrofit the missing `FOREIGN KEY
(folder_id) REFERENCES folders(id)` constraint on
`anomaly_detection_config` (alerts and dashboards have had this since
creation; anomaly detection was missing it)
- Pre-migration repair: any rows whose `folder_id` no longer exists in
`folders` (orphaned by folder deletion) are re-pointed to the org's
default Alerts folder before the constraint is added — prevents
migration failure on existing deployments
- Add folder existence check inside transaction in `create()` —
eliminates TOCTOU race between folder lookup and INSERT
- Add folder existence check in `update()` when folder is changing —
matches `alerts::update` behaviour
- Add `PutAnomalyConfigError::FolderDoesNotExist` error variant matching
the alert/dashboard error pattern
## Files changed (11)
- `src/infra/src/table/anomaly_detection/` — new module (config.rs,
mod.rs, models.rs)
- `src/super_cluster_queue/anomaly_detection.rs` — new SC queue handler
- `src/infra/src/table/mod.rs` — register new module
- `src/super_cluster_queue/mod.rs` — wire anomaly_detection handler
- `src/service/anomaly_detection.rs` — refactored to use new table
module
- `src/service/alerts/scheduler/handlers.rs` — refactored; reschedule on
missing config
- `src/super_cluster_queue/scheduler.rs` — refactored to use new table
module
- `src/infra/src/errors/mod.rs` — add
`PutAnomalyConfigError::FolderDoesNotExist`
-
`src/infra/src/table/migration/m20260504_000001_add_anomaly_detection_config_folder_fk.rs`
— new migration
- `src/infra/src/table/migration/mod.rs` — register migration
## Test plan
- [x] Anomaly config create/update/delete broadcasts appear in SC queue
logs on primary region
- [x] Follower region receives and applies `ConfigCreate`,
`ConfigUpdate`, `ConfigDelete`
- [x] Trigger reschedule (not delete) when config not yet synced to
follower
- [x] Create with non-existent folder returns clean `FolderDoesNotExist`
error
- [x] Update moving config to non-existent folder returns clean
`FolderDoesNotExist` error
- [x] Migration runs clean on existing DB with no orphaned rows
- [x] Migration repairs orphaned `folder_id` rows before adding FK
constraint
- [x] `cargo check --workspace` passes
## What changed
Replaced `VueJsonPretty` (`vue-json-pretty`) with `CodeQueryEditor.vue`
(Monaco-based) for JSON rendering in `LLMContentRenderer.vue`. Inlined
the `MessageItem` sub-component directly into the template with
`CodeQueryEditor` for JSON message content. Added `showLineNumbers` and
`stickyScroll` props to `CodeQueryEditor`. Removed the unused
`vue-json-pretty` dependency from `package.json`. Passed unique editor
IDs from `TraceDetailsSidebar` via a new `instanceId` prop to prevent
Monaco editor ID collisions.
## Why
`vue-json-pretty` formats the entire JSON tree on initial render,
causing lag on long JSON payloads. Monaco (via `CodeQueryEditor`)
renders only visible viewport lines, making performance O(visible)
instead of O(total).
## Approach
- Replaced all 7 `VueJsonPretty` instances in `LLMContentRenderer.vue`
with `<CodeQueryEditor>` in read-only mode (`:read-only="true"`,
`:show-line-numbers="false"`, `:sticky-scroll="false"`)
- Inlined the `MessageItem` sub-component as a `v-for` block with
`CodeQueryEditor` for JSON message content and the existing `v-html`
markdown renderer for non-JSON content
- Converted the component to `<script setup lang="ts">` with
`defineAsyncComponent` for `CodeQueryEditor`
- Added `showLineNumbers` and `stickyScroll` props (both default `true`)
to `CodeQueryEditor.vue` to support the JSON viewer use case
- Added a `watch` on `showLineNumbers` to dynamically toggle line
numbers in Monaco
- Passed `instanceId` from `TraceDetailsSidebar` down to
`LLMContentRenderer` to generate unique editor IDs like
`trace-id-msg-json-editor-0`
## Considered & rejected
- **Render function approach with synchronous import of
CodeQueryEditor** — rejected because it forced manual editor height
computation and module-level counters for editor IDs. Inlining
`MessageItem` as a template component was cleaner and consistent with
the other 5 template `CodeQueryEditor` locations.
- **Retaining `MessageItem` as a separate component with render
function** — rejected because the render function approach was
over-engineering for what is now a simple `v-for` with conditional
`CodeQueryEditor` / markdown branching.
## Risk
Medium. Monaco editor initialization has non-trivial overhead; rendering
multiple editors on one page (e.g., many messages in a conversation)
could impact initial render time. Reviewers should check that the
`instanceId` prop is correctly wired from `TraceDetailsSidebar` to avoid
duplicate Monaco editor IDs, and that the `tw:h-full` class application
on content-wrapper divs doesn't break non-JSON (plain text / markdown)
layouts.
Three fixes in alertCreationWizard.js:
- Align threshold operator dropdown with working SQL method pattern
(q-field__control click + role-based option + q-menu fallback)
- Narrow portal cleanup from all q-portal to q-portal--dialog only to
avoid hiding new dropdown menus
- Fix _switchToTab to target v3 inner tab divs instead of wrapper
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
## What changed
Removed the `label` property from important field entries pushed into
`selectedStreamFields` in the traces `extractFields()` function.
## Why
The `label` field was redundant — it duplicated the `name` property —
and caused display issues in the traces fields sidebar where both `name`
and `label` were shown. The data model already uses `name` as the
display key.
## Approach
Stripped the `label: rowName` assignment from the important fields
branch in `extractFields()`.
## Risk
The field removal changes the object shape pushed to
`selectedStreamFields` for important fields. Verify that no downstream
code (field grouping, semantic matching, search building) depends on
`field.label` being present.
- API-first methods in alertTemplatesPage.js (_findTemplateViaApi,
createTemplateViaApi, deleteTemplateViaApi) to bypass fragile UI
pagination
- API-first destination lookup in alertDestinationsPage.js
(findDestinationViaApi) resolves cascade failure
- v3-compatible locators for alert type dropdown, condition operators,
deduplication flow in alertCreationWizard.js
- Self-contained test pattern with per-test random suffixes and no
shared state
- URL-based navigation with menu fallback for templates and destinations
pages
- q-portal cleanup before click interactions to prevent interception
- Conditional enterprise feature guards at runtime
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude <noreply@anthropic.com>
## Summary
- Add optional `is_llm_stream` field to `UpdateStreamSettings` so the
stream settings update API can toggle the flag.
- Apply the value in `update_stream_settings` alongside the other
boolean toggles.
## Why
`StreamSettings` already exposes `is_llm_stream`, but the update API had
no way to change it. This brings the update payload in line with the
underlying setting so callers can flip the flag without going through a
different code path.
## Test plan
- [x] `cargo check` passes (verified locally)
- [x] PATCH stream settings with `{"is_llm_stream": true}` updates the
stored value
- [x] Omitting `is_llm_stream` leaves the existing value unchanged
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
**Problem:**
Backend sent cumulative `took` per partition (monotonically increasing:
69, 130, 192...ms). Frontend summed all values → O(n²) inflation (e.g.
23s displayed vs 1.4s actual).
**Fix:**
- Backend: timer now created independently per partition → each
partition reports only its own processing time
**Result:** `took = search + histogram` sums correctly. Verified against
SSE data for both no-cache and cache flows
## Summary
Design at: #11532
Closes
[#11532](https://github.com/openobserve/openobserve/issues/11532).
Adds a new reset component so operators can re-run compaction over a
stream's
historical file_list:
```
./openobserve reset -c file-list-jobs [-t <microseconds>]
```
The command performs three things:
1. **Safety check** — calls `infra::cluster::list_nodes()` and aborts
with an
error if any dedicated compactor node is online (the operator must stop
them first). If a `single_node` (Role::All) node is online, prints a
warning that it must be restarted after the reset so its in-memory
compact state is cleared.
2. **Reset compact offsets** — `db::compact::files::reset_offset(time)`
lists
every `/compact/files/` key in meta and rewrites its value to `time`
(defaulting to `0`), then clears the in-process offset cache.
3. **Re-queue jobs** — calls `infra_file_list::set_job_pending(&[])`,
which
now treats an empty ids slice as "reset all rows", flipping every
`file_list_jobs` row back to `Pending` and clearing `node`,
`started_at`, `updated_at`.
`set_job_pending` previously returned `Result<()>`; it now returns
`Result<u64>` so callers (and the new CLI output) can report rows
affected.
The existing call site in `service/compact/mod.rs` is unaffected because
it
ignores the Ok value.
## Test plan
- [x] `./openobserve reset -c file-list-jobs` against a stack with no
compactor running — verify offsets are 0 and all jobs are Pending
- [x] `./openobserve reset -c file-list-jobs -t 1700000000000000` —
verify
offsets are written as the supplied microsecond timestamp
- [x] Run while a compactor is online — verify the command errors with
the
offending node name
- [x] Run on a single_node deployment — verify the warning is shown and
operation still completes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Design at: #11518
## Summary
- Add `llm_input` and `llm_output` to the default SQL full text search
field list so LLM-related streams get FTS out of the box without needing
to set `feature_fulltext_extra_fields`.
## Test plan
- [x] Verify a stream with `llm_input` / `llm_output` columns is
searchable via `match_all` without extra config.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
## Summary
- Replace `SELECT *` Q2 with grouped aggregations so per-trace
enrichment is bounded by N rows instead of total span count.
- Q2a aggregates per `trace_id`: span count, error count, min/max times,
max duration, root span labels (with first-by-timestamp fallback), and
`approx_distinct(service_name)` to gate Q2b.
- Q2b runs only for multi-service traces, returning per-`(trace_id,
service_name)` count and max duration.
## Root cause
When a user filters Traces by Duration, Q2 ran `SELECT * FROM stream
WHERE trace_id IN (...)` and aggregated spans in Rust. For traces with
tens of thousands of spans, the search-service row cap was hit before
every `trace_id` got at least one span back. The un-enriched entries
were still sent to the FE with `spans=[0,0]`, `duration=0`,
`first_event=null` — the blank rows in the screenshot on the issue.
The new Q2a returns one row per `trace_id` (≤ N rows total), so it
cannot trip the row cap. Single-service traces are fully populated from
Q2a alone; only multi-service traces require Q2b. Response shape
(`TraceResponseItem`) is unchanged — `first_event` is now built as a
synthetic `{service_name, operation_name}` object so the FE in
`web/src/composables/useTraces.ts` keeps working unchanged.
Applied to both `get_latest_traces` and `process_latest_traces_stream`.
Closes#11505
## Test plan
- [ ] Open Traces, pick a stream with traces that have many spans (≥10K
spans/trace).
- [ ] Filter by Duration `<= Max value`. Confirm no blank rows; every
row has a service icon, service name, non-zero duration, and a span
count.
- [ ] Single-service stream: confirm the services list under each trace
is correct.
- [ ] Multi-service trace (e.g., a trace that crosses several services):
confirm the per-service breakdown still appears (Q2b path).
- [ ] Sort by duration ASC and DESC.
- [ ] Sort by start_time ASC and DESC.
- [ ] LLM stream: confirm LLM token / cost columns still populate.
- [ ] Pagination: page 1, page 2, page N — every page has fully
populated rows.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Hengfei Yang <undefined@users.noreply.github.com>