From 4b3a6b7af66480b386156e3892f78657cb3d936c Mon Sep 17 00:00:00 2001 From: Dmitry Aleksandrov Date: Wed, 27 Sep 2023 20:38:59 +0300 Subject: [PATCH] Move Opentracing to Helidon Tracing API (#7679) Signed-off-by: Dmitry Aleksandrov --- integrations/common/rest/pom.xml | 4 ++-- .../io/helidon/integrations/common/rest/RestApiBase.java | 6 +++--- integrations/common/rest/src/main/java/module-info.java | 5 ++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/integrations/common/rest/pom.xml b/integrations/common/rest/pom.xml index 0f15bec80eb..a14d660b064 100644 --- a/integrations/common/rest/pom.xml +++ b/integrations/common/rest/pom.xml @@ -52,8 +52,8 @@ helidon-fault-tolerance - io.opentracing - opentracing-api + io.helidon.tracing + helidon-tracing diff --git a/integrations/common/rest/src/main/java/io/helidon/integrations/common/rest/RestApiBase.java b/integrations/common/rest/src/main/java/io/helidon/integrations/common/rest/RestApiBase.java index 69dd80e15ab..7a1e62d9a26 100644 --- a/integrations/common/rest/src/main/java/io/helidon/integrations/common/rest/RestApiBase.java +++ b/integrations/common/rest/src/main/java/io/helidon/integrations/common/rest/RestApiBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Oracle and/or its affiliates. + * Copyright (c) 2021, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,12 +33,12 @@ import io.helidon.common.reactive.Multi; import io.helidon.common.reactive.Single; import io.helidon.faulttolerance.FtHandler; +import io.helidon.tracing.SpanContext; import io.helidon.webclient.WebClient; import io.helidon.webclient.WebClientRequestBuilder; import io.helidon.webclient.WebClientRequestHeaders; import io.helidon.webclient.WebClientResponse; -import io.opentracing.SpanContext; import jakarta.json.JsonBuilderFactory; import jakarta.json.JsonObject; import jakarta.json.JsonReaderFactory; @@ -1013,7 +1013,7 @@ protected String requestId(ApiRequest restRequest) { return restRequest.requestId() .or(() -> Contexts.context() .flatMap(it -> it.get(SpanContext.class)) - .map(SpanContext::toTraceId)) + .map(SpanContext::traceId)) .orElseGet(UUID.randomUUID()::toString); } diff --git a/integrations/common/rest/src/main/java/module-info.java b/integrations/common/rest/src/main/java/module-info.java index 386a80ff9af..accdce97355 100644 --- a/integrations/common/rest/src/main/java/module-info.java +++ b/integrations/common/rest/src/main/java/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Oracle and/or its affiliates. + * Copyright (c) 2021, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,8 +27,6 @@ requires java.logging; requires jakarta.json; - requires io.opentracing.api; - requires io.helidon.common.http; requires io.helidon.common; requires io.helidon.common.reactive; @@ -36,6 +34,7 @@ requires io.helidon.config; requires io.helidon.webclient; requires io.helidon.media.jsonp; + requires io.helidon.tracing; exports io.helidon.integrations.common.rest; } \ No newline at end of file