Commit Graph
470 Commits
Author SHA1 Message Date
Subhra264 22ecc96589 fix: list only permitted for enrichment tables list (#4480)
- [x] Enrichment tables are not listed correctly with RBAC.
- [x] Create ofga ownership for metadata streams
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit


## Summary by CodeRabbit

- **New Features**
- Enhanced handling of stream types for improved flexibility and
functionality.
- Introduced enterprise-level ownership management features for metadata
handling in the context of the enterprise feature.

- **Bug Fixes**
- Streamlined logic for retrieving model keys associated with stream
types, ensuring more accurate results.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-09 17:35:23 +05:30
Yashodhan Joshi d45ac8f9ad fix: unify the trace ingestion handling (#4435) 2024-09-05 13:33:15 +08:00
Subhra264andBhargav 2f4728c860 feat: add URI query fields for alert list filtering (#4436)
Added `owner` and `enabled` URI query parameter for the
`{org_id}/alerts` and `{org}/{stream_name}/alerts` `GET` APIs. E.g. -
`{org}/alerts?owner=user@user.com&enabled=true`.

Fixes #4273 

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


- **New Features**
- Introduced a new filtering capability for alerts, allowing users to
filter by owner and enabled status.
- Added a new structure, `AlertListFilter`, to manage alert filtering
criteria.

- **Improvements**
- Enhanced alert retrieval functions to support user-defined query
parameters for more granular control over alert listings, improving the
overall usability of the alert system.
- Expanded filtering logic in the AlertList component for a more
comprehensive search capability within the alert list.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Bhargav <BJP232004@GMAIL.COM>
2024-09-04 16:13:25 +05:30
Subhra264 7680952cdd fix: use ofga mapping in tuple object type for search permission checking (#4456)
Fixes #4455 

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

- **New Features**
- Enhanced authorization checks for `query`, `query_range`, and `series`
functions to dynamically reflect stream types.
- Improved permission validation logic in the `search` and
`search_multi` functions, allowing for more accurate access control
based on user roles and stream types.
- Updated logic in the `get_latest_traces` function to refine the
construction of the `o2_type` field for better permission checks.

- **Bug Fixes**
- Corrected the mapping of stream types to model keys, enhancing
security and accuracy in permission checks.

- **Chores**
- Added necessary imports for `OFGA_MODELS` to support new permission
logic.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-04 14:23:45 +05:30
Taiming Liu 7f75a4d6db feat: use FST for inverted indexing (#4270) 2024-09-02 22:39:44 +08:00
Hengfei Yang 476d7cd268 fix: debug syslog ingestion (#4402) 2024-08-30 20:50:09 +08:00
Subhra264 8df35ecffc fix: improve triggers reporting, update trigger status if alert query is invalid (#4393)
- Fixes #4394
- When cloning alert, don't copy `last_satisfied_at`,
`last_triggered_at`

When the alert query is invalid, the scheduler stops processing the
alert and returns, but the error message is not reported in the triggers
usage stream. This PR fixes that.

When the alert query is invalid, it will be retried again and again
(default maximum number of retries is `3`). After that, the associated
`scheduled_jobs` record will be automatically removed from the table and
hence the alert will not be triggered anymore.

In order to schedule the alert again, the user needs to update the query
and again save it, it will start scheduling again.

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


## Summary by CodeRabbit

- **New Features**
	- Enhanced alert handling logic for improved robustness and clarity.
- Introduced structured handling of alert data with better error
management.
- Added initialization of `last_triggered_at` and `last_satisfied_at`
fields to ensure clear state management for alerts.

- **Bug Fixes**
- Improved error handling for alert evaluation, ensuring accurate status
updates for alert triggers.
- Enhanced state preservation for alerts by updating the
`last_satisfied_at` timestamp during saves.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-08-29 19:47:31 +05:30
Huaijin a7990a4d1d feat: impl union plan for single node (#4352) 2024-08-28 23:31:00 +08:00
BhargavandSubhradeep Chakraborty a5af316129 fix: issue #4326 User defined schema settings (#4350)
issue #4326 
  
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Introduced new structures for updating stream settings, allowing for
more granular management of stream configurations.
- Added an asynchronous function for updating stream settings via HTTP
PUT requests.
- Implemented a new service route for handling updates to stream
settings.
  - Enhanced the `AddStream` component to retrieve updated settings.

- **Improvements**
- Improved schema management by tracking previous settings during
updates.
- Enhanced utility functions for comparing and managing stream settings.

- **Documentation**
- Updated documentation to reflect changes in API functionality for
creating and updating stream settings.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Subhradeep Chakraborty <chakrabortysubhradeep556@gmail.com>
2024-08-27 20:52:26 +05:30
Yashodhan Joshi fd26b8b5ef fix: keep tcp connections alive for syslog (#4335) 2024-08-27 18:06:35 +08:00
Subhra264 13cbabd528 fix: use 409 when deleting destination/templates already in use (#4294)
Fixes #4291 

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


- **New Features**
- Introduced a new method for handling 409 Conflict responses in the
HTTP responses, improving error messaging clarity.

- **Bug Fixes**
- Updated error handling to return conflict responses instead of
forbidden responses when certain delete operations fail due to resource
conflicts.
- Enhanced clarity in user membership responses by changing the error
message when a user is already part of an organization.

These changes improve user experience by providing clearer and more
accurate feedback on error conditions related to resource management.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-08-26 11:57:10 +05:30
Subhra264 d2c09cfc89 feat: add last_triggered_at, owner, last_edited_by, updated_at fields in alerts (#4265)
Addresses #4273 

- Adds `last_triggered_at`, `owner`, `updated_at` and `last_edited_by`
fields (similar to Reports) to Alerts.

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

## Summary by CodeRabbit

- **New Features**
- Enhanced alert and report management with additional metadata fields
for tracking last triggered times, owners, and edit history.
- Introduced user identification in report creation and updates for
better ownership tracking.
  
- **Bug Fixes**
- Improved logic for saving alerts and reports to accurately reflect
their statuses and metadata during creation and updates.
  
- **Documentation**
- Restructured import organization for improved clarity and
maintainability in the codebase.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-08-21 15:31:14 +05:30
Ashish Kolhe 0ea4a0be71 feat: results based on multiple caches (#4251)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit


- **New Features**
- Introduced a new structure for enhanced management of cached query
responses, allowing for detailed handling of multiple cached results.
- Added functionality to retrieve multiple cached results in a single
request, optimizing performance and reducing service calls.
- Implemented a mechanism for efficient caching and retrieval of query
results in a distributed cluster environment.
  - Enhanced configuration options for managing result caching behavior.

- **Bug Fixes**
- Improved handling of cache misses and response merging to ensure
robustness against empty responses.

- **Refactor**
- Updated internal logic to support new cached query response structure,
streamlining caching operations and enhancing clarity.
- Introduced new modules to improve code organization related to
multi-cluster operations.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-08-19 21:52:55 +05:30
Hengfei Yang 456144012f fix: merge plan panic (#4209) 2024-08-14 20:29:18 +08:00
Hengfei Yang b05f4ee5ed feat: impl #4200 support skip format stream name (#4203) 2024-08-14 12:33:37 +08:00
54f1448b7c fix: Improved period (time range) functionality in pipelines derived stream (#4191)
Improved Period of derived stream to be same as frequency

Complete the `Frequency` task in the tracking issue #4170 

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

## Summary by CodeRabbit

- **New Features**
- Introduced a new component for managing scheduled alerts with a tabbed
interface for custom alerts, SQL queries, and PromQL queries.
- Enhanced user experience with dynamic input fields, real-time
validation, and aggregation settings for alert conditions.
	- Added cron job configuration options for scheduling alerts.

- **Changes**
- Renamed the scheduled alert component to reflect the new
functionality, impacting how the application handles alert triggering
and scheduling.
- Adjusted timing and frequency parameters for triggering conditions in
the alert management system.

- **Improvements**
- Enhanced logging functionality for monitoring enrichment data saving,
providing insights into operations and parameters involved.
- Improved error handling and response validation processes for
ingestion tasks, ensuring more informative logging and error reporting.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Taiming Liu <liutaiming3@gmail.com>
Co-authored-by: oasisk <ashish.j.kolhe@gmail.com>
2024-08-13 17:15:10 +05:30
Hengfei Yang f57a1a1723 fix: enrichment table ingestion should be always append mode (#4175) 2024-08-11 15:09:19 +08:00
8031e001b9 feat: derived stream (#4160)
`DerivedStream`, as part of `Pipeline`, enables the use case of querying
an existing stream, `source`, with optional conditions and aggregations.
The resulted data will then be ingested into a new stream,
`destination`.

This PR provides the feature's initial offering. Please follow below
issue to track & suggest future improvements
#4170 

Co-authored-by: omkark06 <omkar@zinclabs.io>
Co-authored-by: hengfei yang <hengfei.yang@gmail.com>
2024-08-09 13:29:00 -07:00
Hengfei Yang 9a3b86da1e fix: request timeout after an error happened (#4148) 2024-08-09 12:06:15 +08:00
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