Skip to content

Commit

Permalink
address feedback: Move tapir into separate InstrumentationModule
Browse files Browse the repository at this point in the history
  • Loading branch information
masonedmison committed Feb 28, 2025
1 parent 18f27dc commit 24ee821
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 13 deletions.
20 changes: 8 additions & 12 deletions instrumentation/pekko/pekko-http-1.0/javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,57 +10,53 @@ muzzle {
versions.set("[1.0,)")
assertInverse.set(true)
extraDependency("org.apache.pekko:pekko-stream_2.12:1.0.1")
extraDependency("com.softwaremill.sttp.tapir:tapir-server_2.12:1.7.0")
extraDependency("com.softwaremill.sttp.tapir:tapir-core_2.12:1.7.0")
excludeInstrumentationName("tapir-pekko-http-server")
}
pass {
group.set("org.apache.pekko")
module.set("pekko-http_2.13")
versions.set("[1.0,)")
assertInverse.set(true)
extraDependency("org.apache.pekko:pekko-stream_2.13:1.0.1")
extraDependency("com.softwaremill.sttp.tapir:tapir-server_2.13:1.7.0")
extraDependency("com.softwaremill.sttp.tapir:tapir-core_2.13:1.7.0")
excludeInstrumentationName("tapir-pekko-http-server")
}
pass {
group.set("org.apache.pekko")
module.set("pekko-http_3")
versions.set("[1.0,)")
assertInverse.set(true)
extraDependency("org.apache.pekko:pekko-stream_3:1.0.1")
extraDependency("com.softwaremill.sttp.tapir:tapir-server_3:1.7.0")
extraDependency("com.softwaremill.sttp.tapir:tapir-core_3:1.7.0")
excludeInstrumentationName("tapir-pekko-http-server")
}
pass {
group.set("com.softwaremill.sttp.tapir")
module.set("tapir-pekko-http-server_2.12")
versions.set("[1.7,)")
assertInverse.set(true)
extraDependency("com.softwaremill.sttp.tapir:tapir-server_2.12:1.7.0")
extraDependency("com.softwaremill.sttp.tapir:tapir-core_2.12:1.7.0")
excludeInstrumentationName("pekko-http-server")
}
pass {
group.set("com.softwaremill.sttp.tapir")
module.set("tapir-pekko-http-server_2.13")
versions.set("[1.7,)")
assertInverse.set(true)
extraDependency("com.softwaremill.sttp.tapir:tapir-server_2.13:1.7.0")
extraDependency("com.softwaremill.sttp.tapir:tapir-core_2.13:1.7.0")
excludeInstrumentationName("pekko-http-server")
}
pass {
group.set("com.softwaremill.sttp.tapir")
module.set("tapir-pekko-http-server_3")
versions.set("[1.7,)")
assertInverse.set(true)
extraDependency("com.softwaremill.sttp.tapir:tapir-server_3:1.7.0")
extraDependency("com.softwaremill.sttp.tapir:tapir-core_3:1.7.0")
excludeInstrumentationName("pekko-http-server")
}
}

dependencies {
library("org.apache.pekko:pekko-http_2.12:1.0.0")
library("org.apache.pekko:pekko-stream_2.12:1.0.1")
library("com.softwaremill.sttp.tapir:tapir-pekko-http-server_2.12:1.7.0")
// compileOnly("com.softwaremill.sttp.tapir:tapir-pekko-http-server_2.12:1.7.0")
// testCompileOnly("com.softwaremill.sttp.tapir:tapir-pekko-http-server_2.12:1.7.0")

testInstrumentation(project(":instrumentation:pekko:pekko-actor-1.0:javaagent"))
testInstrumentation(project(":instrumentation:executors:javaagent"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public String getModuleGroup() {
@Override
public List<TypeInstrumentation> typeInstrumentations() {
return asList(
new TapirPathInstrumentation(),
new PathMatcherInstrumentation(),
new PathMatcherStaticInstrumentation(),
new RouteConcatenationInstrumentation(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

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

import static java.util.Arrays.asList;

import com.google.auto.service.AutoService;
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import io.opentelemetry.javaagent.extension.instrumentation.internal.ExperimentalInstrumentationModule;
import java.util.List;

@AutoService(InstrumentationModule.class)
public class TapirPekkoHttpServerRouteInstrumentationModule extends InstrumentationModule
implements ExperimentalInstrumentationModule {
public TapirPekkoHttpServerRouteInstrumentationModule() {
super(
"pekko-http", "pekko-http-1.0", "tapir-pekko-http-server", "tapir-pekko-http-server-route");
}

@Override
public String getModuleGroup() {
return "pekko-server";
}

@Override
public List<TypeInstrumentation> typeInstrumentations() {
return asList(new TapirPathInstrumentation(), new RouteConcatenationInstrumentation());
}
}

0 comments on commit 24ee821

Please sign in to comment.