Skip to content

Commit d0bdd89

Browse files
authored
Separate pekko route from http server instrumentation (#15499)
1 parent f693cc4 commit d0bdd89

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,14 @@
66
package io.opentelemetry.javaagent.instrumentation.pekkohttp.v1_0.server;
77

88
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
9-
import io.opentelemetry.instrumentation.api.util.VirtualField;
109
import io.opentelemetry.javaagent.bootstrap.internal.JavaagentHttpServerInstrumenters;
1110
import io.opentelemetry.javaagent.instrumentation.pekkohttp.v1_0.PekkoHttpUtil;
1211
import org.apache.pekko.http.scaladsl.model.HttpRequest;
1312
import org.apache.pekko.http.scaladsl.model.HttpResponse;
14-
import org.apache.pekko.http.scaladsl.server.PathMatcher;
1513

1614
public final class PekkoHttpServerSingletons {
1715

1816
private static final Instrumenter<HttpRequest, HttpResponse> INSTRUMENTER;
19-
public static final VirtualField<PathMatcher<?>, String> PREFIX =
20-
VirtualField.find(PathMatcher.class, String.class);
2117

2218
static {
2319
INSTRUMENTER =

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
package io.opentelemetry.javaagent.instrumentation.pekkohttp.v1_0.server.route;
77

8-
import static io.opentelemetry.javaagent.instrumentation.pekkohttp.v1_0.server.PekkoHttpServerSingletons.PREFIX;
8+
import static io.opentelemetry.javaagent.instrumentation.pekkohttp.v1_0.server.route.PekkoRouteUtil.PREFIX;
99
import static net.bytebuddy.matcher.ElementMatchers.named;
1010
import static net.bytebuddy.matcher.ElementMatchers.returns;
1111
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
package io.opentelemetry.javaagent.instrumentation.pekkohttp.v1_0.server.route;
77

88
import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.extendsClass;
9-
import static io.opentelemetry.javaagent.instrumentation.pekkohttp.v1_0.server.PekkoHttpServerSingletons.PREFIX;
9+
import static io.opentelemetry.javaagent.instrumentation.pekkohttp.v1_0.server.route.PekkoRouteUtil.PREFIX;
1010
import static net.bytebuddy.matcher.ElementMatchers.named;
1111
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
1212

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package io.opentelemetry.javaagent.instrumentation.pekkohttp.v1_0.server.route;
7+
8+
import io.opentelemetry.instrumentation.api.util.VirtualField;
9+
import org.apache.pekko.http.scaladsl.server.PathMatcher;
10+
11+
public final class PekkoRouteUtil {
12+
public static final VirtualField<PathMatcher<?>, String> PREFIX =
13+
VirtualField.find(PathMatcher.class, String.class);
14+
15+
private PekkoRouteUtil() {}
16+
}

0 commit comments

Comments
 (0)