Conversation
Add EnableDoubleQuerySpaces whitelist to TrajectoryMetadataConfig so that whitelisted spaces always fall back to the double-query path even when enable_single_query is globally on. The single-query path issues a single SELECT * with Limit 1000, which can exceed maxBytes (swallowed into HTTP 200 empty) or overload ClickHouse (folded into an rpc error) for heavy traces. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #672 +/- ##
=======================================
Coverage 78.84% 78.84%
=======================================
Files 707 707
Lines 87896 87900 +4
=======================================
+ Hits 69298 69308 +10
+ Misses 14607 14604 -3
+ Partials 3991 3988 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
cuichen01
previously approved these changes
Sep 21, 2026
…e-query-whitelist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
线上
/open-api/observability/traces/trajectory自trajectory_metadata_config打开全局enable_single_query后,对重 trace 大量返回 HTTP 200,但响应是空数据。single-query 路径一次ListSpansRepeat不设 SelectColumns(等价SELECT *)、Limit 1000,单页体积易超maxBytes(被吞成 200 空)或压垮 ClickHouse。改动
给
TrajectoryMetadataConfig增加 space 级白名单enable_double_query_spaces:命中的workspace_id强制走 double-query 路径,即使全局enable_single_query=true。用于对受影响 space 精准止血,同时不影响其他 space 的 single-query 行为。config.go:新增EnableDoubleQuerySpaces []int64字段 + nil-safeIsDoubleQueryEnabled(workspaceID)。字段缺失时为 nil slice,slices.Contains返回 false,向前兼容。trace_service.go:GetTrajectories分流改为IsSingleQueryEnabled() && !IsDoubleQueryEnabled(workspaceID)才走 single。TestTrajectoryMetadataConfig_IsDoubleQueryEnabled单测。配置用法
{ "enable_single_query": true, "enable_double_query_spaces": [7578826558572331009] }