Commit Graph
1214 Commits
Author SHA1 Message Date
udev 6761ce2dbf fix: refactor online evals (#12654)
move online evals to enterprise repo
2026-06-15 10:13:55 +00:00
143bff7330 fix: add API for triggering license limit check manually (#12621)
This adds a UI and API based trigger for re triggering license check
limits, so we do not have to restart nodes

---------

Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
Co-authored-by: Yashodhan Joshi <yjdoc2@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-15 09:53:53 +00:00
Subhra264 f0428d318d fix: add roles api to replace multiple api calls to get role permissions (#12606)
Currently, on the roles edit page, the frontend makes role permission
api for each and every resources. So, for current 41 resources, there
are 41 concurrent api calls, each going through the openfga rbac check
middleware. That means, there are 41 concurrent redundant openfga
checks, and then 41 openfga query to get the role permissions.

This pr adds another api `org_id/roles/role_name/permissions` that
combines all the resource permissions of the given role name and return
the same eliminating the need for making api calls for each rbac
resource.
2026-06-15 05:39:02 +00:00
udevandsai nikhil kethe 12fffe4709 fix: online evals rbac list and edit role page (#12623)
- **edit role fixes**
- **fix rbac list apis**

---------

Co-authored-by: sai nikhil kethe <nikhil@openobserve.ai>
2026-06-12 09:41:07 +00:00
Manan Shukla ee1237a0b1 fix: resolve "no querier online" when ZO_NODE_ROLE_GROUP=interactive by replacing is_http_req with SearchEventType-based RoleGroup (#12601) 2026-06-11 22:08:06 +08:00
ff8a579bdc fix: eval templates removal (#12595)
1. This PR removes Evaluation templates from pipeline module
2. removes LLM evaluation node from pipeline editor 
3. remove LLM evaluation creation tab from schema details

---------

Co-authored-by: Ashish Kolhe <35160958+oasisk@users.noreply.github.com>
Co-authored-by: udev <uddhav@openobserve.ai>
2026-06-11 12:45:33 +05:30
Yashodhan JoshiandYashodhan Joshi 2940e576f1 fix: show cost when possible in usage (#12520)
Adds support to show tentative cost in usage page in cloud

---------

Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
Co-authored-by: Yashodhan Joshi <yjdoc2@gmail.com>
2026-06-10 15:29:57 +00:00
Abhay PadamaniandHengfei Yang b3393648b4 feat: add environment variable for timechart tab visibility (#12552)
Design At: `ZO_TIMECHART_ENABLED` to enable timechart tab on logs page

---------

Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
2026-06-10 12:03:22 +00:00
4bb15def42 fix: prebuilt templates visible on cloud + write-protected + no frontend hardcoding (#12467)
## Summary

- **Cloud visibility**: `list()` in `src/service/db/alerts/templates.rs`
was gating `DEFAULT_ORG` templates behind `!cfg!(feature = \"cloud\")`,
so any non-default org on cloud received an empty template list. Removed
the flag entirely — all `DEFAULT_ORG` templates (prebuilt and custom)
are now visible to every org, matching the existing ENT behaviour. This
is safe because cloud org identifiers are UUID-assigned; no regular user
can create an org named `default`.
- **Prebuilt templates fully read-only for non-root**: previously only
delete was blocked (403); updates were silently allowed. Now both
`save()` and `delete()` return `PrebuiltReadOnly` (403) for non-root
callers. Root users retain full access via `is_root_user()` bypass
(consistent with existing patterns in the codebase). Create with a
reserved name returns `ReservedName` (400) for everyone including root.
- **Frontend hardcoding removed**: `AddDestination.vue` was using a
`DEFAULT_TEMPLATE_SENTINEL` (`"__default__"`) and constructing prebuilt
template names client-side. Dropdown is now populated from the
`isPrebuilt: true` entries returned by `GET /alerts/templates`.
`TemplateList.vue` edit button now matches delete: shown-but-disabled
with `systemReadOnly` tooltip for prebuilt rows.

## Root cause

The `!cfg!(feature = "cloud")` flag in `list()` was added to prevent
`DEFAULT_ORG` data bleeding across cloud tenants. This correctly scopes
custom templates but also hides system prebuilt templates that every org
needs. Since prebuilt templates are now enforced as read-only
(non-root), exposing all DEFAULT_ORG templates to all orgs carries no
cross-tenant mutation risk.

## Test plan

- [ ] Non-default org on cloud: `GET /api/{org}/alerts/templates`
returns `prebuilt_slack`, `prebuilt_email`, etc. with `isPrebuilt: true`
- [ ] Non-root user: `PUT /api/{org}/alerts/templates/prebuilt_slack`
returns 403
- [ ] Non-root user: `DELETE /api/{org}/alerts/templates/prebuilt_slack`
returns 403
- [ ] Root user: `PUT /api/{org}/alerts/templates/prebuilt_slack`
succeeds
- [ ] Root user: `DELETE /api/{org}/alerts/templates/prebuilt_slack`
succeeds
- [ ] Any user: `POST /api/{org}/alerts/templates` with name
`prebuilt_slack` returns 400
- [ ] Destinations page: prebuilt destination template dropdown shows
`prebuilt_<type>` sourced from API
- [ ] `TemplateList`: edit button disabled (not hidden) for prebuilt
rows, with "System Read Only" tooltip

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

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-09 17:47:41 +00:00
Sai Nikhilandudev 57e57a56c9 fix: import and export functionality for score and score configs in llm evals (#12517)
Co-authored-by: udev <uddhav@openobserve.ai>
2026-06-09 05:38:24 +00:00
Hengfei YangandClaude Opus 4.8 39826a4428 feat: inferred services for traces (#12515)
## Inferred services for traces

Design at: #12515

Uninstrumented dependencies (databases, redis, kafka, external APIs) are
invisible in trace views today because OpenObserve only surfaces the
instrumented `service_name`. Users ask "why can't you see we call the db
or redis?". This adds **inferred services**: we derive a minimal
identity for those dependencies from CLIENT/PRODUCER span peer
attributes and surface them in the traces list and the service map.

### What's included
- **Ingestion** — derive three fields on CLIENT(3)/PRODUCER(4) spans
following OTel semantic conventions (current + legacy names):
`infer_service_name`, `infer_service_type`
(`database`/`queue`/`rpc`/`external`), `infer_service_system` (e.g.
`postgresql`/`kafka`/`grpc`/`http`). `peer.service` wins naming; ports
are stripped and bare IPs redacted to avoid one node per pod IP. Wired
into both `handle_otlp_request` and `ingest_json`; the three field names
are added to `BLOCK_FIELDS` so a user attribute of the same name can't
shadow them.
- **Traces list** — the per-service time/cost breakdown now groups by
`COALESCE(infer_service_name, service_name)` (schema-gated) and returns
`service_type`, so dependencies appear in the distribution and the UI
can render them dotted.
- **Service graph** — a second, schema-gated SQL over CLIENT/PRODUCER
spans (anti-joined against instrumented services so a dep that *is*
instrumented elsewhere isn't double-counted) emits inferred edges with
`connection_type`; `ServiceNode.service_type` /
`ServiceEdge.connection_type` carry the inferred category for dotted
nodes/edges. The dependency has no server span, so its latency is the
client span's own duration.

### Backward compatibility
Every new SQL path is gated on the field's presence in the stream
schema, so streams that predate the feature (or never call an
uninstrumented dependency) generate byte-identical SQL — no "field not
found". Old parquet reads the field as NULL → `COALESCE` falls back to
`service_name` gracefully.

### Companion PR
Service-graph topology tagging (`build_topology`) lives in the
enterprise repo: **openobserve/o2-enterprise#1876**. Build/merge the two
together.

### Testing
- `cargo check` / clippy / fmt clean
- unit tests: inferred derivation (20), traces-list breakdown
serialization, config `service_graph` types; full traces suite (417)
passes
- verified end-to-end locally: an OTLP trace with a redis CLIENT span
shows up in `GET /traces/latest` as `service_type: database` and as a
dotted node on the service map

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 04:42:16 +00:00
Loakesh Indiran 436f04e3c0 fix: promql federated search (#12468)
Fixes #12461

## Problem

PromQL queries in a super-cluster returned data **only from the hub
cluster** — remote (spoke) clusters were silently skipped. SQL queries
across the same super-cluster worked correctly.

**Root cause:** The `data` gRPC handler on the spoke never registered
the incoming `trace_id` in `SEARCH_SERVER`. When the PromQL engine
called `insert_sender(trace_id)` to attach its abort channel, it found
no entry and immediately returned `SearchCancelQuery` (error code
20009). The spoke returned empty data with no visible error — the hub
received nothing from the spoke and returned only its local results.

The `query` gRPC handler already had the correct registration. The
`data` handler was missing it.

## Fix

Before spawning the data fetch task on the spoke, the `data` gRPC
handler now registers the incoming `trace_id` in `SEARCH_SERVER` as a
follower task — exactly the same registration the `query` handler
already performed. This allows the PromQL engine to successfully attach
its abort sender and proceed with execution. After the task completes,
the trace_id is removed from `SEARCH_SERVER` to avoid memory leaks.

## Test Queries

Ingest a metric with a distinguishing label to both hub and spoke, wait
~30s for WAL flush, then run:

**PromQL — before fix:** only hub cluster returned, spoke missing  
**PromQL — after fix:** both hub and spoke returned

```bash
curl -s "http://<hub-host>/api/<org>/prometheus/api/v1/query_range" \
  -u '<user>:<pass>' \
  --data-urlencode "query=sum by (cluster) (total_payment_req)" \
  --data-urlencode "start=$(($(date +%s) - 3600))" \
  --data-urlencode "end=$(date +%s)" \
  --data-urlencode "step=60"
```

**SQL — works both before and after (baseline check):**

```bash
curl -s -X POST "http://<hub-host>/api/<org>/_search?type=metrics" \
  -H "Authorization: Basic <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "query": {
      "sql": "SELECT cluster, SUM(value) as total FROM \"total_payment_req\" GROUP BY cluster",
      "start_time": '"$(($(date +%s) - 3600))"'000000,
      "end_time": '"$(date +%s)"'000000,
      "size": 10
    }
  }'
```
2026-06-06 00:37:27 +00:00
Subhra264 489862cc1f fix: report bulk delete and move api rbac (#12475) 2026-06-05 13:18:18 +00:00
Huaijin 7fbbcc4b02 perf: make split_batch_for_grpc_response based on the real memory size (#12466)
- close https://github.com/openobserve/o2-enterprise/issues/1865

## TODO
- [x] make split_batch_for_grpc_response based on the real memory sizew
- [x] coalesce and gc view before send to leader

```
SELECT trace_id, count(*) as cnt, max(_timestamp) as ts FROM "k8s_logs" group by trace_id order by cnt desc limit 10

utf8view enable:
main: 30s (15k batches send to leader)
this branch: 15s (1.5k batches send to leader)

utf8view disable:
main: 13s (42k batches send to leader)
this branch: 12s (1.5k batches send to leader)
```

one found is the AggregateExec's time_calculating_group_ids, utf8 is
faster than utf8view
2026-06-05 09:24:41 +00:00
0aab1ae261 feat: online evaluations (#12352)
- **feat(online-eval): add PipelineKind::Evaluation and dual realtime
pipeline support**
- **feat(online-eval): add provider, score_config, scorer, and
online_eval_jobs DB entities**
- **feat(online-eval): add config CRUD services and API handlers**
- **feat(online-eval): reconcile jobs into hidden evaluation pipelines**
- **feat(online-eval): add scorer preparation and execution backends**
- **feat(online-eval): write scores and evaluator traces to system
streams**
- **refactor(online-eval): remove legacy eval templates backend**
- **test(online-eval): add API integration coverage for eval resources**

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: sai nikhil kethe <nikhil@openobserve.ai>
2026-06-04 16:03:14 +00:00
Hengfei YangandClaude Opus 4.8 910cda7502 perf: cancel running search when client disconnects (#11904) (#12440)
## Summary

Fixes #11904 — streaming search kept running on the queriers even after
the user closed the browser tab.

The SSE search endpoints spawn the query in a detached task and stream
results back over `text/event-stream`. When the client disconnects, the
response stream is dropped and we stop *sending* results, but the
distributed query continued executing on the queriers, wasting resources
on results nobody will read.

This wires client disconnect into the existing query-cancellation
machinery.

## What changed

- **`SearchStreamGuard`** (`search/utils.rs`) — moved into the response
stream's closure so it shares the stream's lifetime. It marks itself
finished when a terminal event (`Done` / `Error` / `Cancelled`) is
produced; if the stream is dropped before that (client gone), its `Drop`
fires the cancel for the parent `trace_id`.
- **`cancel_query_internal`** (`search/query_manager.rs`) — best-effort
cancel for internal callers (no HTTP response), reusing the existing
super_cluster/regular split.
- Wired the guard into **`search_http2_stream`**,
**`values_http2_stream`**, and **`search_multi_stream`**.

Cancellation is keyed by the parent `trace_id`; the query manager
removes entries by prefix, so multi-stream sub-queries
(`{trace_id}-q{n}`) are covered by a single cancel.

## Notes

- Distributed cancellation is an **enterprise** feature (the whole
`cancel_query` / `QueryManager` path is enterprise-gated). On the
open-source build the guard only logs the disconnect; OSS already stops
sending once the channel closes.
- Normal completion never triggers a cancel (terminal-event →
`mark_finished`). Worst case on an edge race is a harmless no-op cancel
for an already-finished `trace_id`.
- Complements the existing manual "Cancel" button — same underlying
machinery, triggered automatically on disconnect.

This branch also includes an unrelated config tweak (`fix: enable
compact fast mode for local`) enabling compact `fast_mode` automatically
when running in local mode.

## Testing

- `cargo check` (OSS) and `cargo check --features enterprise` both clean
- Unit test for the guard state machine passes

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

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 00:11:31 +00:00
1b9c4c93e8 feat: super org (main) (#12380)
adds support for super org

---------

Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
Co-authored-by: Yashodhan Joshi <yjdoc2@gmail.com>
Co-authored-by: Bhargav <BJP232004@GMAIL.COM>
2026-06-03 14:27:15 +00:00
4ca42e29af feat: prebuilt template protection, per-destination templates, and correlation settings fixes (#12423)
## Summary

Combines #12414 (prebuilt template protection) and #12421 (correlation
settings + AI i18n + traces fixes).

### Prebuilt template protection + per-destination template selection
- Lets users attach a custom template to a prebuilt destination so
multiple destinations of the same type (e.g. three Slack channels) can
deliver different message bodies.
- Protects system-managed \`prebuilt_<type>\` templates from accidental
deletion (403) while still allowing edits; create with a reserved name
blocked (400).
- Adds Prebuilt/Custom badges, All/Prebuilt/Custom toggle on both
Templates and Destinations lists.
- Per-row Clone action on templates (\`Copy_of_<name>\` prefilled);
Template column on destinations list.
- Cross-type prebuilt template mismatches blocked in the dropdown (e.g.
\`prebuilt_servicenow\` cannot be selected for a Slack destination).
- Select-All fix in the shared OTable composable —
\`toggleAllRows\`/\`isAllSelected\`/\`isIndeterminate\` now respect
\`isRowSelectable\`.

Design at:
https://github.com/openobserve/designs/blob/main/alerts/prebuilt-template-protection/design.md

### Correlation settings visibility + AI i18n + traces tab fixes
- **Correlation Settings tab** always visible for enterprise: removed
unnecessary \`service_streams_enabled\` guard — route was always
registered, only the nav item was incorrectly gated.
- **Cross-alert fingerprint groups** hidden when org-level dedup is
disabled; save payload sanitises \`alert_fingerprint_groups\` to \`[]\`
when cross-alert dedup is off.
- **AI suggestion cards** use i18n prompt keys
(\`t('aiAssistant.capabilities.{id}.prompt')\`) instead of hardcoded
English — prompt keys added to all 12 locale files.
- **LLM Insights / Sessions tabs** always shown when \`showLLMUI\` is
enabled; org-switch re-mounts both components via \`:key\`.
- **LLMInsightsDashboard** layout, background, and empty-state alignment
fixed.

Fixes openobserve/o2-enterprise#1850, openobserve/o2-enterprise#1851,
openobserve/o2-enterprise#1852

## Changes

| Layer | File | What |
|---|---|---|
| Backend | \`src/service/alerts/templates.rs\` |
\`is_prebuilt_template_name()\` helper; block create with reserved name;
block delete of prebuilt; edit allowed. |
| Backend | \`src/service/db/alerts/templates.rs\` | New error variants:
\`PrebuiltReadOnly\` (403), \`ReservedName\` (400). |
| Backend | \`src/handler/http/request/alerts/templates.rs\` | HTTP
error mapping + two unit tests. |
| Backend | \`src/handler/http/models/destinations.rs\` | Public
Template DTO carries \`isPrebuilt: bool\`. |
| Frontend | \`web/src/components/alerts/AddDestination.vue\` | Template
dropdown for prebuilt destinations with sentinel-backed Default option;
edit-mode remap; i18n for all label strings. |
| Frontend | \`web/src/composables/usePrebuiltDestinations.ts\` |
\`templateOverride\` param on create/update; empty → backend default. |
| Frontend | \`web/src/components/alerts/TemplateList.vue\` |
Prebuilt/Custom badges, Clone action, delete-blocked for prebuilts,
All/Prebuilt/Custom toggle, prebuilts excluded from Select All. |
| Frontend | \`web/src/components/alerts/AddTemplate.vue\` | \`isClone\`
prop — pre-fill without entering update mode. |
| Frontend | \`web/src/components/alerts/AlertsDestinationList.vue\` |
New Template column (ellipsis + tooltip, Default badge),
All/Prebuilt/Custom toggle. |
| Frontend | \`web/src/lib/core/Table/composables/useTableSelection.ts\`
+ \`OTable.vue\` | \`selectableRows()\` helper; Select All respects
\`isRowSelectable\`; getter pattern restored for reactivity. |
| Frontend | \`web/src/ts/interfaces/alert.ts\` |
\`Template.isPrebuilt?: boolean\`. |
| Frontend |
\`web/src/components/alerts/OrganizationDeduplicationSettings.vue\` |
Hide fingerprint groups when org dedup disabled; sanitise payload. |
| Frontend | \`web/src/components/settings/index.vue\` | Remove
\`service_streams_enabled\` guard from Correlation Settings nav item. |
| Frontend | \`web/src/plugins/traces/Index.vue\` | Remove
\`hasLLMStreams\` guard from LLM Insights / Sessions tabs. |
| Frontend | \`web/src/plugins/traces/LLMInsightsDashboard.vue\` +
\`SessionsList.vue\` | \`:key\` on org identifier for re-mount on org
switch; layout fixes. |
| Frontend | \`web/src/plugins/traces/SearchBar.vue\` | AI suggestion
cards use i18n prompt keys. |
| Frontend | \`web/src/components/ai-assistant/welcome/\` | Capability
card prompts via i18n; all 12 locale files updated. |
| Frontend | \`web/src/locales/languages/en.json\` (+ 10 other locales)
| New keys: \`filter{All,Prebuilt,Custom}\`, \`templateDefaultBadge\`,
\`prebuiltBadge\`, \`prebuiltBadgeHint\`, \`customBadge\`, \`clone\`,
\`cloneTitle\`, \`systemReadOnly\`, \`templateDefaultOption\`,
\`templateHelp\`; toast key moved to \`alert_destinations.saved\`. |

## Compatibility
- **No schema migration.** "Is this a system template" is derived from
the name matching \`prebuilt_<canonical_type>\` where canonical types
are the eight registered in \`config/prebuilt-destinations.json\`.
- **No ENT changes needed.** Verified the enterprise tree does not
reference \`TemplateError\`, the public Template DTO, or the new helper.
- **API additive:** \`GET /alerts/templates\` response gains
\`isPrebuilt: bool\`.
- **API breaking (narrow):**
- \`POST /alerts/templates\` rejects the eight canonical reserved names
with 400.
- \`DELETE /alerts/templates/{name}\` rejects the eight canonical names
with 403.

## Test plan
- [x] \`cargo test --lib -p openobserve -- prebuilt_read_only
reserved_name\` — both pass
- [x] \`cargo check --bin openobserve\` — clean
- [x] \`vue-tsc --noEmit\` — exit 0
- [ ] Create 3 Slack destinations — each can be assigned a different
custom template
- [ ] Template dropdown for a Slack destination shows only custom
templates + Default sentinel (no \`prebuilt_servicenow\` etc.)
- [ ] Attempting to delete a \`prebuilt_\` template returns a 403 toast
- [ ] Attempting to create a template named \`prebuilt_slack\` returns a
400 error
- [ ] Clone button pre-fills \`Copy_of_<name>\` and saves as a new
template
- [ ] Select All on a mixed prebuilt/custom template page: prebuilt rows
unchecked, custom rows toggled
- [ ] Enterprise build: Correlation Settings visible in sidebar without
\`service_streams_enabled\`
- [ ] Correlation Settings: disable org dedup → fingerprint groups
section disappears; save → payload has empty
\`alert_fingerprint_groups\`
- [ ] Switch UI language → AI home suggestion cards send prompt in that
language
- [ ] Org with no LLM streams: LLM Insights + Sessions tabs still
visible with correct empty state
- [ ] Switch orgs on LLM Insights → data reloads for new org

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

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-03 08:30:27 +00:00
Hengfei YangandClaude Opus 4.8 ad9fef2242 fix: fuzzy tests (#12405)
- [x] Bulk ingestion panic
- [x] Create function panic
- [x] Dashboards/Alerts/Incidents panic when list data
- [x] Match http response error code
- [x] Skip some endpoint that fuzz can't generate data

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 05:12:57 +00:00
Subhra264 54296ae833 fix: create default ingestion token for existing orgs (#12412)
Fixes https://github.com/openobserve/openobserve/issues/12407. Instead
of running a migration, it creates the default ingestion token whenever
the GET ingestion token api is called.
2026-06-03 04:29:45 +00:00
Subhra264 1afaaa6b7f fix: use give user id in the TokenValidationResponse for ingestion ep (#12386)
In the TokenValidationResponse for auth for the ingestion endpoints, it
was earlier using a wrong user email. This pr fixes this.
2026-06-02 10:56:42 +00:00
Hengfei YangandClaude Opus 4.8 6cf1b51a49 feat: add timezone support to histogram() SQL function (#12401) (#12402)
Closes #12401  Design at: #12402

## What

Adds timezone support to the `histogram()` SQL function so buckets align
to a user's local time instead of always UTC.

## How to use

### 1. Per-query — 3rd argument to `histogram()`

```sql
SELECT histogram(_timestamp, '1 hour', '+08:00')            AS key, count(*) FROM "logs" GROUP BY key;
SELECT histogram(_timestamp, '1 day', 'America/Los_Angeles') AS key, count(*) FROM "logs" GROUP BY key;
```

### 2. Per-request — `timezone` field in the search payload

Applies to every `histogram()` in the query that has no 3rd argument
(including the bare 1-arg `histogram(_timestamp)` form):

```jsonc
POST /api/{org}/_search
{
  "query": {
    "sql": "SELECT histogram(_timestamp) AS key, count(*) FROM \"logs\" GROUP BY key",
    "start_time": 1704067200000000,
    "end_time": 1704153600000000,
    "timezone": "+08:00"
  }
}
```
or

```jsonc
POST /api/{org}/_search
{
  "query": {
    "sql": "SELECT histogram(_timestamp) AS key, count(*) FROM \"logs\" GROUP BY key",
    "start_time": 1704067200000000,
    "end_time": 1704153600000000,
    "timezone": "America/Los_Angeles"
  }
}
```

### Precedence

```
histogram() 3rd arg  >  request "timezone" field  >  UTC (default, unchanged)
```

### Accepted formats

- **Fixed offset:** `+08:00`, `-05:30`, `UTC`, `""` (empty = UTC)
- **IANA name:** `America/Los_Angeles`, `Asia/Kolkata`, … (resolved via
`chrono-tz`)

### Result semantics

The returned bucket value is **local wall-clock time** (same convention
as `date_format(field, fmt, tz)`) — e.g. a daily `+08:00` bucket comes
back as local midnight. No reconversion is needed by API / dashboard /
alert consumers.

## API changes

- `config::meta::search::Query` (the `/api/{org}/_search` request body)
gains an optional field:
- `timezone: Option<String>` — `#[serde(default, skip_serializing_if =
"Option::is_none")]`. Backwards compatible: absent ⇒ UTC, identical to
today.
- proto `cluster.SearchQuery` gains `optional string timezone = 17;`
(regenerated `cluster.rs`).

## Function changes

- `histogram(field, interval)` → now also accepts `histogram(field,
interval, timezone)` (optional 3rd arg).
- Rewrite (`RewriteHistogram` optimizer rule): when a timezone resolves
to a non-zero offset, the **source** timestamp is shifted by that offset
before `date_bin`, so buckets and returned values are in local
wall-clock time. The `date_bin` origin stays at UTC.
- New helpers in `config::utils::time`:
- `parse_timezone_to_offset_opt(&str) -> Option<i64>` — non-panicking
fixed-offset parse.
- `parse_timezone_to_offset_at(&str, reference_micros) -> Option<i64>` —
fixed offset, else resolves an IANA name to its offset at the reference
instant.
- Invalid timezone ⇒ clear query error (no panic).

## Notes / caveats

- **DST:** named zones resolve to a *single* offset at the query's time
window — exact for normal windows, off by 1h only for the slice of a
range that straddles a DST transition.
- **Logs UI unchanged:** the logs chart already converts UTC→local for
display, so the timezone is intentionally **not** injected into the logs
histogram SQL (that would double-convert). This feature targets raw SQL
/ dashboards / alerts / API.
- **No-timezone path is byte-identical to before** (offset 0 ⇒ unchanged
plan).

## Testing

- `config::utils::time`: fixed offsets, IST `+05:30`, `Asia/Shanghai`,
`America/Los_Angeles` winter (PST) & summer (PDT), invalid input.
- `rewrite_histogram`: daily/hourly local bucketing, request-timezone
fallback, 3rd-arg precedence, named-zone winter + summer DST. 11 tests,
all green.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 08:02:29 +00:00
Hengfei Yang 3e865a3e6a ci: update rust (#12394) 2026-06-02 03:58:01 +00:00
Huaijin 3a951f1398 perf: impl new tantivy index generate for vortex format (#12354)
related to 
- https://github.com/openobserve/openobserve/pull/12331
- https://github.com/openobserve/openobserve/pull/12292
2026-06-01 06:51:41 +00:00
Subhra264 9a1ed606aa feat: org level ingestion token (#11691)
Design at: observability/org-level-ingestion-token
2026-06-01 06:12:06 +00:00
Harsh Mahajan ddce5bd8f2 fix: adding root auth for config/reload API (#12279) 2026-05-31 08:55:06 +08:00
yujinqiu 833b2bdc8e feat(security): enforce strong password policy (#12327) 2026-05-31 08:53:14 +08:00
Ashish Kolhe 6b9197eb05 fix: dashboard & pipeline fixes (#12353) 2026-05-29 17:06:49 +00:00
Ashish Kolhe 4466ff2250 fix: changed error msg (#12329) 2026-05-28 08:50:19 +00:00
Neha PandClaude Opus 4.7 b369746c30 fix: use raw table_name for URL job lookup in cross-type check (#12277)
## Summary

Follow-up to #12249. The cross-type collision check in the file upload
handler passes the formatted `stream_name` to `get_url_jobs_for_table`,
but URL jobs are stored with the raw `table_name` from the HTTP path.
When names contain uppercase or special characters,
`format_stream_name("My_Table")` produces `"my_table"`, which won't
match the stored URL job name `"My_Table"` — causing the cross-type
protection to be silently bypassed.

## Fix

Changed `get_url_jobs_for_table(&org_id, &stream_name)` to
`get_url_jobs_for_table(&org_id, table_name.trim())` — matching how the
URL handler itself queries URL jobs at line 299.

## Before/After

```rust
// Before: formatted name passed to URL jobs lookup (WRONG)
get_url_jobs_for_table(&org_id, &stream_name)

// After: raw table_name passed (CORRECT, matches how URL handler queries)
get_url_jobs_for_table(&org_id, table_name.trim())
```

## Notes

- `ENRICHMENT_TABLES` cache key continues to use `stream_name`
(formatted) — that's correct
- `get_url_jobs_for_table` now uses `table_name.trim()` — matching the
URL handler at line 299

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

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 05:59:56 +00:00
Neha PandClaude Opus 4.7 8c25e76d9d fix: prevent cross-type enrichment table name collision (#12249)
## Summary
Bug fix for - https://github.com/openobserve/openobserve/issues/12247

- **Bug:** Creating a URL enrichment table with name `X`, then creating
a file upload enrichment also named `X` (or vice versa), silently
overwrites the first one at every storage layer.
- **Fix:** Added cross-type name collision checks at the API boundary.
The file upload handler now rejects if a URL enrichment already exists
with the same name, and the URL handler rejects if a file upload
enrichment already exists. Same-type updates (append/retry/replace) are
unaffected.


## Root Cause

Enrichment tables are uniquely identified by `(org_id, table_name)`
across all storage layers — database, caches, object store, and
coordinator keys. Both URL-based and file-upload enrichments share the
same `StreamType::EnrichmentTables` and the same key space, so creating
one with the same name as another silently clobbers the previous one.

## Changes

**1 file changed** —
[src/handler/http/request/enrichment_table/mod.rs](src/handler/http/request/enrichment_table/mod.rs)

### `save_enrichment_table` (file upload handler)
Added check after input validation: if the table name already exists in
`ENRICHMENT_TABLES` and has URL jobs, return `400` — "already exists as
a URL enrichment."

### `save_enrichment_table_from_url` (URL handler)
Added check after fetching existing jobs: if the table name exists in
`ENRICHMENT_TABLES` but has no URL jobs, return `400` — "already exists
as a file upload enrichment."

### Behavior matrix

| | Existing: URL | Existing: File Upload | Existing: None |
|---|---|---|---|
| **Create File Upload** | ❌ Reject (400) | ✅ Allow (update) | ✅ Allow |
| **Create URL** | ✅ Allow (update) | ❌ Reject (400) | ✅ Allow |

## Test Plan

- [ ] Manually verify: create a URL enrichment named `test_cross_type` →
attempt file upload with same name → should get 400 error
- [ ] Manually verify: create a file upload enrichment named
`test_cross_type2` → attempt URL creation with same name → should get
400 error
- [ ] Manually verify: same-type updates still work (file→file append,
URL→URL retry/replace)
- [ ] Playwright automation will be added in a follow-up PR in the
`RegressionSet` folder

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

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 08:01:47 +00:00
e9266c4510 fix: restore retry guard in enrichment table URL validation (#12218)
Fixes https://github.com/openobserve/o2-enterprise/issues/1796 (item 1:
"Reload Existing URLs" returns error).

## Summary

Commit
[`85d261b5d0`](https://github.com/openobserve/openobserve/commit/85d261b5d0e4b68dbc79ca18b844fc53e2368ee9)
(vulnerability scan fixes, Apr 14 2026) removed the `!retry` guard from
enrichment table URL validation. This broke the **reload** update mode
because the frontend sends an empty URL when retrying/reprocessing
existing URLs — the backend already has them stored and just needs to
re-trigger processing.

## Root Cause

Before the breaking commit, URL validation was guarded by `!retry`:
```rust
if !retry && let Err(err_msg) = validate_enrichment_url(&request_body.url) {
    return MetaHttpResponse::bad_request(err_msg);
}
```

The security fix removed the guard under the assumption that skipping
validation on retry was an SSRF bypass vector. However, the retry flow
sends `url=""` intentionally — the existing URLs are in the database.

## Fix

Re-adds the `!retry` guard around URL validation. In retry mode, URL
validation is skipped entirely (the URLs come from DB). All other modes
(create, append, replace, replace_failed) still require a non-empty,
valid URL with full SSRF protection.

## Test Plan

- [ ] Create enrichment table from URL
- [ ] Edit table → Reload existing URLs → Should succeed (no "URL cannot
be empty")
- [ ] Edit table → Add new URL → Should still validate URL format
- [ ] Edit table → Replace all URLs → Should still validate URL format
- [ ] Edit table → Replace failed URL → Should still validate URL format

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

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Subhradeep Chakraborty <chakrabortysubhradeep556@gmail.com>
2026-05-25 17:00:13 +00:00
Harsh Mahajan 4f3db1cf79 fix: disabling some APIs (#12220) 2026-05-25 15:58:26 +00:00
Loakesh Indiran 4652dbec27 fix: TopKHeap for non-ts ORDER BY in latest_stream (#12134)
## Problem

`sort_by=duration` (and any non-timestamp sort) in the
`/traces/latest_stream` endpoint had three bugs:

1. All partitions collapsed into one full-range scan
2. Q1 results re-sorted by `trace_start_time`, discarding SQL engine
order
3. `fetch_size` capped at `query_default_limit` (1000), so top-k ranked
on a truncated sample

## Fix

Mirrors the approach from #11654 (_search_stream):

- Detect non-ts ORDER BY generically via \`sql_order_expr\` prefix — no
hardcoded field names
- Run Q1 across **all** partitions; feed deduped hits into a
\`TopKHeap\` bounded to \`k = from + size\`
- Q2 (span details) runs **once** after all partitions complete, over
the narrowed time window of the deliverable traces
- Final hits emitted in heap order — correct global rank by ORDER BY
column

## Refactor

Extracted `run_q2_for_traces` async helper to eliminate ~300 lines of
duplicated code between the ts-path and non-ts-path. Both paths now call
the same helper for the `TraceResponseItem` build + Q2a (per-trace
aggregates) + Q2b (per-service breakdown). Also removed the dead
`"duration"` sort arm from the ts-path and the now-unused `sort_by`
parameter from `process_latest_traces_stream`.

## Known Limitation

`zo_sql_duration` is computed per-partition, so traces whose spans
straddle a partition boundary get an underestimated duration. Rare in
practice; a 2-pass global aggregation would be needed to fix.

## Related

Companion to #11654 — correct pagination for ORDER BY non-timestamp
column in `_search_stream`
2026-05-25 14:15:43 +00:00
Ashish Kolhe 5a6681bca0 fix: anomoly history api (#12187) 2026-05-25 07:04:39 +00:00
Huaijin dde90c14de refactor: unify search partition handle (3) (#12115)
related to 
- https://github.com/openobserve/openobserve/pull/8003
- https://github.com/openobserve/openobserve/issues/7986


# Why We Can Delete `enable_align_histogram`

## What It Was

`enable_align_histogram` was a query parameter introduced in [PR
#8003](https://github.com/openobserve/openobserve/pull/8003) to fix
[Issue #7986](https://github.com/openobserve/openobserve/issues/7986).
The bug was that in the old two-step search flow (`_search_partition` →
`_search`), the two APIs independently generated histogram intervals,
leading to mismatched time buckets and inaccurate chart rendering in
dashboards.

The flag told `_search_partition` to:
1. Align partition boundaries to histogram interval boundaries (e.g.,
round to the start of a minute/hour/day).
2. Return the computed `histogram_interval` in the response so the
frontend could pass it to `_search`.

## Why It Is Now Dead Code

### 1. The frontend no longer calls `_search_partition`

All frontend search now uses `_search_stream` (HTTP/2 streaming), which
internally calls `search_partition()` with `enable_align_histogram =
false`. The old `_search_partition` endpoint is no longer consumed by
the UI. The only frontend caller (`getValuesPartition` in
`IndexList.vue`) is defined but never invoked.

### 2. `search_stream` handles alignment inherently

In the streaming search flow, partitions themselves define the search
time ranges. Each partition search runs on the exact aligned time
boundaries returned by the partition step. There is no separate
histogram query that needs an externally provided interval — alignment
is "baked into" the partition boundaries.

### 3. Histogram queries are already covered by `is_complex_query`

For histogram queries (which have `GROUP BY`), `is_complex_query`
returns `true`. Combined with `has_ts_column = true`, this triggers
`calculate_partition_settings()` to align `min_step` to the histogram
interval — the same alignment behavior that `enable_align_histogram`
previously provided, but without the extra flag.

### 4. All backend callers pass `false`

Of the 5 callers of `search_partition()`:
| Caller | Value |
|--------|-------|
| gRPC handler | hardcoded `false` |
| streaming execution | hardcoded `false` |
| traces handler | hardcoded `false` |
| HTTP `_search_partition` | from query param (frontend always passed
`true`, but frontend no longer calls this) |
| HTTP `_search_partition_multi` | from query param (frontend always
passed `true`, but frontend no longer calls this) |

No active code path ever sets `enable_align_histogram = true`.

## What Was Removed

- `get_enable_align_histogram_from_request()` — the HTTP query param
parser
- The `enable_align_histogram` parameter from:
  - `search_partition()` function signature
  - `search_partition_multi()` function signature
  - `calculate_partition_settings()` function signature
- The alignment logic in `search_partition()`:
  - `add_mini_partition` (always `false` without the flag)
- `PartitionGenerator` align parameter (now driven by `is_histogram`
alone)
  - `resp.histogram_interval` override block
- The `|| enable_align_histogram` branch in
`calculate_partition_settings`
- The query parameter from both HTTP handler `utoipa` specs
- The `false` argument from all 5 call sites
2026-05-22 11:08:51 +00:00
Subhra264 deac1003af fix: strip api prefix if not already stripped (#12063) 2026-05-21 09:03:10 +00:00
udev 314b767998 fix: add runtime validation checks to sql queries for traces and sessions (#11960) 2026-05-20 15:08:02 +00:00
Subhra264 6ec195ac81 fix: revamp rbac (#11610)
Revamps the complex rbac logic to make it simpler.
Also, 
- Adds RBAC for anomaly apis
- Fixes https://github.com/openobserve/openobserve/issues/11710
2026-05-20 15:03:23 +00:00
f736ec844c fix: sessions table (#11746)
- **fix latest sessions api**
- **fix: sessions phase 1 ui**
- **fix: minor ui issues**

---------

Co-authored-by: sai nikhil kethe <nikhil@openobserve.ai>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-05-18 19:20:43 +00:00
Subhra264 015f8778a4 fix: check if auth password is empty for ingestion endpoints (#11918) 2026-05-18 14:35:15 +00:00
Subhra264 ccb2f92599 fix: check if user password is empty in the authentication (#11906) 2026-05-18 12:25:39 +00:00
Loakesh Indiran c679698fa5 fix: correct pagination for ORDER BY non-timestamp column in _search_stream (#11654)
## Problem

`ORDER BY <non-timestamp col>` (e.g. `ORDER BY duration DESC`) gave
wrong results and risked OOM because per-partition \`hits_to_skip\`
assumed rows are time-ordered — but the globally k-th row can be in any
partition.

## Solution

Each partition fetches its local top-`k = from+size` rows. A
**TopKHeap** on the leader merges them globally, skips `from`, returns
`size`. Heap is bounded to `k` elements at all times — O(k) memory
regardless of partition count.

**Multi-column ORDER BY** (`ORDER BY duration DESC, _timestamp DESC`) is
fully honored: heap comparison and final sort respect all columns in
order, using secondary columns as tiebreakers.

## Scenario behavior

| Query | Behavior |
|---|---|
| `ORDER BY _timestamp DESC` | Unchanged — per-partition path |
| `ORDER BY duration DESC` | Heap merge path — correct pagination |
| `ORDER BY duration DESC, _timestamp DESC` | Heap merge; ties in
`duration` broken by `_timestamp` |
| `ORDER BY duration DESC` page 2 | Heap collects global top-k, skips
`from`, returns `size` |
| JOIN / subquery / GROUP BY | `is_aggregate=true` → single partition
(unchanged) |
| `ZO_DISABLE_PARTITIONS_FOR_NON_TS_ORDER_BY=true` | Forces 1 partition
(circuit breaker preserved) |
| Partial cache hit + non-ts ORDER BY | TODO — pre-existing bug, no
regression |

## What is NOT changed

- `ORDER BY _timestamp` execution path
- `_search` (non-streaming) — DataFusion handles it correctly
- Aggregate / histogram queries
2026-05-15 09:09:16 +00:00
ea5e0e1102 feat: org level storage configuration (#11614)
This adds supports for configuring storage at org level instead of
installation level in ent and cloud setup.

design at:
https://github.com/openobserve/designs/blob/main/infrastructure/custom-s3-bucket-support/design.md

---------

Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
Co-authored-by: Yashodhan Joshi <yjdoc2@gmail.com>
Co-authored-by: sai nikhil kethe <nikhil@openobserve.ai>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 09:33:02 +00:00
Ashish Kolhe 3161d13785 fix: refactor ssrf (#11734) 2026-05-14 08:32:40 +00:00
99fb8e46a2 fix: support cycle in usage (#11547)
This adds support for current cycle for stripe users as period for usage
page

---------

Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
Co-authored-by: Yashodhan Joshi <yjdoc2@gmail.com>
Co-authored-by: sai nikhil kethe <nikhil@openobserve.ai>
2026-05-12 08:17:34 +00:00
Ashish Kolheandgithub-actions[bot] c686b359bf fix: corelation custom groups + settings fixes (cherry-pick from v0.90.0) (#11705)
## Summary
Cherry-picks two correlation fixes from `branch-v0.90.0` to `main`:

- `a077b760c` fix: corelation custom groups (#11662) — adds `group`
field to `FoundGroup` and threads `semantic_groups` through
`calculate_dimension_analytics`
- `211876a97` fix: corelation settings fixes (#11666) — validates
tracked alias IDs against bundled defaults + custom DB groups; sanitizes
payload (drops `service` and orphan IDs) before save

Conflicts resolved by taking v0.90.0 versions (the fixes are the point
of the cherry-pick). Companion PR on o2-enterprise:
openobserve/o2-enterprise#1648 — that PR is currently red because it
depends on the new `FoundGroup.group` field landing here first.

## Test plan
- [ ] CI green (build, unit, playwright)
- [ ] Verify save Identity Config rejects invalid alias IDs but accepts
default + custom IDs
- [ ] Verify `_analytics` endpoint returns `group` category on
FoundGroup

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-05-11 03:51:39 +00:00
aa98badd80 fix: refactor llm attribute trace (#11626)
- **fix: llm insights tab**
- **remove custom attributes and use gen ai spec**

---------

Co-authored-by: sai nikhil kethe <nikhil@openobserve.ai>
Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
2026-05-10 03:38:14 +00:00
Ashish Kolheandgithub-actions[bot] 30991ca2e1 fix: corelation fixes (#11646) (#11649)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-05-07 12:29:20 +00:00
Harsh Mahajan 56856f3955 fix: ent build (#11613)
caused by https://github.com/openobserve/openobserve/pull/11588
2026-05-05 21:50:44 +00:00