-
-
Notifications
You must be signed in to change notification settings - Fork 27
refactor(sentry): simplify configuration structure and improve API naming #991
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
Conversation
…ming This refactoring flattens the nested tracing configuration structure and improves method naming for better usability: - Flatten `tracing.enable.*` to `tracing.*` (e.g., `tracing.enable.amqp` → `tracing.amqp`) - Move `tracing.spans.*` to top-level `tracing_spans.*` - Rename `tracing.extra_tags` to `tracing_tags` for clarity - Add `isTracingTagEnabled()` method and deprecate `isTracingExtraTagEnabled()` - Update all internal usages to use the new configuration structure - Update tests to reflect the new configuration paths This change improves configuration readability and reduces nesting depth while maintaining backward compatibility through deprecation warnings.
|
Warning Rate limit exceeded@huangdijia has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 8 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
Walkthrough本PR重构了Sentry跟踪配置结构,将嵌套的tracing配置(enable、spans、extra_tags)扁平化为顶级键,并引入新的tracing_spans和tracing_tags配置组。同时将特征标志检查从isTracingExtraTagEnabled统一改为isTracingTagEnabled。 Changes
Sequence Diagram(s)sequenceDiagram
actor User as 用户代码
participant Feature as Feature 类
participant Config as 配置系统
User->>Feature: isTracingTagEnabled('db.sql.bindings')
activate Feature
Note over Feature: 新API路径
Feature->>Config: 读取 sentry.tracing_tags['db.sql.bindings']
Config-->>Feature: 返回标志值
Feature-->>User: 返回布尔值
deactivate Feature
Note over Feature: 旧API (已弃用)
User->>Feature: isTracingExtraTagEnabled('db.sql.bindings')
activate Feature
Feature->>Feature: 委托到 isTracingTagEnabled()
Feature-->>User: 返回布尔值
deactivate Feature
sequenceDiagram
participant DbAspect as DbAspect
participant Feature as Feature
participant Span as Span
DbAspect->>Feature: isTracingTagEnabled('db.sql.bindings', true)
Feature-->>DbAspect: true/false
alt 标志启用
DbAspect->>Span: 设置 sql.bindings 数据
else 标志禁用
Note over DbAspect: 跳过 sql.bindings 数据
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 需要额外关注的区域:
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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. Comment |
…ming (#991) * refactor(sentry): simplify configuration structure and improve API naming This refactoring flattens the nested tracing configuration structure and improves method naming for better usability: - Flatten `tracing.enable.*` to `tracing.*` (e.g., `tracing.enable.amqp` → `tracing.amqp`) - Move `tracing.spans.*` to top-level `tracing_spans.*` - Rename `tracing.extra_tags` to `tracing_tags` for clarity - Add `isTracingTagEnabled()` method and deprecate `isTracingExtraTagEnabled()` - Update all internal usages to use the new configuration structure - Update tests to reflect the new configuration paths This change improves configuration readability and reduces nesting depth while maintaining backward compatibility through deprecation warnings. * refactor(sentry): update tracing configuration keys for consistency and clarity --------- Co-Authored-By: Deeka Wong <8337659+huangdijia@users.noreply.github.com>
Summary
This PR refactors the Sentry configuration structure to improve readability and usability by flattening nested configuration keys and improving method naming conventions.
Configuration Changes
Before:
tracing.enable.amqp→ After:tracing.amqptracing.enable.async_queue→ After:tracing.async_queuetracing.spans.*→ After:tracing_spans.*tracing.extra_tags→ After:tracing_tagsAPI Changes
Feature::isTracingTagEnabled()methodFeature::isTracingExtraTagEnabled()(will be removed in v3.2)Switcher::isTracingExtraTagEnable()to use the new method internallyImplementation Details
publish/sentry.phpClientBuilderFactoryto include new configuration keysisTracingTagEnabled()instead ofisTracingExtraTagEnabled()Benefits
tracing_tagsis clearer thanextra_tagsEnabledsuffixBreaking Changes
None - all changes are backward compatible through deprecation notices.
Test plan
Summary by CodeRabbit
发行说明
重构
tracing_spans和tracing_tags测试