-
Notifications
You must be signed in to change notification settings - Fork 119
feat: 日志数据源切换 unify-query --story=129076973 #9086
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: 日志数据源切换 unify-query --story=129076973 #9086
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request implements a feature to switch log data sources to use unify-query (统一查询). The changes refactor the log search data source classes to inherit from BaseBkMonitorLogDataSource instead of having standalone implementations, and update various parts of the codebase to support this architectural change.
- Adds support for log search time series data type to the unified query data sources list
- Refactors
LogSearchTimeSeriesDataSourceandLogSearchLogDataSourceto inherit fromBaseBkMonitorLogDataSource, reducing code duplication - Updates event-related log queries to use the
UnifyQuerywrapper for consistent query handling
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| bkmonitor/constants/data_source.py | Adds (DataSourceLabel.BK_LOG_SEARCH, DataTypeLabel.TIME_SERIES) to the unified query data sources list |
| bkmonitor/bkmonitor/utils/event_related_info.py | Switches log dimension and log queries from direct datasource calls to using the UnifyQuery wrapper |
| bkmonitor/bkmonitor/data_source/unify_query/query.py | Adds (DataSourceLabel.BK_LOG_SEARCH, DataTypeLabel.LOG) to the log processing list for unified query |
| bkmonitor/bkmonitor/data_source/data_source/init.py | Major refactoring: moves LogSearchTimeSeriesDataSource and LogSearchLogDataSource to inherit from BaseBkMonitorLogDataSource, adds reverse operator mappings ("is one of" and "is not one of"), and moves class definitions to later in the file after the base class definition |
Comments suppressed due to low confidence (1)
bkmonitor/bkmonitor/data_source/data_source/init.py:1596
- This call to BaseBkMonitorLogDataSource.switch_unify_query in an initialization method is overridden by LogSearchTimeSeriesDataSource.switch_unify_query.
This call to BaseBkMonitorLogDataSource.switch_unify_query in an initialization method is overridden by BkMonitorLogDataSource.switch_unify_query.
This call to BaseBkMonitorLogDataSource.switch_unify_query in an initialization method is overridden by BkApmTraceDataSource.switch_unify_query.
This call to BaseBkMonitorLogDataSource.switch_unify_query in an initialization method is overridden by CustomEventDataSource.switch_unify_query.
if self.ADVANCE_CONDITION_METHOD and not self.switch_unify_query(bk_biz_id):
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
daa9336 to
65149c0
Compare
chenguo367
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✓ Review conducted following guidelines defined in
.github/copilot-instructions.md
Code Review for PR #9086: feat: 日志数据源切换 unify-query --story=129076973
⚠️ 发现 1 个致命问题
bkmonitor/bkmonitor/data_source/data_source/init.py:2206 - CORRECTNESS
不应使用 assert 进行数据验证(可能被 -O 优化掉),必须使用明确的异常处理
此 review 基于项目代码规范自动生成,仅关注致命问题
7fe69d5 to
18420db
Compare
18420db to
6c00347
Compare
No description provided.