This doc ought to have some sort of note to explain that internal methods cannot be annoted with @WithSpan
For example, a child span would not be created by doing this but users may expect it to do so:
@GET
@Path("/{id}")
@WithSpan("Parent")
public void parentSan(@PathParam("id") @SpanAttribute("Id") Long id) {
// Call the child span method
childSpan(url);
}
@WithSpan("Child Find By Id")
public void childSpan(URL url) {
// Print the current span ID within the child span
Span.current().setAttribute("Child Span ID", Span.current().getSpanContext().getSpanId());
System.out.println("Child Span ID after parent scope: " + Span.current().getSpanContext().getSpanId());
System.out.println("Child Trace ID after parent scope: " + Span.current().toString());
}
This doc ought to have some sort of note to explain that internal methods cannot be annoted with
@WithSpan
For example, a child span would not be created by doing this but users may expect it to do so: