Skip to content

Fix Tracer manual context propagation Javadoc example#8571

Draft
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:docs/fix-tracer-manual-propagation-example
Draft

Fix Tracer manual context propagation Javadoc example#8571
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:docs/fix-tracer-manual-propagation-example

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Fixes #8568

Description

  • The "manual context propagation" example in the Tracer Javadoc does not compile when copied.
  • Adds the missing . so the builder chains: spanBuilder("MyChildSpan").setParent(...).startSpan().
  • Wraps Span parent in Context.current().with(parent), since SpanBuilder.setParent accepts a Context, not a Span.
  • Matches the sibling SpanBuilder Javadoc, which already uses this idiom.

Testing done

  • Docs-only Javadoc fix, test-exempt: no test added.
  • ./gradlew :api:all:check passed (compile, spotless, jApiCmp) with JDK 21.
  • No public API change (jApiCmp: no apidiff); no CHANGELOG (no user-facing change).

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.56%. Comparing base (4d974ba) to head (39cf446).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8571      +/-   ##
============================================
+ Coverage     91.55%   91.56%   +0.01%     
- Complexity    10262    10263       +1     
============================================
  Files          1013     1013              
  Lines         27102    27102              
  Branches       3182     3182              
============================================
+ Hits          24812    24815       +3     
+ Misses         1565     1564       -1     
+ Partials        725      723       -2     

☔ View full report in Codecov by Harness.
📢 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.

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.

Tracer manual context propagation Javadoc example does not compile

1 participant