Minor refacotrings to JaxRsAnnotationsInstrumentation.java

This commit is contained in:
Luca Abbati 2019-08-30 12:23:41 +02:00
parent 37dcfe5385
commit d9f09e6af5
No known key found for this signature in database
GPG Key ID: 74DBB952D9BA17F2
2 changed files with 4 additions and 4 deletions

View File

@ -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}.
*/

View File

@ -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);