Skip to content

Commit ed566b9

Browse files
committed
no longer need actiondata
1 parent f7d1652 commit ed566b9

File tree

5 files changed

+11
-48
lines changed

5 files changed

+11
-48
lines changed

instrumentation/play/play-mvc/play-mvc-2.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_4/ActionData.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

instrumentation/play/play-mvc/play-mvc-2.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_4/ActionInstrumentation.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@
1212
import static net.bytebuddy.matcher.ElementMatchers.returns;
1313
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
1414

15-
import io.opentelemetry.context.Context;
1615
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
1716
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
18-
import java.lang.reflect.Method;
1917
import javax.annotation.Nullable;
2018
import net.bytebuddy.asm.Advice;
2119
import net.bytebuddy.description.type.TypeDescription;
@@ -49,14 +47,8 @@ public void transform(TypeTransformer transformer) {
4947
public static class ApplyAdvice {
5048

5149
@Advice.OnMethodEnter(suppress = Throwable.class)
52-
public static AdviceScope onEnter(
53-
@Advice.This Object target,
54-
@Advice.Origin Method method,
55-
@Advice.Argument(0) Request<?> req) {
56-
Context parentContext = currentContext();
57-
58-
ActionData actionData = new ActionData(target.getClass(), method);
59-
return AdviceScope.start(parentContext, actionData);
50+
public static AdviceScope onEnter(@Advice.Argument(0) Request<?> req) {
51+
return AdviceScope.start(currentContext());
6052
}
6153

6254
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)

instrumentation/play/play-mvc/play-mvc-2.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_4/AdviceScope.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,22 @@
1919
/** Container used to carry state between enter and exit advices */
2020
public final class AdviceScope {
2121

22-
private final ActionData actionData;
2322
private final Context context;
2423
private final Scope scope;
2524

26-
public AdviceScope(Context context, Scope scope, ActionData actionData) {
27-
this.actionData = actionData;
25+
public AdviceScope(Context context, Scope scope) {
2826
this.context = context;
2927
this.scope = scope;
3028
}
3129

3230
@Nullable
33-
public static AdviceScope start(Context parentContext, ActionData actionData) {
34-
if (!instrumenter().shouldStart(parentContext, actionData)) {
31+
public static AdviceScope start(Context parentContext) {
32+
if (!instrumenter().shouldStart(parentContext, null)) {
3533
return null;
3634
}
3735

38-
Context context = instrumenter().start(parentContext, actionData);
39-
return new AdviceScope(context, context.makeCurrent(), actionData);
36+
Context context = instrumenter().start(parentContext, null);
37+
return new AdviceScope(context, context.makeCurrent());
4038
}
4139

4240
public void closeScope() {
@@ -55,7 +53,7 @@ public void end(
5553
responseFuture.onComplete(
5654
new RequestCompleteCallback(context), thisAction.executionContext());
5755
} else {
58-
instrumenter().end(context, actionData, null, throwable);
56+
instrumenter().end(context, null, null, throwable);
5957
}
6058
}
6159
}

instrumentation/play/play-mvc/play-mvc-2.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_4/Play24Singletons.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717

1818
public final class Play24Singletons {
1919
private static final String SPAN_NAME = "play.request";
20-
private static final Instrumenter<ActionData, Void> INSTRUMENTER;
20+
private static final Instrumenter<Void, Void> INSTRUMENTER;
2121

2222
static {
2323
INSTRUMENTER =
24-
Instrumenter.<ActionData, Void>builder(
24+
Instrumenter.<Void, Void>builder(
2525
GlobalOpenTelemetry.get(), "io.opentelemetry.play-mvc-2.4", s -> SPAN_NAME)
2626
.setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled())
2727
.buildInstrumenter();
2828
}
2929

30-
public static Instrumenter<ActionData, Void> instrumenter() {
30+
public static Instrumenter<Void, Void> instrumenter() {
3131
return INSTRUMENTER;
3232
}
3333

instrumentation/play/play-mvc/play-mvc-2.4/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/play/v2_4/server/PlayServerTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ protected void configure(HttpServerTestOptions options) {
115115
public SpanDataAssert assertHandlerSpan(
116116
SpanDataAssert span, String method, ServerEndpoint endpoint) {
117117
span.hasName("play.request").hasKind(INTERNAL);
118-
119118
if (endpoint == EXCEPTION) {
120119
span.hasStatus(StatusData.error());
121120
span.hasException(new IllegalArgumentException(EXCEPTION.getBody()));

0 commit comments

Comments
 (0)