Skip to content

Commit

Permalink
Clean up ExtendedSpanBuilder call chain in Http Example
Browse files Browse the repository at this point in the history
  • Loading branch information
illenko committed Dec 7, 2024
1 parent 9e1d118 commit 9faf75a
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,12 @@ private static class HelloHandler implements HttpHandler {

@Override
public void handle(HttpExchange exchange) throws IOException {
// TODO (trask) clean up chaining after
// https://github.com/open-telemetry/opentelemetry-java/pull/6514
((ExtendedSpanBuilder)
((ExtendedSpanBuilder) tracer.spanBuilder("GET /"))
((ExtendedSpanBuilder) tracer.spanBuilder("GET /"))
.setParentFrom(
openTelemetry.getPropagators(),
exchange.getRequestHeaders().entrySet().stream()
.collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().get(0))))
.setSpanKind(SpanKind.SERVER))
.setSpanKind(SpanKind.SERVER)
.startAndRun(
() -> {
// Set the Semantic Convention
Expand Down

0 comments on commit 9faf75a

Please sign in to comment.