Skip to content

Commit 5d8497b

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

File tree

3 files changed

+40
-13
lines changed

3 files changed

+40
-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,32 @@
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 static java.util.Arrays.asList;
9+
10+
import com.google.auto.service.AutoService;
11+
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
12+
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
13+
import io.opentelemetry.javaagent.extension.instrumentation.internal.ExperimentalInstrumentationModule;
14+
import java.util.List;
15+
16+
@AutoService(InstrumentationModule.class)
17+
public class TapirPekkoHttpServerRouteInstrumentationModule extends InstrumentationModule
18+
implements ExperimentalInstrumentationModule {
19+
public TapirPekkoHttpServerRouteInstrumentationModule() {
20+
super("tapir-pekko-http", "pekko-http-1.0", "pekko-http-server", "pekko-http-server-route");
21+
}
22+
23+
@Override
24+
public String getModuleGroup() {
25+
return "pekko-server";
26+
}
27+
28+
@Override
29+
public List<TypeInstrumentation> typeInstrumentations() {
30+
return asList(new TapirPathInstrumentation(), new RouteConcatenationInstrumentation());
31+
}
32+
}

0 commit comments

Comments
 (0)