Skip to content

Conversation

jade-guiton-dd
Copy link
Contributor

@jade-guiton-dd jade-guiton-dd commented Oct 13, 2025

Description

This allows components to access SDK-specific TracerProvider methods (in zpagesextension's case, RegisterSpanProcessor), without requiring componentattribute to have a dependency on the official SDK.

This is an alternative proposal to #13947

Link to tracking issue

Updates #13842

Testing

Should be covered by TestServiceTelemetryZPages. (In fact the "missing coverage" should be covered by that test as well, but it's in another module.)

Copy link

codecov bot commented Oct 13, 2025

Codecov Report

❌ Patch coverage is 72.72727% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.65%. Comparing base (2e793f4) to head (d860e3f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...al/telemetry/componentattribute/tracer_provider.go 33.33% 2 Missing ⚠️
extension/zpagesextension/zpagesextension.go 87.50% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (72.72%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14006      +/-   ##
==========================================
- Coverage   91.67%   91.65%   -0.02%     
==========================================
  Files         654      654              
  Lines       42659    42659              
==========================================
- Hits        39107    39100       -7     
- Misses       2738     2744       +6     
- Partials      814      815       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@axw axw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I think we should document that Unwrap method though. Maybe in both component.TelemetrySettings and telemetry.Factory?

Comment on lines 54 to 57
// If the TracerProvider was wrapped by the service implementation, access the underlying SDK provider
if wrapped, ok := tp.(interface{ Unwrap() trace.TracerProvider }); ok {
tp = wrapped.Unwrap()
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a for loop, like in errors.Is? i.e. keep unwrapping until we reach one without an Unwrap method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that would make sense. Done.

@jade-guiton-dd jade-guiton-dd marked this pull request as ready for review October 14, 2025 10:08
@jade-guiton-dd jade-guiton-dd requested review from a team, dmathieu and mx-psi as code owners October 14, 2025 10:08
Copy link
Contributor

@axw axw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mx-psi mx-psi added this pull request to the merge queue Oct 14, 2025
Merged via the queue into open-telemetry:main with commit 5bdfd09 Oct 14, 2025
59 of 61 checks passed
@github-actions github-actions bot added this to the next release milestone Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants