Commit Graph
451 Commits
Author SHA1 Message Date
Hengfei Yang 0e9df3dcbc fix: value api for number values (#4134) 2024-08-06 21:37:21 +08:00
Huaijin caed2c8c75 fix: use config timestamp and error message improve (#4104) 2024-08-01 20:44:35 +08:00
Hengfei Yang d2bfb960dd fix: multi stream search panic (#4101) 2024-08-01 18:14:16 +08:00
Hengfei Yang 8a0dbe2cf4 feat: remove sql_mode, query_context and aggs from search API (#4089) 2024-07-31 11:23:11 +08:00
Hengfei Yang 82fc1dfb58 feat: value API without count (#4013) 2024-07-19 20:08:28 +08:00
Hengfei Yang 99970f7d0c feat: use cache for value API (#3997)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Bug Fixes**
	- Improved caching behavior and response processing in search requests.
- Enhanced error handling and response generation for better user
experience.

- **Tests**
- Disabled specific UI interaction in Playwright tests to prevent test
failures.

- **Chores**
	- Updated configuration defaults to improve clarity and efficiency.
	- Made internal constants publicly accessible for broader usage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-18 08:09:12 +05:30
胡同里有猫 6a5291f8ea feat: add span metrics for traces (#3787) 2024-07-17 12:36:53 +08:00
Taiming Liu 2a4c296b3f feat: Routing support for all ingestion APIs (#3970)
feat: Routing support for all ingestion APIs. close #3941
2024-07-16 18:31:23 -07:00
Ashish Kolhe 428abe864d chore: add result stats to status api (#3991) 2024-07-17 08:01:06 +08:00
baerwang 73be9a4e82 feat: support swagger enable open (#3986) 2024-07-16 18:02:40 +08:00
Hengfei Yang 17287f7ba8 fix: consistent hashing with querier group (#3978)
- [x] Add two consistent hashing table for `Interactive` and
`Background` querier group
- [x] Only cache latest parquet files for `Interactive` queriers.
2024-07-15 10:25:15 -07:00
Huaijin b6f0f9ef64 feat: add short vs long query in query manager (#3962) 2024-07-12 17:34:21 +08:00
Taiming Liu 9e81565d5f feat: role-group based node selection (#3960)
Categorizes nodes into role groups selected to serve different query
requests based on query search event type.

--- 
Each node can be configured into different role groups by using the new
env: `ZO_NODE_ROLE_GROUP`
- default: `` (empty: none)
- node for high-priority tasks: `interactive`
- node for low-priority tasks: `background`

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

- **New Features**
- Introduced `node_role_group` configuration to specify role groups for
nodes.
- Added `SearchEventType` to `SearchRequest` to enhance search
capabilities.
  - Implemented `RoleGroup` enum to categorize nodes based on priority.

- **Improvements**
- Updated node registration and status setting to include `role_group`.
  - Enhanced logging to include node's role group in cluster operations.
- Streamlined search logic by assigning `search_type` earlier in the
request handling process.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-12 11:04:13 +05:30
Hengfei Yang f66ff1f3d2 refactor: separate search with cache (#3958) 2024-07-11 21:40:03 +08:00
Ashish Kolhe 94df9c550c fix: cache ratio issue (#3953)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added sorting functionality for search results based on an
`is_descending` flag.
- Enhanced logging to provide information about cache and result
lengths.

- **Improvements**
  - Optimized internal calculations for search results cache.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-11 13:55:35 +05:30
Taiming Liu a7bec2e5e6 fix: cancel all internal trace_ids (#3952) 2024-07-11 12:56:10 +08:00
Subhra264 d0d213edba fix: enable rbac for index streams (#3905) 2024-07-10 18:15:59 +08:00
Hengfei Yang 46a5af14fe feat: secondary index (#3870) 2024-07-10 15:08:07 +08:00
Taiming Liu 2f633771f0 fix: avoid otlp tracing being split into parts (#3937)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Refactor**
- Improved tracing instrumentation across various search-related
functions by removing the `trace_id` field and refining how `trace_id`
is handled in logs.

- **Bug Fixes**
- Enhanced logging consistency and accuracy by standardizing trace ID
processing in `get_file_list`, `search`, `cluster_search`,
`search_parquet`, and `search_memtable` functions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-10 09:39:19 +05:30
Subhra264 6f9ee5e305 fix: when adding existing user to another org, given role should be correct (#3911)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- User roles are now dynamically assigned based on the `role` parameter
during user addition to an organization.

- **Enhancements**
- Improved role management by incorporating a feature flag for
enterprise-level role determination.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-09 10:48:43 +05:30
Ashish Kolhe 45dce09ff3 fix: query result cache v2 (#3895)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added new fields `is_descending` and `limit` to query responses for
enhanced sorting and pagination.

- **Improvements**
- Enhanced logging and tracing for better query time tracking and
debugging.
- Streamlined span handling for more efficient tracing and
instrumentation.

- **Bug Fixes**
- Fixed validation for `result_cache_enabled` configuration to prevent
cache-related errors.
  - Improved accuracy in cache limit handling in query responses.

- **Chores**
- Updated Rust toolchain version for improved compatibility and
performance.


<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-08 20:33:18 +05:30
Taiming Liu 842dbdb647 fix: unnecessary null field during compaction (#3917) 2024-07-08 17:43:39 +08:00
Taiming Liu 4bff0be32e fix: trace's span name (#3916) 2024-07-06 22:16:55 +08:00
Ankur Srivastava e2bdcba658 fix: extra path was added in cancel, need only org (#3913)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Bug Fixes**
- Improved the request handling for job cancellation, ensuring a
smoother and more reliable user experience when canceling multiple jobs.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-05 16:22:55 +02:00
Hengfei Yang 7a15c24f98 fix: cancel query for super cluster (#3909)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
  - Added support for canceling queries within a specific organization.
- Introduced a new RPC method, `ClusterCancelQuery`, for enhanced query
management.

- **Enhancements**
- Improved the `cancel_query` functionality to include organization ID
parameters for more targeted query management.
- Updated error handling and logging for better debugging and user
clarity.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-04 22:17:43 +05:30
Subhra264 974a61bb6f fix: include org_id in list_objects for rbac (#3841)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Enhanced authentication and authorization handling for user requests
with more efficient token validation.
- **Bug Fixes**
- Improved error handling and response based on user permissions and
authorization status.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-04 12:46:33 +05:30
Huaijin 33343bbab3 feat: add metrics for query lifetime (#3893) 2024-07-04 14:13:25 +08:00
Taiming Liu 6157ef5331 feat: schema check per req for all logs ingestion APIs (#3829) 2024-07-04 11:21:47 +08:00
Taiming Liu 76d92bdcbe fix: openai schema (#3900)
close #3840 
add the missing SearchEventType and delete repeated UpdateUser in
openapi schema
2024-07-03 18:44:53 -07:00
Ashish Kolhe 6af3f96fc3 fix: query cache remove hits (#3887)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added `result_cache_ratio` to the search feature to improve response
management.
  - Introduced `discard_interval` parameter to enhance cache handling.

- **Improvements**
- Enhanced cache retention and discarding logic with `discard_interval`
for better performance.
- Improved timestamp parsing and rounding functions for more accurate
data handling.

- **Refactor**
- Reorganized logging and utility functions within the search and cache
modules for better code maintainability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-03 10:10:37 +05:30
Omkar KesarkhaneandTaiming Liu 7eafb64d71 fix: added traces ids support in search requests (#3872)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced trace ID management with functions for adding, removing,
and generating trace contexts.
  - Added the ability to cancel running queries.

- **Enhancements**
- Integrated tracing functionality into search operations for improved
observability.
  - Updated CORS configuration to allow `traceparent` headers.

- **Debugging**
  - Added console logs for traceparent parameters in search functions.

- **Localization**
  - Added new localization key for "cancel" message in English.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Taiming Liu <liutaiming3@gmail.com>
2024-07-02 07:02:30 -07:00
Subhra264 118f916e9a feat: add time_wait_in_queue in search usage reporting (#3878) 2024-07-02 20:13:10 +08:00
Ashish Kolhe 723e00bfb1 fix: schema read lock (#3876)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Improved search function performance and reliability by managing
resources more effectively.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-02 12:41:19 +05:30
Ashish Kolhe c70a03aa57 chore: add trace id to cache logs (#3868)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Enhanced traceability by adding `trace_id` support in various search
and cache request functions.
  
- **Improvements**
- Updated logging messages to include `trace_id` for better traceability
across services.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-01 18:02:56 +05:30
Ankur Srivastava b6a4009ac4 feat: basic auth header support in GET requests (#3792)
Support basic-auth header parsing and login for enterprise-GET requests

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

- **Bug Fixes**
  - Improved logging for user validation to aid in debugging.

- **New Features**
- Enhanced authentication process with better handling of headers and
tokens.
- Introduced new cookie preparation functionality to streamline cookie
management during authentication.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-01 08:48:26 +02:00
Ashish Kolhe 4466ec7a0d fix: discard last x min of cached data (#3859)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced logging for query start and end times in the search
functionality for better tracking and debugging.

- **Improvements**
- Enhanced cache management by adding logic to discard cached results
based on their duration, ensuring more efficient use of cache storage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-06-30 10:49:49 -07:00
Ashish KolheandHengfei Yang 91eccf7b57 chore: add license header (#3857)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Documentation**
- Added licensing information to various files to comply with GNU Affero
General Public License.
- Updated copyright information from Zinc Labs Inc. to OpenObserve Inc.

These changes do not affect the application's functionality but ensure
proper licensing documentation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
2024-06-30 10:09:52 +05:30
Ashish Kolhe a35bd30cf7 feat: cache query results (#3823)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added the ability to delete cached search results for specific
streams.
- Introduced query caching functionalities, including disk-based caching
and cluster-wide query result retrieval.

- **Enhancements**
- Implemented new methods for removing keys from caches based on
different strategies (e.g., LRU, FIFO).
  - Added new utility functions for handling and optimizing SQL queries.

- **Improvements**
- Enhanced caching mechanism to support better performance and
efficiency through new data structures and asynchronous operations.
- Expanded public APIs to include additional regex patterns and utility
functions for SQL processing.

- **Documentation**
- Updated public API documentation to reflect new functionalities and
changes in existing functions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-06-29 19:39:58 +05:30
Hengfei Yang ac4b804494 feat: add custom table provider (#3846) 2024-06-29 20:08:55 +08:00
ktx-vaidehiandoasisk 69f3db0612 feat: Dashboard query range per stream (#3804)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added a button with tooltip in the dashboard panel to display query
range values.

- **Improvements**
- Updated error messages in search functionality to mention query range
restrictions in hours.
- Enhanced log and dashboard pages with a function to generate formatted
error messages for query range limits.

- **Bug Fixes**
- Fixed alignment issues in the `usePanelDataLoader` function call
within the dashboard components.

- **Event Handling**
- Introduced a new event `"result-metadata-update"` in dashboard panel
renderer for better metadata updates.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: oasisk <ashish.j.kolhe@gmail.com>
2024-06-25 14:45:00 +05:30
Hengfei Yang cd37c3d5b5 feat: Exclude _all field for select * (#3808) 2024-06-25 12:01:11 +08:00
Subhra264 e885f605bc fix: add _timestamp to usage reporting (#3799)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added timestamp tracking to various functions to capture the start
time of operations. This enhancement improves monitoring and debugging
by logging when operations begin.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-06-24 18:28:21 +05:30
Ashish KolheandHengfei Yang 2158b0de1a feat: add setting for query range per stream (#3789)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added support for query duration adjustments based on a maximum query
range in search functionality.
	- Introduced new fields for time range validation in search responses.
	- Included maximum query range settings in stream configurations.

- **Improvements**
- Enhanced log stream components to handle maximum query range
restrictions effectively.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
2024-06-22 23:41:29 +05:30
Hengfei Yang 6a17c42e83 feat: support user level search work group (#3790) 2024-06-23 00:59:52 +08:00
Subhra264 6e38089e97 fix: include login calls into auditing (#3758)
- [x] Includes the following APIs endpoints in auditing -
- `/auth/login` - If the login is successful, the user email along with
the event data (such as response code, path, method, query params and
the timestamp) and if it is unsuccessful, it still audits the event, but
username will be present only if available.
- `/auth/presigned-url`
- `/auth/login` - `GET` request. Similar to the first `login` endpoint.
- `/config/reload` - Audits this event, but as this is not a protected
route, the username will not be present in the audit record.
- `/config/redirect` - Similar to the first `login` endpoint.
- `/config/logout`

- [x] Audit Cron job is run on all the nodes including the router. The
interval can be set through `O2_AUDIT_PUBLISH_INTERVAL` env (in
seconds).
- [x] In case of remote usage reporing, print the error if response from
remote usage url is unsuccessful


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

- **New Features**
- Introduced enhanced auditing functionalities for user authentication
and authorization in the enterprise version.
- Added asynchronous task for auditing and publishing tasks within job
module.

- **Improvements**
- Refined error handling in usage data ingestion to better manage
success and failure responses.
  
- **Conditional Compilation**
- Multiple new functionalities and auditing enhancements are now
conditionally compiled based on the "enterprise" feature.


<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-06-20 18:13:35 +05:30
0b721732b8 fix: Relase multi stream search (#3709)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced multi-select stream functionality in UI, allowing users to
select and query multiple data streams simultaneously.
- Added new search functions to handle multiple streams of data and
provide aggregated search results.

- **Bug Fixes**
- Corrected UI test cases to improve selection and verification of
stream names.

- **Enhancements**
- Improved search functionalities and error handling within the logs
plugin interface.
  - Enhanced stream handling and validation in the search feature.

- **Tests**
- Added new Playwright test cases for stream multi-select functionality.
- Updated existing test cases to adapt to new multi-select stream logic.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Neha P <neha@openobserve.ai>
Co-authored-by: Neha P <144308844+neha00290@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
Co-authored-by: Subhradeep Chakraborty <chakrabortysubhradeep556@gmail.com>
2024-06-19 18:30:34 +05:30
Ankur Srivastava ba3b27d780 fix: ensure that dashmap isnt getting deadlocked + more logs (#3747) 2024-06-17 10:46:00 +08:00
Ankur Srivastava dd489e99b0 fix: the base_url didnt contain web+base_uri for presigned url (#3746)
In case of generating a presigned-url the base url should be a
combination of
```
let base_url = format!("{}{}", cfg.common.web_url, cfg.common.base_uri);
```

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

## Summary by CodeRabbit

- **Refactor**
- Improved URL construction by introducing a `base_url` variable for
better maintainability and flexibility.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-06-16 18:52:36 +02:00
Hengfei Yang 2597a06262 feat: sync hotfix from v0.10.6-rc3 (#3738) 2024-06-14 19:20:19 +08:00
Hengfei Yang 611f2e1c29 perf: improve ingestion (#3678) 2024-06-12 22:01:03 +08:00