Commit Graph
1201 Commits
Author SHA1 Message Date
Hengfei Yang 0d2e183739 perf: keep improve metrics performance (#5729) 2025-01-22 08:16:31 +08:00
Hengfei Yang 1117c871e4 perf: keep improve metrics performance (#5758) 2025-01-21 21:36:16 +08:00
Taiming Liu 57fa94cc5b feat: enable trace ingestion for scheduled pipeline (#5672)
fix: #5522 

- [x] trace ingestion for scheduled pipelines
- [x] pause/unpause for scheduled pipelines
- [x] new trace ingestion handler that accepts json
2025-01-20 14:29:33 +08:00
Hengfei Yang a2d538c449 fix: tls with router (#5739) 2025-01-19 22:09:24 +08:00
Hengfei Yang 00fb627c32 fix: use http domain for tls inner communication (#5735) 2025-01-18 12:05:25 +08:00
Subhra264 e8f7cf33d7 fix: update error message for folder duplicate name error (#5732)
Currently, the backend returns a raw database internal server error
(500) when updating or creating a folder with a name that already exists
in the same organization. This pr avoids exposing the raw database error
to the api and instead returns a 400 bad request error.

Addresses #5723 

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

## Summary by CodeRabbit

- **New Features**
- Enhanced folder management with prevention of duplicate folder names
within an organization
- **Bug Fixes**
- Added validation to prevent creating folders with names that already
exist
- **Improvements**
	- Improved error handling for folder creation and update scenarios
	- More descriptive error messages for folder-related operations

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-01-17 22:14:28 +05:30
Taiming Liu 43967569e6 fix: check super_cluster_enabled before syncing (#5727) 2025-01-16 13:52:37 -08:00
Hengfei Yang fea08d8f75 fix: multiple stream can't query with PromQL (#5719) 2025-01-16 14:47:47 +08:00
Hengfei Yang adc52c1ed1 feat: keep optimize metrics cache (#5716) 2025-01-16 11:38:58 +08:00
Patrick Sullivan c67e684a5c feat: Clean up old alerts code (#5712)
Now that the old alerts code, which stored alerts in the `meta` table,
has been removed, `alert/mod.rs` mostly just serves as a wrapper around
`alert/new.rs`.

This PR removes `alert/new.rs` and moves its logic into the parent
`alert` module. Also `alert/mod.rs` is replaced with `alert.rs` since
the `alert` module no longer contains child modules.

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

## Summary by CodeRabbit

## Release Notes

- **New Features**
- Enhanced alert management functionality with improved listing and
caching capabilities
  - Added new methods for retrieving and managing alerts more flexibly

- **Changes**
- Updated alert listing method to support more specific filtering
parameters
  - Simplified alert retrieval and management processes

- **Refactor**
- Restructured alert-related functions to improve code organization and
maintainability
  - Streamlined database interaction methods for alerts

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-01-15 14:36:27 -06:00
Patrick SullivanandTaiming Liu 47dc8e4d44 feat: remove old alert code that stored alerts in meta table (#5711)
Follow-up:
Consolidate the `alert/new.rs` and `alert/mod.rs` files into one file,
since now the `alert/mod.rs` file mostly just acts as a wrapper around
the `alert/new.rs` file

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

## Summary by CodeRabbit

- **Refactor**
	- Removed legacy alert handling module
	- Simplified alert management logic
	- Eliminated dual-table approach for alerts
	- Streamlined alert operations to use new alerts table exclusively

- **Chores**
- Removed deprecated code and conditional checks related to old alert
management system

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

Co-authored-by: Taiming Liu <liutaiming3@gmail.com>
2025-01-15 12:16:27 -06:00
Hengfei Yang c2d4866565 feat: impl metrics cache (#5688)
impl #5656 

## Todo

- [x] Router consistent hashing for PromQL
- [x] Remove the key from index if the key get nothing from cache
- [x] Some cache item is empty, it should not
- [x] Add cache control ENV: `ZO_METRICS_CACHE_ENABLED=true`
- [ ] Optimize cache gc logic
- [ ] New encoding of RangeValue for cache
- [x] New cache key generate
- [x] Load cache from disk
- [ ] Histogram query OOM without cache for 2 days
- [x] Fix response series order
- [x] Need to check stream is exists
- [x] Add trace_id to the response
2025-01-15 08:59:53 -08:00
Patrick SullivanandSubhradeep Chakraborty f66d069c55 fix: Emit supercluster events for folder creation/deletion/updates (#5702)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Release Notes

- **New Features**
- Enhanced folder management with improved unique identifier generation.
- Added enterprise-specific folder processing for create, update, and
delete operations.
- Introduced new asynchronous functions for processing folder-related
messages.
- Added optional ID parameter for alert creation, enhancing flexibility.

- **Changes**
- Updated folder-related function signatures to return more
comprehensive information.
- Integrated enterprise-level folder message processing in super cluster
queue.
- Relocated and centralized message definitions for alerts and
dashboards.

- **Improvements**
  - Refined error handling for folder operations.
  - Centralized message handling for folder-related events.
  - Improved clarity and maintainability in dashboard moving logic.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Subhradeep Chakraborty <chakrabortysubhradeep556@gmail.com>
2025-01-15 18:25:52 +05:30
Patrick Sullivan 1c80727adb feat: move FolderType into config::meta module (#5700)
We need to be able to reference the `FolderType` enum from
`o2-enterprise` without introducing a dependency on the `table` module.
Therefore, this PR moves the `FolderType` enum out of the `table` module
and into the shared `config::meta` module.

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

- **New Features**
- Introduced a new `FolderType` enum to categorize folders as Dashboards
or Alerts.
- Enhanced folder management with more precise type handling across
different services.

- **Refactor**
- Updated import statements and type references for `FolderType` across
multiple modules.
	- Standardized folder type conversion and handling mechanisms.

- **Improvements**
	- Added more robust folder creation and validation logic.
	- Improved error handling for folder-related operations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-01-14 20:35:43 -06:00
Taiming Liu a2c175e412 fix: pipeline super_cluster update (#5699)
- [x] pipeline super cluster delete missing db update
- [x] use another local cache to map `pipeline_id` to `stream_params`
2025-01-14 18:02:36 -08:00
Patrick SullivanandSubhradeep Chakraborty 947a8ddc4e fix: Migration to enforce unique folder names (#5689)
### Summary

Folder names within an individual organization and within a specific
folder type should be unique.

This migration adds a migration to...
1. Rename any folders that have the same name, organization, and folder
type by appending a 27-character random KSUID to the name to ensure that
each name is unique.
2. Create a unique constraint on the `folders` table on the composite
key of `org`, `type`, and `name`. This will prevent new folders from
having duplicate names in the future.

### Follow-up work

If a user tries to create or update a folder so that the folder would
have the same name as another folder with the same `org` and `type`,
then the database will reject the query and the application will return
an error response. However the error response will likely just contain
the error text returned by SeaORM.

We should also update the logic in `/src/service/folders.rs` to check
for duplicate folder names when folders are created or updated and to
gracefully return a useful error.



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

- **New Features**
- Implemented a database migration to ensure unique folder names within
an organization.
- Added a mechanism to automatically rename duplicate folders by
appending a unique identifier.
- Created a unique constraint for folder names across organization and
type.
	- Introduced a new API endpoint to retrieve folders by name.
- Added a deprecated API endpoint for retrieving folders by name with a
different structure.

- **Improvements**
- Enhanced database integrity by preventing naming conflicts in folder
management.
- Improved authorization logic for GET requests targeting folders by
name.
- Added functionality to retrieve folders by their name in the service
layer.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Subhradeep Chakraborty <chakrabortysubhradeep556@gmail.com>
2025-01-14 17:30:30 -06:00
Taiming Liu 98fd05211a fix: pipeline db event watch for updating in-memory cache (#5685)
Using database event watch to update in-memory cache for pipeline db
operations
2025-01-13 19:31:20 -08:00
Huaijin 70450ec01a feat: ignore time_range when join on enrichment_tables (#5684) 2025-01-13 23:47:06 +08:00
Huaijin e81d8da46a fix: union all with order by (#5674) 2025-01-13 12:11:18 +08:00
Hengfei Yang 445a50ddde fix: metrics Mismatch between schema and batches (#5673) 2025-01-12 15:13:00 +08:00
Huaijin 36de81c437 feat: impl join right table only match once (#5661) 2025-01-11 11:57:57 +08:00
Hengfei Yang 44b5daf949 feat: add limit for uds (#5669) 2025-01-11 09:59:59 +08:00
Patrick SullivanandTaiming Liu 500c53295c feat: New MoveAlert endpoint (#5626)
Adds a new endpoint for moving an alert between different folders.

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

- **New Features**
	- Added ability to move alerts between folders.
	- Introduced new endpoint for moving alerts.
- Enhanced alert management with improved validation and error handling.

- **Bug Fixes**
	- Improved alert retrieval to include folder context.

- **Documentation**
	- Updated OpenAPI documentation to include new alert movement endpoint.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Taiming Liu <liutaiming3@gmail.com>
2025-01-10 11:18:54 -06:00
Subhra264 fe9eaa1f0e fix: move dashboard rbac ownership (#5671)
When we move a dashboard from one folder to another, currently the rbac
relations are not updated, so the folder still points to the old folder
as `parent` in the ofga `tuple` database.

This PR fixes this issue by updating the `parent` relationship between
the dashboard and the old and new folders.

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

## Summary by CodeRabbit

- **New Features**
- Enhanced dashboard management with improved access control integration
- Added support for setting and removing parent relations for dashboards
using OpenFGA system

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-01-10 22:14:52 +05:30
Huaijin 3c3d9a46e8 feat: retention for search jobs (#5655)
close #5645 

## New Env
```
ZO_SEARCH_JOB_RETENTION
```

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

## Summary by CodeRabbit

## Release Notes

- **New Features**
  - Added configurable search job retention setting
  - Implemented job retention management for search jobs

- **Enterprise Features**
  - Enhanced job deletion mechanism based on retention period
  - Added ability to automatically clean up older search jobs

- **Configuration**
- New option to specify how long search jobs are kept (default: 30 days)

These updates improve system management and provide more control over
job lifecycle, particularly for enterprise users.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-01-10 10:10:41 +05:30
Patrick Sullivan 8cdf9aff3b fix: Fix UpdateAlert v2 endpoint (#5647)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
	- Improved alert update and enablement process
	- Enhanced transactional handling for alert state changes

- **Refactor**
- Updated alert management logic to provide more robust state
transitions

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-01-09 14:50:33 -06:00
Hengfei Yang a686ec6927 fix: metrics ingestion with otlp json (#5649) 2025-01-10 00:22:36 +08:00
Huaijin 43b7bad404 feat: add pagination for search job result (#5640)
- [x] list status order by createdat desc
- [x] add pagination for search job result
```
curl --request GET \
  --url 'http://localhost:5080/api/default/search_jobs/bL3PkaKBp9maA6DpJ8Z/result?from=10&size=30' 
```
2025-01-09 17:41:40 +08:00
Hengfei Yang f4a7388aae feat: add option for extra default index fields (#5631) 2025-01-09 12:47:18 +08:00
Hengfei Yang 5e449ce63c feat: add option for compact old data (#5615) 2025-01-09 08:53:21 +08:00
Huaijin d7dd9128b7 feat: support limit join's right side (#5616)
related #5602

## New env
```
ZO_FEATURE_JOIN_RIGHT_SIDE_MAX_ROWS=0
```
default is 0, means disable
2025-01-08 15:40:13 +08:00
Huaijin 1a27d16e1e feat: batch read data to avoid metrics OOM (#5584) 2025-01-06 20:11:56 +08:00
Subhra264 0e0b19034d fix: return error if old dashboard delete fails in move dashboard (#5594)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
    - Enhanced error handling for dashboard movement operations
- Improved error reporting when deleting dashboards from old folders
during move operations

- **New Features**
    - Added more detailed error tracking for dashboard-related actions

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-01-06 13:42:22 +05:30
Huaijin ad54320f09 feat: add search job partition result and cache (#5585) 2025-01-06 12:32:51 +08:00
Hengfei Yanganddomyway 39c44de0e5 fix: debug the RUM deadlock (#5558)
for debug the #5398

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

## Release Notes

- **Configuration**
  - Added new configuration option to disable keep-alive connections
  - Adjusted HTTP server connection timeout settings

- **Authentication**
  - Enhanced token validation with improved traceability
- Updated authentication methods to support more detailed request
tracking

- **Performance**
  - Optimized client lock management in MaxMind database downloader
  - Refined request handling in RUM ingestion APIs

- **Logging**
  - Improved logging for authentication and request processing
  - Added trace ID support for better request tracking
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: domyway <weizhao029@gmail.com>
2025-01-06 10:58:08 +08:00
iQQBot ae0f8feba7 fix: dup attributes in link and event (#5583) 2025-01-04 21:52:10 +08:00
Zhao.wei 1ec9471aa3 feat: restrict max hours service account (#5574) 2025-01-04 21:23:05 +08:00
Hengfei Yang d9b6f2fedb fix: compactor with extended retention (#5571) 2025-01-03 18:36:25 +08:00
c32c9dac7b feat: functions UI design revamp (#5549)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Release Notes

- **New Features**
- Added a new function testing capability for VRL (Variable Runtime
Language) functions.
- Introduced interactive UI components for testing and managing
functions, including `FunctionsToolbar`, `TestFunction`, and
`FullViewContainer`.
  - New API endpoint for testing VRL functions against a set of events.
  - Added new localization strings for user interface elements.

- **Improvements**
- Refined UI components for better user experience, including sidebar
management and editor functionalities.
- Enhanced function management with improved error handling and
validation.
- Improved code structure and maintainability across multiple
components.

- **Bug Fixes**
  - Addressed various minor formatting and syntax issues.
  - Improved error handling in function testing and management.

- **Enhancements**
- Updated the `QueryEditor` component for improved formatting and error
diagnostics.
- Enhanced Playwright tests for better targeting and reliability in
function management scenarios.
- Improved layout and responsiveness of several components, including
`AssociateFunction` and `ScheduledAlert`.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: udev <uddhavdave1@gmail.com>
Co-authored-by: udev <uddhav@openobserve.ai>
2025-01-03 15:24:59 +05:30
Patrick Sullivan 73360c2ed3 feat: emit super cluster events for alerts and dashboards (#5561) 2025-01-03 11:27:17 +08:00
Patrick Sullivan 1010dc657a feat: Move alert cluster coordinator event methods into infra crate (#5559)
This moves the methods for emitting and listening for alert-related
cluster coordinator events to the infra crate.

We are doing this so that logic in the enterprise crate can call the
methods to emit cluster coordinator events when responding to a super
cluster queue event.

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

## Summary by CodeRabbit

- **New Features**
	- Enhanced alert management functionality in the cluster coordinator
	- Added new methods for emitting and watching alert events
	- Introduced improved event handling mechanisms for alerts

- **Refactor**
	- Restructured alert event processing logic
	- Modularized cluster coordinator event management
	- Streamlined cache update mechanisms for alerts

- **Chores**
	- Updated infrastructure and service layer modules
	- Added new module for cluster coordinator functionality

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-01-02 12:38:56 -06:00
e5120229dc fix: changes for super_cluster for distinct_values (#5555)
This adds support for super_cluster queue notification for
addition/removal of distinct value fields.

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

- **New Features**
- Added serialization capabilities for `OriginType` and
`DistinctFieldRecord`.
- Introduced new asynchronous functions for managing distinct field
records in the database.
	- Added enterprise-specific event emission for record operations.

- **Refactor**
	- Updated import statements across multiple service modules.
	- Reorganized distinct values handling in the database service.

- **Chores**
	- Added a new module for distinct values management.
	- Improved error handling for dashboard updates and stream operations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
Co-authored-by: Yashodhan Joshi <yjdoc2@gmail.com>
Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
2025-01-02 23:21:23 +05:30
胡同里有猫 b61bcd22fa feat: http tls support v3 (#5554) 2025-01-02 23:42:58 +08:00
Huaijin 0931d5e4e3 feat: add inverted index search for promql (#5552)
reuse the function `filter_file_list_by_tantivy_index` in log tantivy
index to impl the inverted index for promql.

the inverted index for promql only support Equal and Regex, don't support NotEqual and NotRegex.
2025-01-02 21:36:27 +08:00
胡同里有猫 335c161338 feat: http tls support (#5548) 2025-01-02 17:49:14 +08:00
Huaijin 82e9b38d4c feat: impl query exemplars (#5511) 2025-01-02 12:00:11 +08:00
Patrick Sullivan 7adc90461a feat: check for new OpenFGA identifier for alerts (#5520)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Bug Fixes**
- Improved alert permission filtering to support a more flexible
permission structure.
- Enhanced alert access control to ensure accurate alert visibility
based on updated permissions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-01-01 16:01:07 -08:00
Loakesh Indiran 8f605142c6 fix: short_url super cluster support (#5516)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

- **New Features**
	- Enhanced serialization support for short URL records
	- Improved event handling for short URL operations

- **Refactor**
	- Modularized event emission logic for short URL management
- Introduced separate modules for standard and enterprise cluster event
handling

- **Chores**
	- Added support for conditional enterprise features

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-12-31 18:24:33 +05:30
Hengfei Yang 0d2b170427 fix: search data with WAL for promql (#5504) 2024-12-31 18:57:11 +08:00
Huaijin 8e86edafc4 chore: adjust the partition num (#5496)
adjust the partition num
2024-12-31 10:25:17 +08:00