Commit Graph
661 Commits
Author SHA1 Message Date
Hengfei Yang 3977c9be42 perf: optimize compactor scheduler with multiple mpsc (#6269) 2025-03-15 15:03:28 +08:00
77a70ef4fa fix: search type to lowercase (#6197)
Co-authored-by: Taiming Liu <liutaiming3@gmail.com>
Co-authored-by: Bhargav <BJP232004@GMAIL.COM>
2025-03-13 21:43:05 +05:30
udev 2cc9e5094e feat: report node config over super cluster (#6237) 2025-03-12 17:34:50 +08:00
Hengfei Yang 19d654eb7d feat: add node version (#6224)
Add node version to node list via heartbeat.
2025-03-10 16:46:38 +08:00
Hengfei Yang 1684427e52 feat: use local node for load enrichmentable (#6215)
- [x] feat: use local node for load enrichmentable
- [x] feat: improve search around with multiple streams
- [x] perf: skip the querier with have no file to query
2025-03-10 00:23:50 +08:00
Hengfei Yang d9611aa461 feat: add stream pagination (#6166) 2025-03-07 20:34:52 +08:00
Hengfei Yang 19f078bcf2 feat: improve search around (#6200) 2025-03-07 19:33:04 +08:00
Yashodhan Joshi f874bd5fc1 fix: ignore count field from user stream for distinct values (#6208) 2025-03-07 17:33:22 +08:00
Hengfei Yang 2a185ddc18 feat: remove stream level metrics (#6177)
We have over 10k streams, the stream level metrics caused the `/metrics`
page pretty large then it can't parse. so we want to reduce it.
2025-03-05 00:06:31 +08:00
Patrick Sullivan d52fefc5d3 feat: Bulk move dashboards endpoint (#6165) 2025-03-04 09:04:05 -06:00
Subhra264 a5d4cf90ea fix: Individual level Fine grained RBAC permission for Dashboards (#6173)
Currently, individual level RBAC permission does not work for
dashboards. This pr fixes that. So a role permission like below
<img width="1399" alt="Screenshot 2025-03-04 at 5 27 11 PM"
src="https://github.com/user-attachments/assets/06c2030d-4227-4109-b73f-dc2337151362"
/>

will allow the user to access only the dashboards with `Get` and `All`
permission even if the `Get` permission for the folder is not specified.
2025-03-04 19:53:41 +05:30
udevandhengfei yang 355976ce06 fix: handle incomplete files during download (#6156)
Co-authored-by: hengfei yang <hengfei.yang@gmail.com>
2025-03-04 11:28:37 +05:30
Loakesh Indiran 4bccf6cfb6 fix: ws malformed data (#6157) (#6159)
Ref: https://github.com/openobserve/openobserve/issues/5974

Issue: Close frame description field causes frame malformation in
Chrome/Brave
- Description field causes inconsistent frame encoding
- Firefox handles it fine, but Chrome/Brave show malformed data
- Workaround: Skip description field in close frames

Actions:
- Set `CloseFrame` description at both `router` & `querier` to `None`
2025-03-03 14:53:15 +05:30
Hengfei Yang 595490ea33 ci: update rust to nightly-2025-03-02 (#6145) 2025-03-02 17:27:10 +08:00
Hengfei Yang f8c5f012bd feat: remove configure ZO_USAGE_ORG (#6142) 2025-03-01 21:41:39 +08:00
Patrick Sullivan 3f4074b8cf fix: Misc V2 alerts routes fixes (#6137)
Makes the following fixes to these routes:
- `ListAlerts`
  - adds `enabled` to the response body
  - adds `name_substring` to the request body
- `MoveAlerts`
- changes the method type to `PATCH` since this is a non-idempotent
update
- changing to `PATCH` coincidentally happens to fix a routing issue
where requests to `MoveAlerts` were being routed to the `UpdateAlerts`
handler
- `EnableAlert`
- changes the method type to `PATCH` since this is a non-idempotent
update
- `TriggerAlert`
- changes the method type to `PATCH` since this is a non-idempotent
update
2025-02-28 17:19:22 -06:00
Loakesh Indiran 9db5d798e9 fix: add msg_in_flight flag and yield with retries before closing (#6131)
## Goal: 
- The goal is to not sleep/timeout but also wait a tiny bit before
sending close and at the same time not keeping the threads hanging which
could lead to resource exhaustion on the querier

## Changes: 

1. **Message In-Flight Control**:
```rust
message_in_flight: AtomicBool
```
- Uses atomic boolean for lightweight synchronization
- Ensures only one message is being sent at a time
- Prevents message overlap and potential race conditions

2. **Limited Retry Mechanism**:
```rust
let mut attempts = 0;
while attempts < 3 {
    match session.message_in_flight.compare_exchange(...) {
        // ...
        Err(_) => {
            attempts += 1;
            if attempts < 3 {
                tokio::task::yield_now().await;
            }
        }
    }
}
```
- Maximum 3 retries
- Uses `yield_now()` instead of sleep
- Quick failure path if message can't be sent

3. **Non-Blocking Cleanup Before Sending Close**:
```rust
while session.message_in_flight.load(Ordering::SeqCst) && retries < 3 {
    tokio::task::yield_now().await;
    retries += 1;
}
```
- Limited retries during cleanup
- Non-blocking approach to message completion
- Proceeds with close even if message is still in flight

**Why This Prevents Querier Resource Exhaustion**:
1. No thread blocking or sleeping
2. Limited retry attempts (max 3)
3. Quick failure paths
4. `yield_now()` only gives up CPU time slice, doesn't block
5. Resources are cleaned up even on failure
2025-02-28 11:10:06 +05:30
Sai NikhilandTaiming Liu 85e8af977d fix: Pipeline improvements (#6078)
1. this PR introduces new design for query node 
2. dynamic stream name for destination node instead of create new stream
it allows user to input any non existing stream name as destination and
at the time of ingestion it will be created dynamically
3. Fixes issues of #5886

---------

Co-authored-by: Taiming Liu <liutaiming3@gmail.com>
2025-02-26 14:05:11 -08:00
Hengfei YangandTaiming Liu e5b6e507ab fix: ingester replay panic (#6117)
Co-authored-by: Taiming Liu <liutaiming3@gmail.com>
2025-02-26 10:01:57 -08:00
Abhay PadamaniandYashodhan Joshi 571e8e1be1 fix: dashboard freeze issue with more than 100 series in single panel (#6093)
- #6015 


- Introduced new Env variable `ZO_MAX_DASHBOARD_SERIES`, to limit number
of series per panel.

![image](https://github.com/user-attachments/assets/dc034fe6-bade-4952-9ec1-13dfae600bad)

- Comparison against series will not be counted. 
- Additionally, for multiple Y-axes, there will be a limit per
individual Y-axis

---------

Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
Co-authored-by: Yashodhan Joshi <yjdoc2@gmail.com>
2025-02-26 17:42:21 +05:30
Loakesh Indiran dccc130b3a fix: remove CloseFrame delay (#6106) 2025-02-26 10:05:51 +05:30
Patrick Sullivan 97c15637d2 fix: Filter items returned by ListDashboards by permissions (#6087)
https://github.com/openobserve/o2-enterprise/issues/366
2025-02-25 12:34:25 -06:00
a3407fe12d fix: ws connection optimizations cherry-pick (#6047)
- fix: close frame to-from client #6033
- fix: ws connection optimizations #6038
- fix: ws connection optimizations v3 #6058 
- fix: ws conn #6080 
- fix: only close sink to backend in ws_proxy

New Env:
```sh
ZO_WEBSOCKET_ENABLED=true
ZO_WEBSOCKET_CLOSE_FRAME_DELAY=50 // microseconds
ZO_WEBSOCKET_SESSION_IDLE_TIMEOUT_SECS=300
ZO_WEBSOCKET_SESSION_MAX_LIFETIME_SECS=3600
ZO_WEBSOCKET_SESSION_GC_INTERVAL_SECS=60
ZO_WEBSOCKET_PING_INTERVAL_SECS=15
```

---------

Co-authored-by: omkark06 <omkar@zinclabs.io>
Co-authored-by: ShyamOOAI <shyam@openobserve.ai>
2025-02-25 18:28:16 +05:30
Hengfei Yang cd3955ec54 feat: improve router scheduler 1/2 (#6046) 2025-02-24 21:12:25 +08:00
Hengfei Yang 0b67b5ee89 perf: improve search in memory (#6073) 2025-02-24 17:05:27 +08:00
Hengfei Yang 5aeefbd52c feat: add query ingester timeout for UI (#6060) 2025-02-23 10:18:37 +08:00
Hengfei Yang 06ef55c9c6 feat: remove ENV ZO_COLUMN_TIMESTAMP (#6054) 2025-02-21 16:41:18 +08:00
Patrick Sullivan 0f206af7ef feat: Use user-provided owner when creating alerts and reports (#6035) 2025-02-20 14:36:01 -06:00
Ashish Kolhe 87e15e17d7 fix: add node to usage reporting (#6004) 2025-02-19 23:39:28 +08:00
udevandYashodhan Joshi defa86c40c feat: Action scripts [phase 2] (#5925)
- [x] Add support for alerts
- [x] Add support for search
- [x] Add Test API
- [x] Improve Update API

---------

Co-authored-by: Yashodhan Joshi <yashodhan@openobserve.ai>
2025-02-19 16:57:39 +05:30
Subhra264 e315bcc73a feat: move last_satisfied_at and last_triggered_at to scheduled_job table (#5968)
Fixes https://github.com/openobserve/openobserve/issues/5975
2025-02-18 19:24:51 +05:30
Loakesh Indiran 676d2360d9 perf: ws search using cache & fix s3 multipart upload (#5933) 2025-02-18 20:18:04 +08:00
Hengfei Yang 41b6a00907 fix: remove order_by from search request (#5994) 2025-02-17 21:48:34 +08:00
053d246946 fix: web socket streaming aggregates search for dashboards and logs (#5970)
New Env: 
```sh
# default 0ms
# preferred to be set at 10ms to 100ms
# milliseconds
ZO_WEBSOCKET_CLOSE_FRAME_DELAY=10 
```

Changes:

- [x] add support to dashboard for streaming aggregate queries from in
memory cache
- [x] new sort logic for web socket search results
> - [x] introduced a new `optional` parameter `fallback_order_by_col`
for ws search req `SearchEventReq`
> - For queries where there is no `_timestamp` field and no `order_by`
specified:
```sql
SELECT level, COUNT(*) as count
FROM logs
GROUP BY level
```
> - The default sql behavior is to return the results in a non-ordered
manner.
> - However, with web sockets this behavior impacts the UX in both
`logs` and `dashboards` when `streaming aggregates` is `enabled` as the
results in page/dashboards will keep fluctuating.
> - To fix this there a new sort behavior introduced in web sockets

```rust
/// Represents different sorting strategies
enum SortStrategy {
    SqlOrderBy,
    FallbackColumn(String, OrderBy),
    AutoDetermine(String, bool), // (column, is_string)
    NoSort,
}
```
> 1. If `order_by` is already specified in the sql query and the search
service has populated the `order_by` field in its response for the
search, then there is no sort action required on the search results.
> 2. If `fallback_order_by_col` is specified that col is selected for
sort. This will mainly be used in `Dashboards`.
> 3. If none of the above is specified, there is `auto-determine`
strategy which would check for the `first non-numeric col` else the
`first numeric col`
> 4. `non-numeric` col i.e. `text/string` is always sorted in `asc`.
While, `numeric` col is sorted in `desc`. This applies to both
`FallbackColumn` & `AutoDetermine` strategies.

- [x] redesign web socket search event handling
> - Previously the `cleanup_and_close_session` used to happen inside the
search task thread. Which is suspected :suspect: to be one of the causes
for the `CloseFrame` description and the `DataFrame` data to get merged
and malform the message in the socket.
> - New behavior `cleanup_and_close_session` will happen outside of the
search task spawned once search is complete.
> - Since its suspected :suspect: that there is some race condition 🏃🏾
when the web socket frames are being sent the env variable
`ZO_WEBSOCKET_CLOSE_FRAME_DELAY` default `0` is created to introduce a
delay preferred `10 ms` to ` 100ms` before sending the `CloseFrame`
> - `SEARCH_REGISTRY` now will hold the different states of search which
are `Running`, `Cancelled` & `Completed`
> - The search task is modified to now listen for a `cancel` from the
`mpsc` channel and does `cleanup_search_resources`

Related Issues:
- #5967 
- #5974

---------

Co-authored-by: loaki07 <rustyloaki@gmail.com>
Co-authored-by: Loakesh Indiran <66478092+Loaki07@users.noreply.github.com>
Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
2025-02-17 08:52:14 +05:30
Hengfei Yang 466066ac52 fix: search around error (#5982) 2025-02-17 09:05:34 +08:00
Subhra264 d4ea6f753e feat: add updated_at micro timestamp column to dashboards (#5960)
Add `updated_at` column to dashboards table. Note that `updated_at`
stores UTC timestamp in microseconds.
Addresses #5973
2025-02-14 15:07:49 +05:30
Hengfei Yang 66ea923829 fix: grpc token issue with super cluster (#5957) 2025-02-13 17:17:22 +08:00
Yashodhan JoshiandYashodhan Joshi 6506c2b843 fix: add quotes for fixing values api for reserved keywords (#5937)
Fixes an issue reported by user where if the field name is a reserved
keyword in sql, the values api would error out. By adding quotes around
the field, we specifically indicate that it is a field name and not a
kw, so it works. Also checked for non-kw names, also works.

fixes #5917

Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
Co-authored-by: Yashodhan Joshi <yjdoc2@gmail.com>
2025-02-12 12:28:33 +05:30
Hengfei Yang fbeae17f1f feat: sync from enterprise branch (#5924) 2025-02-11 23:14:18 +08:00
Loakesh Indiran c14c4d6d85 fix: ws update histogram interval sql (#5929)
The`Sql::new()` has optimization where it removes all the filters in
sql, when the tantivy index is enable.

By using the sql from the original req, the above scenario can be
avoided.
2025-02-11 20:00:25 +05:30
Zhao.weiandhengfei yang 5bd8cb0651 feat: super cluster stream stats (#5904)
- [x] Add a gRPC API for get stats from other cluster
- [x] Update stream stats cache logic to get stats from all of the
clusters.

---------

Co-authored-by: hengfei yang <hengfei.yang@gmail.com>
2025-02-10 14:03:43 +08:00
Hengfei Yang 9fbd25fb78 fix: stream stats with data retention (#5905) 2025-02-08 19:58:29 +08:00
Patrick Sullivan 0111124a15 refactor: Split openfga and dex modules into their own crates (#5876)
Note: This PR has an [accompanying
PR](https://github.com/openobserve/o2-enterprise/pull/331) in the
enterprise repo

This splits the `openfga` and `dex` modules into their own crates,
`o2_openfga` and `o2_dex`.

**Why?** 
We want to be able to reference the `o2_enterprise::openfga` module from
within the `infra::table` module so that we can perform OpenFGA data
migrations as part of data transformation migrations in the
`openobserve` app. However, the `o2_enterprise` module references the
`infra::table` module in various places (eg: inside
`o2_enterprise::enterprise::actions::action_manager`). Therefore we
cannot reference `o2_enterprise::enterprise::openfga` from
`infra::table` without introducing a circular dependency.

The solution presented by this PR is to move the `openfga` module into
its own crate, so that `infra::table` can reference the new create
without creating a circular dependency. As part of this PR we also move
the `dex` module into its own crate since the `openfga` module depends
on the `dex` module, and we do not want the new `o2_openfga` crate to
depend on the `o2_enterprise` crate.

![Captura de pantalla 2025-02-04 a la(s) 3 53 42 p
m](https://github.com/user-attachments/assets/bb2b748c-e40c-470f-a295-90087f4ed989)

![Captura de pantalla 2025-02-04 a la(s) 3 51 14 p
m](https://github.com/user-attachments/assets/3237aa75-fc31-4821-bf80-3ec83e9c39bc)
2025-02-06 08:35:18 -06:00
Taiming Liu 632da3c0b4 feat: migrate template & destination (#5701) 2025-02-04 18:25:21 +08:00
Hengfei Yang d7bb1cebd0 fix: stream stats negative issue (#5859) 2025-02-04 17:56:46 +08:00
Loakesh Indiran e970aaf2cf fix: vrl ws (#5855)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Refactor**
- Simplified the construction of search queries to ensure consistent
behavior without altering error notifications.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-02-02 10:44:48 +05:30
+1 9184a090f8 feat: dashboard annotations (#5680)
- #5844

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

Based on the comprehensive summary of changes, here are the updated
release notes:

- **New Features**
	- Added timed annotations functionality for dashboards.
	- Introduced ability to create, edit, and delete annotations on panels.
- Implemented annotation management across frontend and backend systems.

- **Improvements**
	- Enhanced chart rendering to support annotation visualization.
	- Added new API endpoints for annotation operations.
	- Improved dashboard interaction with annotation mode.

- **Backend Changes**
- Created new database migrations for timed annotations and timed
annotation panels.
	- Added database entities and relationships for annotations.
	- Implemented service-level logic for annotation management.

- **Frontend Changes**
- Added new components for annotation management, including
`AddAnnotation`.
	- Integrated annotation services and composables.
- Updated chart rendering to display annotations and improved panel
interactivity.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: ktx-vaidehi <vaidehi.akhani@kiara.tech>
Co-authored-by: Kirtan Thakkar <kirtan@kiara.tech>
Co-authored-by: Shyam Panjiyar <shyam@openobserve.ai>
Co-authored-by: ktx-vaidehi <134508096+ktx-vaidehi@users.noreply.github.com>
Co-authored-by: Huaijin <haohuaijin@gmail.com>
Co-authored-by: Neha P <144308844+neha00290@users.noreply.github.com>
Co-authored-by: Subhra264 <chakrabortysubhradeep556@gmail.com>
Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
Co-authored-by: Bhargav <BJP232004@GMAIL.COM>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-31 18:02:06 +05:30
Ashish Kolhe a201c054f2 fix: permission issue for native users (#5818)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Refactor**
- Improved code readability by adjusting indentation and line
organization in the permissions checking utility
  - No functional changes to the existing code logic

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-01-27 18:19:34 +05:30
Loakesh Indiranandomkark06 0745f21cbf feat: streaming aggs ws (#5750)
Closes: #5761

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Enhanced search functionality with improved streaming output handling.
- Added a new optional property for streaming aggregations in search
responses.
- Introduced a new `TimeOffset` struct for better representation of
time-related data in responses.
- New method `setCancelSearchError` to manage error states for cancelled
search queries.

- **Bug Fixes**
- Refined search response management to prevent unintended result
duplication.
- Improved handling of total count in search responses based on
streaming aggregations.
- Added pagination checks to prevent unnecessary requests when limits
are reached.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: omkark06 <omkar@zinclabs.io>
2025-01-25 11:03:01 +05:30
udev 022c313a93 fix: Add license (#5802)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

- **License Management**
  - Added new allowed license: BSL-1.0
  - Removed license exceptions for `clipboard-win` and `error-code`

- **Code Improvements**
- Updated import statements to include additional enterprise action
functions
- Removed conditional compilation for `APP_DEPLOYER` variable, making it
universally accessible

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-01-25 09:47:19 +05:30