Describe the bug
The "manual context propagation" example in the Tracer class Javadoc does not compile when copied as-is.
Steps to reproduce
Copy the void doWork(Span parent) example from the Tracer Javadoc into a source file.
What did you expect to see?
A compilable example, like the sibling SpanBuilder Javadoc which uses .setParent(Context.current().with(parent)).
What did you see instead?
Two compile errors in Tracer (api/all/src/main/java/io/opentelemetry/api/trace/Tracer.java, around line 47):
- The call chain is missing the leading
. before setParent(parent).
setParent(parent) passes a Span, but SpanBuilder.setParent only accepts a Context; there is no Span overload.
What version and what artifacts are you using?
Artifacts: opentelemetry-api
Version: main @ 4d974ba
How did you reference these artifacts? N/A
Environment
Compiler: Temurin 21
OS: N/A
Additional context
The sibling SpanBuilder example (same package) already uses the correct idiom; aligning Tracer with it fixes both errors.
Describe the bug
The "manual context propagation" example in the
Tracerclass Javadoc does not compile when copied as-is.Steps to reproduce
Copy the
void doWork(Span parent)example from theTracerJavadoc into a source file.What did you expect to see?
A compilable example, like the sibling
SpanBuilderJavadoc which uses.setParent(Context.current().with(parent)).What did you see instead?
Two compile errors in
Tracer(api/all/src/main/java/io/opentelemetry/api/trace/Tracer.java, around line 47):.beforesetParent(parent).setParent(parent)passes aSpan, butSpanBuilder.setParentonly accepts aContext; there is noSpanoverload.What version and what artifacts are you using?
Artifacts: opentelemetry-api
Version: main @ 4d974ba
How did you reference these artifacts? N/A
Environment
Compiler: Temurin 21
OS: N/A
Additional context
The sibling
SpanBuilderexample (same package) already uses the correct idiom; aligningTracerwith it fixes both errors.