Minor refacotrings to JaxRsAnnotationsInstrumentation.java
This commit is contained in:
parent
37dcfe5385
commit
d9f09e6af5
|
@ -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
|
* 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}.
|
* @return The result can be an empty string but will never be {@code null}.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -60,10 +60,10 @@ public final class JaxRsAnnotationsInstrumentation extends Instrumenter.Default
|
||||||
|
|
||||||
@Advice.OnMethodEnter(suppress = Throwable.class)
|
@Advice.OnMethodEnter(suppress = Throwable.class)
|
||||||
public static Scope nameSpan(@Advice.Origin final Method method) {
|
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.
|
// Rename the parent span according to the path represented by these annotations.
|
||||||
final Scope parent = GlobalTracer.get().scopeManager().active();
|
final Scope parent = tracer.scopeManager().active();
|
||||||
Tracer.SpanBuilder span = GlobalTracer.get().buildSpan(JAX_ENDPOINT_OPERATION_NAME);
|
Scope scope = tracer.buildSpan(JAX_ENDPOINT_OPERATION_NAME).startActive(true);
|
||||||
Scope scope = span.startActive(true);
|
|
||||||
DECORATE.updateParent(parent, method);
|
DECORATE.updateParent(parent, method);
|
||||||
DECORATE.updateCurrentScope(scope, method);
|
DECORATE.updateCurrentScope(scope, method);
|
||||||
return DECORATE.afterStart(scope);
|
return DECORATE.afterStart(scope);
|
||||||
|
|
Loading…
Reference in New Issue