Skip to content

Conversation

@ZhuoZhuoCrayon
Copy link
Member

No description provided.

@ZhuoZhuoCrayon ZhuoZhuoCrayon added feat A new feature. Correlates with MINOR in SemVer project/apm project apm labels Dec 3, 2025
Copy link
Contributor

Copilot AI left a 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 LogSearchTimeSeriesDataSource and LogSearchLogDataSource to inherit from BaseBkMonitorLogDataSource, reducing code duplication
  • Updates event-related log queries to use the UnifyQuery wrapper 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

        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.

@ZhuoZhuoCrayon ZhuoZhuoCrayon force-pushed the feat/event/#1010158081129076973 branch 3 times, most recently from daa9336 to 65149c0 Compare December 30, 2025 07:18
Copy link
Collaborator

@chenguo367 chenguo367 left a 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 基于项目代码规范自动生成,仅关注致命问题

@ZhuoZhuoCrayon ZhuoZhuoCrayon force-pushed the feat/event/#1010158081129076973 branch from 7fe69d5 to 18420db Compare January 20, 2026 09:24
@ZhuoZhuoCrayon ZhuoZhuoCrayon force-pushed the feat/event/#1010158081129076973 branch from 18420db to 6c00347 Compare January 22, 2026 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat A new feature. Correlates with MINOR in SemVer project/apm project apm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants