[feat][trace] reserve trace cached ingest - #604
Open
taoyifan89 wants to merge 13 commits into
Open
Conversation
…race navigation 同 thread 内以当前 trace 为锚点按方向返回相邻 trace(trace_id + start_time)。 服务端固定 ±7 天时间窗,trace_id != 锚点自排除,方向决定排序,Limit=1; 边界返回 ResourceNotFoundCode。复用空间维度鉴权 AuthActionTraceRead。 Change-Id: Ia175e7660373e69530bb692cf941bfc7e06c23b1 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Change-Id: Id1fa0075a32263acb9b23a31c2a35c24fdb8bbc0
SearchTrace/SearchTraceTree now fetch the full span set via cursor pagination (capped at 100k) instead of a single capped query, so the frontend gets a complete trace tree without protocol changes. Drop the obsolete search_trace_tree_max_span_limit config. Change-Id: Ie45daa5a077a5f146dc50f819025cb565fb70188 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
GetTraceAll previously passed FetchAllMaxSpanLimit (100k) as the per-page limit into GetTrace. For WithDetail=false, GetTrace unconditionally honors req.Limit, turning cursor pagination into a single 100k ClickHouse query (a likely gateway-timeout cause on large traces). Now GetTraceAll sets each page's limit to the natural page size (1000 with detail / 10000 without), which also keeps req.Limit>0 so GetTrace orders descending, consistent with the repo-layer cursor filter (start_time < token). Also fix a stale GetAdjacentTrace/boundary_not_found test: an empty result is a normal "no adjacent trace" outcome that returns an empty response with nil error, not a ResourceNotFound error. Change-Id: I28cd4246fd6b29ef916fcfee522fafe1bf8e51ff Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…hen no adjacent trace When no adjacent trace is found in the thread, return an empty trace_id/start_time response (code=0) with an info log, instead of raising ResourceNotFoundCode. Change-Id: I1f3431ab9c11f8f654b31d6f7d89bbc3d14c5611 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…trace Change-Id: I41f300d4b38c808cf96a5ddaf1e6ca2d1d0d49bc
… cache Introduce TraceScene (default/cached) threaded through SearchTraceOApi and internal GetTrace: application layer resolves scene with per-workspace switch (trace_scene_cfg) and degrades cached->default on miss/error; scene flows via service GetTraceReq/SearchTraceOApiReq into repo GetTraceParam and GetTraceStorage(...scene) so commercial can route cached reads to Abase. Change-Id: I25183cec461375f0303c1e5201f08196e0b7b4c0 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ene 枚举 将存储路由 seam 的 scene 从裸 string 改为强类型枚举,消除调用点 的 string() 转换与拼写风险。 Change-Id: I71604eb759c938a0103e1f5419dc1771688f88cb Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (76.47%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. @@ Coverage Diff @@
## main #604 +/- ##
==========================================
+ Coverage 77.91% 77.93% +0.01%
==========================================
Files 689 689
Lines 83540 83557 +17
==========================================
+ Hits 65092 65121 +29
+ Misses 14577 14562 -15
- Partials 3871 3874 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
cached trace 查询在原按空间限流基础上增加独立限流配额,限流 QPS 值 兼任开关:>0 开放 cached 热缓存并按此限流,<=0/缺失降级走 default 限流。 删除 TraceSceneCfg 与两处 resolveTraceScene,开关判定收敛进限流逻辑。 SearchTraceOApi 走 AllowByKeyWithScene 返回生效 scene;GetTrace 信任上游直传。 Change-Id: Id6dc83520d6632c1fc14d58c52006a2ada4617e5 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ched-ingest Change-Id: Id38ee16b88f38654db4322b84c7d2d0b0be4488c
…rough GetTraceRequest 新增 optional need_original_tags 字段(field 14), GetTrace 透传 req.GetNeedOriginalTags() 到 SpanListDO2DTO,使内部 caller (如 ob_query cached 读链路)可请求原始分类型 tags,避免下游按字符串再推断类型。 默认 false,行为不变,向前兼容。 Change-Id: I014a34814b33ffc0bace6389f80d3bd5ec3f9fd0 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
新增 runSpanProcessors 帮助函数,链式执行 span 查询 processors 时为每个 processor 记录处理耗时(%T + cost + span_num,scene 标识调用链),便于定位 慢 processor。11 条查询链路 + applyProcessors 统一走该帮助函数;写路径 IngestTraces 不受影响。 Change-Id: Ie26307073e0f5a146947038517e0efa10555577b Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
What type of PR is this?
Check the PR title
(Optional) Translate the PR title into Chinese
(Optional) More detailed description for this PR(en: English/zh: Chinese)
en:
zh(optional):
(Optional) Which issue(s) this PR fixes