Skip to content

Commit 25eb025

Browse files
committed
fix latest dep test
1 parent ced90a6 commit 25eb025

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

instrumentation/pekko/pekko-http-1.0/javaagent/build.gradle.kts

+4-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ dependencies {
3636
testInstrumentation(project(":instrumentation:pekko:pekko-actor-1.0:javaagent"))
3737
testInstrumentation(project(":instrumentation:executors:javaagent"))
3838

39-
latestDepTestLibrary("org.apache.pekko:pekko-http_2.13:+")
40-
latestDepTestLibrary("org.apache.pekko:pekko-stream_2.13:+")
39+
latestDepTestLibrary("org.apache.pekko:pekko-http_2.13:latest.release")
40+
latestDepTestLibrary("org.apache.pekko:pekko-stream_2.13:latest.release")
41+
latestDepTestLibrary("com.softwaremill.sttp.tapir:tapir-pekko-http-server_2.13:latest.release")
4142
}
4243

4344
tasks {
@@ -58,6 +59,7 @@ if (findProperty("testLatestDeps") as Boolean) {
5859
testImplementation {
5960
exclude("org.apache.pekko", "pekko-http_2.12")
6061
exclude("org.apache.pekko", "pekko-stream_2.12")
62+
exclude("com.softwaremill.sttp.tapir", "tapir-pekko-http-server_2.12")
6163
}
6264
}
6365
}

instrumentation/pekko/pekko-http-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/pekkohttp/v1_0/server/route/RouteConcatenationInstrumentation.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,13 @@ public static void onEnter() {
4444
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
4545
public static void onExit(
4646
@Advice.Argument(value = 2) RequestContext ctx,
47-
@Advice.Return(readOnly = false) Future<RouteResult> fut) {
48-
fut = fut.andThen(new RestoreOnExit(), ctx.executionContext());
47+
@Advice.Return(readOnly = false) Future<RouteResult> future,
48+
@Advice.Thrown Throwable throwable) {
49+
if (throwable != null) {
50+
PekkoRouteHolder.restore();
51+
} else {
52+
future = future.andThen(new RestoreOnExit(), ctx.executionContext());
53+
}
4954
}
5055
}
5156

0 commit comments

Comments
 (0)