Class ServerTracingDynamicFeature
- java.lang.Object
-
- io.smallrye.opentracing.contrib.jaxrs2.server.ServerTracingDynamicFeature
-
- All Implemented Interfaces:
jakarta.ws.rs.container.DynamicFeature
public class ServerTracingDynamicFeature extends Object implements jakarta.ws.rs.container.DynamicFeature
This class has to be registered as JAX-RS provider to enable tracing of server requests. It also requiresSpanFinishingFilterfor correct functionality. Spans are created in JAX-RS filter and finished in servlet filter.- Author:
- Pavol Loffay
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classServerTracingDynamicFeature.BuilderBuilder for creating JAX-RS dynamic feature for tracing server requests.
-
Constructor Summary
Constructors Constructor Description ServerTracingDynamicFeature()When using this constructor application has to callGlobalTracer.register(io.opentracing.Tracer)to register tracer instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.eclipse.microprofile.opentracing.TracedclosestTracedAnnotation(jakarta.ws.rs.container.ResourceInfo resourceInfo)voidconfigure(jakarta.ws.rs.container.ResourceInfo resourceInfo, jakarta.ws.rs.core.FeatureContext context)protected StringoperationName(jakarta.ws.rs.container.ResourceInfo resourceInfo)protected booleantracingDisabled(jakarta.ws.rs.container.ResourceInfo resourceInfo)
-
-
-
Constructor Detail
-
ServerTracingDynamicFeature
public ServerTracingDynamicFeature()
When using this constructor application has to callGlobalTracer.register(io.opentracing.Tracer)to register tracer instance. Ideally it should be called inServletContextListener. For a custom configuration useServerTracingDynamicFeature.Builder.build().
-
-
Method Detail
-
configure
public void configure(jakarta.ws.rs.container.ResourceInfo resourceInfo, jakarta.ws.rs.core.FeatureContext context)- Specified by:
configurein interfacejakarta.ws.rs.container.DynamicFeature
-
closestTracedAnnotation
protected org.eclipse.microprofile.opentracing.Traced closestTracedAnnotation(jakarta.ws.rs.container.ResourceInfo resourceInfo)
-
tracingDisabled
protected boolean tracingDisabled(jakarta.ws.rs.container.ResourceInfo resourceInfo)
-
operationName
protected String operationName(jakarta.ws.rs.container.ResourceInfo resourceInfo)
-
-