Skip to content

Commit 118c737

Browse files
committed
address feedback: Move tapir into separate InstrumentationModule
1 parent 18f27dc commit 118c737

File tree

3 files changed

+37
-13
lines changed

3 files changed

+37
-13
lines changed

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

+8-12
Original file line numberDiff line numberDiff line change
@@ -10,57 +10,53 @@ muzzle {
1010
versions.set("[1.0,)")
1111
assertInverse.set(true)
1212
extraDependency("org.apache.pekko:pekko-stream_2.12:1.0.1")
13-
extraDependency("com.softwaremill.sttp.tapir:tapir-server_2.12:1.7.0")
14-
extraDependency("com.softwaremill.sttp.tapir:tapir-core_2.12:1.7.0")
13+
excludeInstrumentationName("tapir-pekko-http")
1514
}
1615
pass {
1716
group.set("org.apache.pekko")
1817
module.set("pekko-http_2.13")
1918
versions.set("[1.0,)")
2019
assertInverse.set(true)
2120
extraDependency("org.apache.pekko:pekko-stream_2.13:1.0.1")
22-
extraDependency("com.softwaremill.sttp.tapir:tapir-server_2.13:1.7.0")
23-
extraDependency("com.softwaremill.sttp.tapir:tapir-core_2.13:1.7.0")
21+
excludeInstrumentationName("tapir-pekko-http")
2422
}
2523
pass {
2624
group.set("org.apache.pekko")
2725
module.set("pekko-http_3")
2826
versions.set("[1.0,)")
2927
assertInverse.set(true)
3028
extraDependency("org.apache.pekko:pekko-stream_3:1.0.1")
31-
extraDependency("com.softwaremill.sttp.tapir:tapir-server_3:1.7.0")
32-
extraDependency("com.softwaremill.sttp.tapir:tapir-core_3:1.7.0")
29+
excludeInstrumentationName("tapir-pekko-http")
3330
}
3431
pass {
3532
group.set("com.softwaremill.sttp.tapir")
3633
module.set("tapir-pekko-http-server_2.12")
3734
versions.set("[1.7,)")
3835
assertInverse.set(true)
39-
extraDependency("com.softwaremill.sttp.tapir:tapir-server_2.12:1.7.0")
40-
extraDependency("com.softwaremill.sttp.tapir:tapir-core_2.12:1.7.0")
36+
excludeInstrumentationName("pekko-http")
4137
}
4238
pass {
4339
group.set("com.softwaremill.sttp.tapir")
4440
module.set("tapir-pekko-http-server_2.13")
4541
versions.set("[1.7,)")
4642
assertInverse.set(true)
47-
extraDependency("com.softwaremill.sttp.tapir:tapir-server_2.13:1.7.0")
48-
extraDependency("com.softwaremill.sttp.tapir:tapir-core_2.13:1.7.0")
43+
excludeInstrumentationName("pekko-http")
4944
}
5045
pass {
5146
group.set("com.softwaremill.sttp.tapir")
5247
module.set("tapir-pekko-http-server_3")
5348
versions.set("[1.7,)")
5449
assertInverse.set(true)
55-
extraDependency("com.softwaremill.sttp.tapir:tapir-server_3:1.7.0")
56-
extraDependency("com.softwaremill.sttp.tapir:tapir-core_3:1.7.0")
50+
excludeInstrumentationName("pekko-http")
5751
}
5852
}
5953

6054
dependencies {
6155
library("org.apache.pekko:pekko-http_2.12:1.0.0")
6256
library("org.apache.pekko:pekko-stream_2.12:1.0.1")
6357
library("com.softwaremill.sttp.tapir:tapir-pekko-http-server_2.12:1.7.0")
58+
// compileOnly("com.softwaremill.sttp.tapir:tapir-pekko-http-server_2.12:1.7.0")
59+
// testCompileOnly("com.softwaremill.sttp.tapir:tapir-pekko-http-server_2.12:1.7.0")
6460

6561
testInstrumentation(project(":instrumentation:pekko:pekko-actor-1.0:javaagent"))
6662
testInstrumentation(project(":instrumentation:executors:javaagent"))

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

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public String getModuleGroup() {
3232
@Override
3333
public List<TypeInstrumentation> typeInstrumentations() {
3434
return asList(
35-
new TapirPathInstrumentation(),
3635
new PathMatcherInstrumentation(),
3736
new PathMatcherStaticInstrumentation(),
3837
new RouteConcatenationInstrumentation(),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package io.opentelemetry.javaagent.instrumentation.pekkohttp.v1_0.server.route;
2+
3+
import static java.util.Arrays.asList;
4+
5+
import com.google.auto.service.AutoService;
6+
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
7+
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
8+
import io.opentelemetry.javaagent.extension.instrumentation.internal.ExperimentalInstrumentationModule;
9+
import java.util.List;
10+
11+
@AutoService(InstrumentationModule.class)
12+
public class TapirPekkoHttpServerRouteInstrumentationModule extends InstrumentationModule
13+
implements ExperimentalInstrumentationModule {
14+
public TapirPekkoHttpServerRouteInstrumentationModule() {
15+
super("tapir-pekko-http", "pekko-http-1.0", "pekko-http-server", "pekko-http-server-route");
16+
}
17+
18+
@Override
19+
public String getModuleGroup() {
20+
return "pekko-server";
21+
}
22+
23+
@Override
24+
public List<TypeInstrumentation> typeInstrumentations() {
25+
return asList(
26+
new TapirPathInstrumentation(),
27+
new RouteConcatenationInstrumentation());
28+
}
29+
}

0 commit comments

Comments
 (0)