-
-
Notifications
You must be signed in to change notification settings - Fork 27
feat(sentry): add view rendering tracing support #935
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
- Add ViewRenderAspect to trace Hyperf view rendering operations - Add 'view' tracing span configuration option to sentry.php config - Add feature() helper function to Function.php for easier Feature access - Integrate with existing Feature-based span enablement system
Walkthrough新增 Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller as 调用方
participant Render as Hyperf\View\Render
participant Aspect as ViewRenderAspect
participant Feature as Feature(配置/开关)
participant Sentry as Sentry SDK
Caller->>Render: render(template, data)
Render->>Aspect: 进入切面 process()
Aspect->>Feature: 检查 tracing.spans.view 与特性开关
alt 开启
Aspect->>Sentry: startSpan(op="view.render", desc=template, origin="auto.view", data)
Aspect->>Render: proceed() 执行原渲染
Render-->>Aspect: 返回渲染结果
Aspect->>Sentry: finishSpan()
Aspect-->>Caller: 返回渲染结果
else 关闭
Aspect->>Render: proceed() 直接执行并返回
Render-->>Caller: 返回渲染结果
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (4)src/*/src/**/*.php📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
src/*/src/ConfigProvider.php📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
{src,tests}/**/*.php📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
src/*/**📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
🧬 Code graph analysis (1)src/sentry/src/ConfigProvider.php (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
🔇 Additional comments (1)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 PHPStan (2.1.28)At least one path must be specified to analyse. 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/sentry/publish/sentry.php(1 hunks)src/sentry/src/Function.php(1 hunks)src/sentry/src/Tracing/Aspect/ViewRenderAspect.php(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
{src,tests}/**/*.php
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Adhere to PSR-12 coding standards across PHP code
Files:
src/sentry/publish/sentry.phpsrc/sentry/src/Function.phpsrc/sentry/src/Tracing/Aspect/ViewRenderAspect.php
src/*/**
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
New components must follow the standard component structure under src/{component-name}/ including .gitattributes, .github, LICENSE, README.md, composer.json, and a src/ subdirectory
Files:
src/sentry/publish/sentry.phpsrc/sentry/src/Function.phpsrc/sentry/src/Tracing/Aspect/ViewRenderAspect.php
src/*/src/**/*.php
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use the namespace pattern FriendsOfHyperf{ComponentName} in all component PHP source files
Files:
src/sentry/src/Function.phpsrc/sentry/src/Tracing/Aspect/ViewRenderAspect.php
🧬 Code graph analysis (2)
src/sentry/src/Function.php (1)
src/sentry/src/Feature.php (1)
Feature(18-71)
src/sentry/src/Tracing/Aspect/ViewRenderAspect.php (2)
src/sentry/src/Feature.php (2)
Feature(18-71)isTracingSpanEnabled(43-50)src/sentry/src/Function.php (1)
trace(48-53)
🪛 PHPMD (2.15.0)
src/sentry/src/Tracing/Aspect/ViewRenderAspect.php
43-43: Avoid unused parameters such as '$scope'. (undefined)
(UnusedFormalParameter)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: Test on PHP 8.2 with Swoole 5.1.7
- GitHub Check: Test on PHP 8.1 with Swoole 5.1.7
- GitHub Check: Test on PHP 8.2 with Swoole 6.0.2
- GitHub Check: Test on PHP 8.1 with Swoole 6.0.2
- GitHub Check: Test on PHP 8.3 with Swoole 5.1.7
- GitHub Check: Test on PHP 8.3 with Swoole 6.0.2
- GitHub Check: Test on PHP 8.1 with Swoole 5.1.7
- GitHub Check: Test on PHP 8.1 with Swoole 6.0.2
- GitHub Check: Test on PHP 8.3 with Swoole 6.0.2
- GitHub Check: Test on PHP 8.2 with Swoole 5.1.7
- GitHub Check: Test on PHP 8.2 with Swoole 6.0.2
- GitHub Check: Test on PHP 8.3 with Swoole 5.1.7
* feat(sentry): add view rendering tracing support - Add ViewRenderAspect to trace Hyperf view rendering operations - Add 'view' tracing span configuration option to sentry.php config - Add feature() helper function to Function.php for easier Feature access - Integrate with existing Feature-based span enablement system * 修复 ViewRenderAspect 类,增加对视图模式和引擎的追踪数据收集 * feat(sentry): add ViewRenderAspect to tracing aspects --------- Co-authored-by: Deeka Wong <8337659+huangdijia@users.noreply.github.com>
Summary
This PR adds view rendering tracing support to the Sentry component, allowing developers to monitor and trace Hyperf view rendering operations.
Changes Made
Hyperf\View\Render::rendercalls to create tracing spansviewoption to the tracing spans configuration with environment variableSENTRY_TRACING_SPANS_VIEWFeatures
view.renderand originauto.viewTechnical Details
SENTRY_TRACING_SPANS_VIEW=true(default: true)trace()function for consistent span handlingConfiguration
Test Plan
Summary by CodeRabbit