opentracing-contrib / java-jaxrs

OpenTracing Java JAX-RS instrumentation
Apache License 2.0
37 stars 33 forks source link

Support for Rest template #139

Closed seho-kim-do-something closed 4 years ago

seho-kim-do-something commented 4 years ago

Hi,

I am new to Opentracing and doing some research now. Is there any way to get a span for Rest Template in Jaxrs? My app runs with spring-jersey and in some functions, there is a couple of RestTemplate calls, which are not reported as a new span under the same trace. In the end, I added "opentracing-spring-cloud-starter" for RestTemplate. So my dependencies are:

io.opentracing.contrib opentracing-jaxrs2-discovery 0.3.1
    <dependency>
        <groupId>io.opentracing.contrib</groupId>
        <artifactId>opentracing-spring-cloud-starter</artifactId>
        <version>0.2.6</version>
    </dependency>

    <dependency>
        <groupId>com.uber.jaeger</groupId>
        <artifactId>jaeger-core</artifactId>
        <version>0.27.0</version>
    </dependency>

All good now. But it created two traces for a single api call - api/hello First one is correct one, but the second one is incorrect duplicate trace. Can somebody take a look at this?

Screen Shot 2020-05-28 at 6 06 59 PM
seho-kim-do-something commented 4 years ago

After I excluded spring-starter-web, the issue has been resolved