Commit Graph
2906 Commits
Author SHA1 Message Date
ByteBaker 2b65bbb97f fix(service-graph): run job on alert_manager nodes (#11159)
Changes

- Switch service graph job from ingester to alert_manager nodes
- Add UUID-based leader election to prevent duplicate writes across
multiple alert_manager instances
- Make query time range configurable via o2_config instead of a
hardcoded constant
- Skip processing streams with no new data since the last interval
(doc_time_max check)
- Downgrade no-trace-streams log from warn to debug
2026-04-06 20:12:20 +00:00
1d3618ad94 chore: system-managed SRE Agent service account provisioning (#11130)
## Summary

Implement automatic provisioning and lifecycle management of
per-organization system service accounts for the AI-powered SRE Agent.
These accounts serve as the identity for RCA (Root Cause Analysis) agent
API interactions and are created automatically for each organization.

## Key Features

### Service Account Provisioning
- Database migration creates SRE Agent accounts for all existing
organizations
- Deterministic email format:
`o2-sre-agent.org-<ORG_ID>@openobserve.internal`
- System accounts are automatically created on organization creation
- Idempotent operations ensure safe re-runs and self-healing

### System Account Protection
- API endpoints prevent modification/deletion of system service accounts
(403 Forbidden)
- User responses include `is_system` flag to identify system accounts
- Protection enforced at HTTP handler layer

### RCA Agent Client Refactoring
- Singleton pattern: global client initialized once at startup
- Per-request user credential forwarding for better audit trails and
scoping
- Lazy initialization: returns None if agent service not configured
- Updated all query methods to accept and forward auth credentials

### Incident Correlation Enhancement
- Query `ServiceIdentityConfig` to get configured semantic dimension
groups
- Extract only `distinguish_by` fields from matched identity sets
- Use parallel correlation execution (Service Discovery + semantic
extraction)
- Improved accuracy by using configured groups instead of fallback label
extraction

### Improved Token Redaction
- Consistent 12-character format: first 4 visible characters + 8
asterisks
- Better security for token display in UI
- Updated tests for new redaction format

## Technical Details

### Database Changes
- New migration:
`m20260331_000001_create_sys_rca_agent_service_accounts`
- Creates accounts with organization and RUM tokens
- Safe pagination (100 orgs at a time) with idempotency checks
- System accounts use role type 6 (SreAgent, distinct from
ServiceAccount)

### Authorization
- System accounts added to OpenFGA with standard org membership tuples
- SRE-specific read-only role for permission control
- Self-healing: runtime ensures OpenFGA state is consistent with
database state

### API Changes
- GET /users: Returns `is_system` and `description` fields
- PUT/DELETE /users: Reject modification/deletion of system accounts

## Test Coverage
- Token redaction tests updated for new format
- System service account protection verified
- User list pagination tested with system accounts

## Feature Flag
This is an enterprise feature gated behind `#[cfg(feature =
"enterprise")]`. System accounts are always created, but RCA integration
only works if the agent service is configured.

## Deployment
- Zero-downtime: migration is additive
- Opt-in for OSS deployments
- Automatic provisioning on upgrade and org creation

---------

Co-authored-by: Shrinath Rao <shnath@openobserve.ai>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
2026-04-06 14:30:20 +00:00
Hengfei Yang f25af53ac1 chore: update component versions (#11156) 2026-04-06 17:21:54 +08:00
漂流 fbf7283ffc chore: use std instead of once_cell (#11081) 2026-04-06 16:27:16 +08:00
HuaijinandHengfei Yang ada8b3763f chore: upgrade datafusion to 53 (#11093)
- [x] check if still need `CoalesceBatchesExec`
- [x] check object_store upgrade

---------

Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
2026-04-06 06:06:51 +00:00
GobinathALandHengfei Yang b831f24885 fix(web): quote reserved fields in SQL query (#10905)
**Issue**
Logs query generation used raw field names in SELECT [FIELD_LIST] and
non-SQL WHERE filters. If a field name is a SQL reserved word (for
example user, role), the generated SQL could be invalid or fail to
parse.

**Fix**
Field names are now consistently wrapped in double quotes when building
SQL:
- Quick mode field list ([FIELD_LIST])
- Non-SQL filter tokens converted into WHERE clauses

Tests were updated to assert quoted-field behavior for both quick mode
and filter conversion.

---------

Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
2026-04-05 11:33:42 +00:00
416a6cce32 feat: work group v2 — slot-based admission (#10990)
## Summary

Design at:
https://github.com/openobserve/designs/blob/main/infrastructure/work-group/work_group_v2_impl.md

This PR adds slot-based distributed admission control for search queries
and fixes file dispatch consistency when a subset of querier nodes is
selected per query.

To enable this feature we need to set:

```
O2_WORK_GROUP_MAX_NODES_PER_QUERY > 0
O2_WORK_GROUP_NODE_SELECTION_STRATEGY = org | stream
```

### Slot-based admission

- Add `TryAcquire / StartQuery / ReleaseQuery` gRPC RPCs — Follow nodes
reserve slots before execution starts and self-release via
`FlightEncoderStream::drop`
- Wire slot admission in both Arrow Flight search and PromQL paths,
co-located with the existing org/user concurrency queue check
- Delegate DataFusion `target_partitions` / `memory_size` to enterprise
`get_resource_limit()`, which applies per-query slot fraction with
optional dynamic expansion
- TTL sweep interval derived from `slot_reserved_ttl_ms / 4` (min 100
ms) instead of a hardcoded 500 ms
- Move `QUERY_PENDING_NUMS` / `QUERY_RUNNING_NUMS` metric updates to
after slot admission completes (a blocked request is no longer counted
as "running")

### Consistent-hash file dispatch fix (`max_nodes_per_query > 0`)

- Add `get_node_from_consistent_hash_within(key, role, group, allowed)`
to `infra::cluster`: walks the global ring clockwise from `hash(key)`
but skips nodes outside `allowed`. Preserves all consistent-hash
properties (even distribution via vnodes, minimal remapping on
membership change) while confining dispatch to the selected subset
- `partition_file_by_hash` now passes only the selected querier nodes as
the `allowed` set, so every file maps to one of the N selected nodes —
no more fallback-to-index-0 imbalance when `strategy=org/stream`
- File-list broadcast (enterprise) pre-computes per-item target nodes
using the same filtered ring walk via `broadcast_item_targets()` in
`o2-enterprise`, so broadcast and dispatch always agree on which node
owns each file

### Proto fix

- Reserve field 10 in `QueryStatus` (was `WorkGroup` enum / varint wire
type) and move `work_group` string to field 13 — prevents wire-type
mismatch during rolling upgrades

### Other fixes from code review

- `get_first_stream_key()` now returns `"{stream_type}/"` sentinel
instead of `""` for multi-stream / cross-index queries, so
`select_nodes` always receives a non-empty deterministic key
- PromQL node selection uses `"metrics/"` stream key (consistent with
the sentinel format) instead of bare `"metrics"`
- Move `_orig_trace_id` binding inside `#[cfg(feature = "enterprise")]`
block in `FlightEncoderStream::drop`

## Key config (all default to safe/off values)

| Env var | Default | Description |
|---|---|---|
| `O2_WORK_GROUP_MAX_NODES_PER_QUERY` | `0` | Nodes per query; 0 = all
nodes (disables slot admission) |
| `O2_WORK_GROUP_NODE_SELECTION_STRATEGY` | `all` | `all` / `org` /
`stream` |
| `O2_WORK_GROUP_SHORT_SLOT_RATIO` | `0.8` | Max fraction of node slots
for short queries |
| `O2_WORK_GROUP_DYNAMIC_RESOURCE` | `true` | Expand DataFusion
allocation on idle nodes |

## Test plan

- [x] Default (`max_nodes_per_query=0`): behavior identical to before,
zero overhead
- [x] `strategy=org`, `max_nodes_per_query=3`, 10-node cluster: each org
consistently uses the same 3 nodes; files distributed evenly across
those 3 nodes (no node-0 pile-up)
- [x] Broadcast routes each file to the same node that
`partition_file_by_hash` selects at query time → cache hits on
re-queries
- [x] Slot admission: 3rd request waits when budget=2 and 2 queries
running; slots released on completion
- [x] PromQL queries respect slot budget
- [x] Rolling upgrade: old node sends `QueryStatus` without field 10
conflict

## Related

Requires companion PR in `o2-enterprise`:
https://github.com/openobserve/o2-enterprise/pull/1378

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

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-04-05 05:31:37 +00:00
HuaijinandHengfei Yang 15f0dcdded feat: support s3 infrequence acces storage class (#11144)
Design at: https://github.com/openobserve/o2-enterprise/issues/1406
```
ZO_S3_FEATURE_FORCE_INFREQUENT_ACCESS=false
```

---------

Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
2026-04-03 14:22:16 +00:00
Subhra264 ec6f1aadea fix: pause one time run report when it is done (#11143)
Report with `Once` as scheduled frequency (basically it gets triggered
only once as per config) should be paused when the trigger is successful
2026-04-03 12:14:08 +00:00
Hengfei Yang 624372eb7e fix: pending delete files (#11139) 2026-04-03 09:36:58 +00:00
Huaijin d7b30e7f61 chore: remove unused code (#11135) 2026-04-03 09:26:19 +00:00
773c87018b feat: add configuration option to show field as JSON in dashboard (#11091) (#11104)
Design at:

https://github.com/openobserve/designs/tree/main/dashboards/show-field-as-json-default-value-env

---------

Co-authored-by: ktx-abhay <abhay.padamani@kiara.tech>
Co-authored-by: Abhay Padamani
<141122205+ktx-abhay@users.noreply.github.com>

---------

Co-authored-by: ktx-vaidehi <134508096+ktx-vaidehi@users.noreply.github.com>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Abhay Padamani <undefined@users.noreply.github.com>
2026-04-03 07:34:12 +00:00
Subhra264 6fd1c592ba fix: update scheduled job status after backfill job returns error (#11086) 2026-04-02 12:23:52 +00:00
ByteBaker d25fbf97c1 fix: do not show service account token post creation (#11110)
So far, service account token could be viewed and copied even after an
SA was created. This was bad design and posed risk of impersonation.

The changes prevent this from happening by returning only the redacted
token in the API response. Full token with create API itself, and
removing GET API to get the service account details (which returned raw
token).

The same affects token rotation as well.
2026-04-01 19:29:42 +00:00
Yashodhan JoshiandYashodhan Joshi f8bd642a07 fix: block non-admin role at user creation if ofga is disabled (#11080)
We need to have open fga enabled to support non-admin roles. However
currently the create user api allows creating non-admin users even when
ofga is not enabled. Those are treated as admin users, which causes
further confusion.

This PR adds a check so that non-admin roles are blocked at creation if
ofga is not enabled.

---------

Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
Co-authored-by: Yashodhan Joshi <yjdoc2@gmail.com>
2026-03-31 16:21:01 +05:30
udev 9525aad6fe fix: grpc use native/webpki trust store (#11083) 2026-03-31 11:28:53 +05:30
ByteBaker 881cdfb03f chore: upgrade DB_SCHEMA_VERSION for new service discovery 2026-03-31 01:23:28 +05:30
ByteBaker 881a6611c0 feat: simplify service discovery feature (#10946)
## Core changes

- **Schema**: `service_streams_dimensions` table dropped entirely.
Service rows gain `disambiguation JSONB`, `set_id`, and
`field_name_mapping JSONB`. Incidents: `correlation_key VARCHAR`
replaced with `group_values JSONB`.
- **Migrations**: 6 new sea-orm DSL migrations (raw SQL strings removed
for cross-backend consistency; GIN index creation remains raw SQL — no
native sea-orm support).
- **`ServiceIdentityConfig`**: `fqn_priority_dimensions` replaced with
`distinguish_by` list. `max_total_service_rows` renamed from
`max_total_services` (unit = rows, not logical services).
- **Meta types**: `CorrelationConfidence`, `ConfidenceLevel`,
`DimensionMatchDetail` removed from `correlation.rs`.
`SemanticFieldGroup` → `FieldAlias` (fields are aliases to group IDs,
not full group descriptors).
- **Handlers**: Authorization checks added to list, correlate, and
get-config endpoints. `_grouped` endpoint removed; `_recommendations`
endpoint added.
- **Cleanup job**: Leader election added (smallest UUID ingester wins);
hardcoded 1h interval + 30-day stale threshold replace the removed
configurable env vars.
- **Processing mode removed**: Compactor-mode path removed; single
ingester-only path remains.
- **UI**: FQN priority config replaced with `distinguish_by` field
selector. New `ServiceIdentitySetup.vue` guided setup flow.
`is_scope`/`is_stable`/`normalize` toggles removed from semantic group
editor. ~13-14 FQN-related i18n keys removed from each of 12 locale
files.

## Env var changes

Removed (15):
- `O2_SERVICE_STREAMS_SAMPLE_EVERY_NTH_STREAM` → renamed (see below)
- `O2_SERVICE_STREAMS_SAMPLE_EVERY_NTH_FILE`
- `O2_SERVICE_STREAMS_RECORD_SAMPLE_PERCENT`
- `O2_SERVICE_STREAMS_STABLE_DIMENSION_THRESHOLD`
- `O2_SERVICE_STREAMS_TRANSIENT_DIMENSION_THRESHOLD`
- `O2_SERVICE_STREAMS_MAX_STREAMS_PER_SERVICE`
- `O2_SERVICE_STREAMS_MIN_CORRELATION_CONFIDENCE`
- `O2_SERVICE_STREAMS_PROCESSING_MODE`
- `O2_SERVICE_STREAMS_BATCH_MAX_SERVICES`
- `O2_SERVICE_STREAMS_CLEANUP_INTERVAL_MINS`
- `O2_SERVICE_STREAMS_STALE_THRESHOLD_HOURS`
- `O2_SERVICE_STREAMS_MAX_TOTAL_DIMENSIONS`
- `O2_SERVICE_STREAMS_MAX_TOTAL_VALUES`
- `O2_SERVICE_STREAMS_CHANNEL_CAPACITY`
- `O2_SERVICE_STREAMS_MAX_FLUSH_RETRIES`

Renamed:
- `O2_SERVICE_STREAMS_SAMPLE_EVERY_NTH_STREAM` →
`O2_SERVICE_STREAMS_SAMPLE_RATE` (default: 10)

Kept:
- `O2_SERVICE_STREAMS_ENABLED` (default: false)
- `O2_SERVICE_STREAMS_SAMPLE_WINDOW_SECS` (default: 300)
- `O2_SERVICE_STREAMS_BATCH_FLUSH_INTERVAL_SECS` (default: 600)
- `O2_SERVICE_STREAMS_MAX_TOTAL_SERVICES` (default: 500,000)

Added:
- `O2_SERVICE_STREAMS_TRACKED_ALIAS_IDS` — comma-separated alias group
IDs tracked system-wide by default; "service" always implicit

Design at: designs/correlation/proposal-v2
2026-03-30 13:47:40 +05:30
Huaijin beaeaee55b fix: report to remote not blocking (#11053) 2026-03-30 14:30:34 +08:00
Sai Nikhil 1a9837bd12 fix: pass search inspect env via config (#11051) 2026-03-30 10:25:31 +05:30
udev bac462cd38 fix: return tls client config without arc (#11055) 2026-03-30 11:54:49 +08:00
udev 1c7a3135de feat: add patch panel apis (#11025) 2026-03-28 03:15:34 +05:30
Subhra264 6a6914213d fix: Include the error field in alert/pipeline history query (#11050)
Currently the alert/pipeline history api does not include the error
field in the history query from the triggers stream. This pr fixes this.
2026-03-27 18:40:36 +05:30
a2db37e237 fix: check trigger again next week when pipeline is disabled similar to alerts (#11040)
Currently, when a pipeline is disabled, the scheduled job we don't
delete, but we check after 5mins. 5mins is too frequent to check this,
instead we should follow the same like alerts and reports that checks
again after a week.

---------

Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
Co-authored-by: Yashodhan Joshi <yashodhan@openobserve.ai>
Co-authored-by: Yashodhan Joshi <yjdoc2@gmail.com>
2026-03-27 17:19:43 +05:30
ByteBaker 9c245882d2 fix: anomaly status verbiage + owner issue 2026-03-25 14:15:38 +05:30
477ec39db2 feat: add support for sourcemaps for RUM (#10259)
This ads support for sourcemaps in RUM

Design at :
https://github.com/openobserve/designs/blob/main/application-monitoring/rum/sourcemap-be.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>
2026-03-24 21:18:06 +05:30
Subhra264 11e16f47eb fix: don't do unnecessary lowercasing of user emails (#10938) (#10985) 2026-03-23 10:04:53 +01:00
Subhra264 c0c0f53fec fix: don't run gc if file cur_size is 0 (#10989) 2026-03-23 10:04:18 +01:00
ByteBaker 4a6c9efdb1 chore: enable UI toggle for self-org usage reporting 2026-03-23 13:17:46 +05:30
ByteBaker f7b5bcdc91 chore: enable service graph by default, drop runtime config knobs
Remove O2_SERVICE_GRAPH_ENABLED and O2_SERVICE_GRAPH_QUERY_TIME_RANGE_MINUTES.
Service graph now runs unconditionally on enterprise ingester nodes.
Query window defaults to 60m constant; UI time range picker controls actual queries.

Also remove checks for this on the UI. Keep only enterprise level checks.
2026-03-23 12:17:53 +05:30
Huaijin 825a57eea8 fix: traces latest stream api (#10993)
- close #10986
2026-03-23 13:19:53 +08:00
vnghia 583e588fee fix: change log level from warn to debug for file deletion (#10991) 2026-03-23 12:08:34 +08:00
Franklyn Dsouza f742b19065 perf: Batch schema evolution checks in handle_otlp_request (#10947) 2026-03-22 22:35:13 +01:00
Huaijin b3a9b3c14f perf: preserve fetch when rewriter FilterExec (#10971) 2026-03-21 20:15:35 +08:00
udev d3f6a333f9 feat: summary for tool responses (#10955) 2026-03-20 18:22:22 +05:30
Hengfei Yang b6e8ce9400 fix: show fts field values (#10975) 2026-03-20 14:57:30 +08:00
36c2ef4418 feat: anamoly detection p2 (#10940)
Design at: anomaly-detection

---------

Signed-off-by: loaki07 <rustyloaki@gmail.com>
Co-authored-by: Bhargav <BJP232004@GMAIL.COM>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Loakesh Indiran <undefined@users.noreply.github.com>
Co-authored-by: ByteBaker <42913098+ByteBaker@users.noreply.github.com>
Co-authored-by: Shrinath Rao <shnath@openobserve.ai>
2026-03-19 21:36:06 +05:30
Hengfei Yang 99dfc8a683 refactor: unify HTTP server initialization with tracing option (#10970) 2026-03-19 16:11:59 +08:00
Hengfei Yang d88f978e48 refactor: simplify path handling in middleware and router configuration (#10960) 2026-03-18 19:53:19 +08:00
1a6a53a0ed feat: pivot table support on dashboard (#10774)
Design at:
https://github.com/openobserve/designs/tree/main/dashboards/dashboard-pivot-table-support

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Abhay Padamani <undefined@users.noreply.github.com>
2026-03-18 17:12:17 +05:30
Hengfei Yang f53c858035 feat: add configuration option for field values in FST logs page (#10951) 2026-03-18 17:28:19 +08:00
Hengfei Yang b50de58a97 refactor: update schema field naming and enhance metadata extraction methods (#10945) 2026-03-18 09:01:31 +08:00
Hengfei Yang fcb04b9a76 fix: node list api should working on querier (#10937) 2026-03-17 20:04:26 +08:00
Ashish Kolhe ec0dc67d5a fix: for prometheus metadata api (#10934) 2026-03-17 15:25:35 +05:30
Hengfei Yang 53668c8c1a chore: update dependencies in Cargo files (#10929) 2026-03-17 11:14:14 +05:30
Subhra264 b5b67a41aa fix: when alert does not return any result, don't make dedup fields in triggers stream true (#10914) 2026-03-17 09:04:36 +08:00
Subhra264 04de59b188 fix: do not call roles openfga api if user email is empty (#10832) 2026-03-17 09:03:03 +08:00
Hengfei Yang dafa382abb fix: handle serde_json arbitrary_precision number in VRL parse_json (#10920) 2026-03-16 21:07:35 +08:00
Subhra264 3760b55cf9 fix: multi-window dashboard should support vrl functions (#10860)
Currently dashboard with Multi-window set up does not really run the
result array vrl functions. This pr adds support for vrl function when
`/_search_multi_stream` is used. When `per_query_response` is true, and
the vrl function is result array vrl function, the function is applied
on the whole combined response (including both the time windows). The
input of the result array vrl function becomes a 2d array where each
child array represent a time window.

Otherwise, if `per_query_response` is false, or the vrl function is not
result array vrl function, then the function is applied individually on
every result of every time-window queries.
2026-03-16 13:04:28 +05:30
Hengfei Yang 5d4a909813 fix: create trigger schema (#10896) 2026-03-13 22:36:41 +08:00