Skip to content

删除基于 db 的 tracing 实现, 使用纯 opentelemetry 的实现来做 - #384

Draft
LeoQuote wants to merge 8 commits into
Laisky:mainfrom
LeoQuote:feat_allow_no_db_trace
Draft

删除基于 db 的 tracing 实现, 使用纯 opentelemetry 的实现来做#384
LeoQuote wants to merge 8 commits into
Laisky:mainfrom
LeoQuote:feat_allow_no_db_trace

Conversation

@LeoQuote

Copy link
Copy Markdown

原有的, 基于 db 的 tracing 实现在面对高 QPS, 多实例的场景时, 会出现明显的问题, 存储成本高, 查询性能差.

本 PR 将其完全删除, 替换为 otel 的实现, 存储成本和查询性能的问题因此可以转移至 otel 存储后端, 可在高 QPS 下保持其 tracing 系统正常工作.

本 PR 暂未进行实际验证, 后续将会在 PR 中持续更新, 如果对这个思路有什么问题可以在评论中交流

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Laisky

Laisky commented Aug 25, 2026

Copy link
Copy Markdown
Owner

可以做成一个插件式的,默认为 db,但是可以通过配置改成 otel

@Laisky

Laisky commented Aug 26, 2026

Copy link
Copy Markdown
Owner

@LeoQuote 改动有些太大了,而且存在破坏性变更,改动的必要性也缺乏说明

你最初关于 OTEL 的理由我认为很 make sense,最好的实现方式是保持现有行为不变,但是增加一个 OTEL 输出的 feature flag。

至于日志,替换的理由是什么呢,而且没必要在一个 PR 里做吧。

@LeoQuote

Copy link
Copy Markdown
Author

感谢评论, 我会继续优化这个 PR, 目前的草稿中确实有破坏性变更, 我会在接下来的更改中继续优化.

日志替换的出发点是其中的 trace id 和 otel trace id 有混淆, 所以一并删除, 其中有了 otel 的trace id 字段, 可以将 trace 和日志关联, 进一步增强可观测性.

后续我会再做抽象将其做成可配置项.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants