Minor refacotrings to JaxRsAnnotationsInstrumentation.java
MODIFY
dd-java-agent/instrumentation/jax-rs-annotations/src/main/java/datadog/trace/instrumentation/jaxrs/JaxRsAnnotationsDecorator.java
dd-java-agent/instrumentation/jax-rs-annotations/src/main/java/datadog/trace/instrumentation/jaxrs/JaxRsAnnotationsDecorator.java
@@ -59,7 +59,7 @@ public class JaxRsAnnotationsDecorator extends BaseDecorator {
/**
* Returns the resource name given a JaxRS annotated method. Results are cached so this method can
- * be called multiple times without significantly impacting on performance.
+ * be called multiple times without significantly impacting performance.
*
* @return The result can be an empty string but will never be {@code null}.
*/

MODIFY
dd-java-agent/instrumentation/jax-rs-annotations/src/main/java/datadog/trace/instrumentation/jaxrs/JaxRsAnnotationsInstrumentation.java
dd-java-agent/instrumentation/jax-rs-annotations/src/main/java/datadog/trace/instrumentation/jaxrs/JaxRsAnnotationsInstrumentation.java
@@ -60,10 +60,10 @@ public final class JaxRsAnnotationsInstrumentation extends Instrumenter.Default
@Advice.OnMethodEnter(suppress = Throwable.class)
public static Scope nameSpan(@Advice.Origin final Method method) {
+ Tracer tracer = GlobalTracer.get();
// Rename the parent span according to the path represented by these annotations.
- final Scope parent = GlobalTracer.get().scopeManager().active();
- Tracer.SpanBuilder span = GlobalTracer.get().buildSpan(JAX_ENDPOINT_OPERATION_NAME);
- Scope scope = span.startActive(true);
+ final Scope parent = tracer.scopeManager().active();
+ Scope scope = tracer.buildSpan(JAX_ENDPOINT_OPERATION_NAME).startActive(true);
DECORATE.updateParent(parent, method);
DECORATE.updateCurrentScope(scope, method);
return DECORATE.afterStart(scope);

Minor refacotrings to JaxRsAnnotationsInstrumentation.java