Split akka actor instumentation
MODIFY
instrumentation/akka-actor-2.5/javaagent/akka-actor-2.5-javaagent.gradle
instrumentation/akka-actor-2.5/javaagent/akka-actor-2.5-javaagent.gradle
@@ -7,16 +7,28 @@ muzzle {
module = 'akka-actor_2.11'
versions = "[2.5.0,)"
}
+ pass {
+ group = 'com.typesafe.akka'
+ module = 'akka-actor_2.12'
+ versions = "[2.5.0,)"
+ }
+ pass {
+ group = 'com.typesafe.akka'
+ module = 'akka-actor_2.13'
+ versions = "(,)"
+ }
}
dependencies {
- implementation project(':instrumentation:executors:javaagent')
compileOnly "com.typesafe.akka:akka-actor_2.11:2.5.0"
-
- testImplementation "org.scala-lang:scala-library"
testImplementation "com.typesafe.akka:akka-actor_2.11:2.5.0"
+
+ latestDepTestLibrary "com.typesafe.akka:akka-actor_2.13:+"
}
-tasks.withType(Test).configureEach {
- jvmArgs '-Dotel.instrumentation.akka-actor.enabled=true'
+if (findProperty('testLatestDeps')) {
+ configurations {
+ // akka artifact name is different for regular and latest tests
+ testImplementation.exclude group: 'com.typesafe.akka', module: 'akka-actor_2.11'
+ }
}
\ No newline at end of file

MODIFY
instrumentation/akka-actor-2.5/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkaactor/AkkaActorInstrumentationModule.java
instrumentation/akka-actor-2.5/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkaactor/AkkaActorInstrumentationModule.java
@@ -20,15 +20,6 @@ public class AkkaActorInstrumentationModule extends InstrumentationModule {
@Override
public List<TypeInstrumentation> typeInstrumentations() {
- return asList(
- new AkkaForkJoinPoolInstrumentation(),
- new AkkaForkJoinTaskInstrumentation(),
- new AkkaDispatcherInstrumentation(),
- new AkkaActorCellInstrumentation());
- }
-
- @Override
- protected boolean defaultEnabled() {
- return false;
+ return asList(new AkkaDispatcherInstrumentation(), new AkkaActorCellInstrumentation());
}
}

ADD
instrumentation/akka-actor-fork-join-2.5/javaagent/akka-actor-fork-join-2.5-javaagent.gradle
+apply from: "$rootDir/gradle/instrumentation.gradle"
+apply from: "$rootDir/gradle/test-with-scala.gradle"
+
+muzzle {
+ pass {
+ group = 'com.typesafe.akka'
+ module = 'akka-actor_2.11'
+ versions = "[2.5.0,)"
+ }
+}
+
+dependencies {
+ library "com.typesafe.akka:akka-actor_2.11:2.5.0"
+}

ADD
instrumentation/akka-actor-fork-join-2.5/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkaactor/AkkaActorForkJoinInstrumentationModule.java
+/*
+ * Copyright The OpenTelemetry Authors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package io.opentelemetry.javaagent.instrumentation.akkaactor;
+
+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 java.util.List;
+
+@AutoService(InstrumentationModule.class)
+public class AkkaActorForkJoinInstrumentationModule extends InstrumentationModule {
+ public AkkaActorForkJoinInstrumentationModule() {
+ super("akka-actor", "akka-actor-fork-join", "akka-actor-2.5", "akka-actor-fork-join-2.5");
+ }
+
+ @Override
+ public List<TypeInstrumentation> typeInstrumentations() {
+ return asList(new AkkaForkJoinPoolInstrumentation(), new AkkaForkJoinTaskInstrumentation());
+ }
+}

RENAME
instrumentation/akka-actor-2.5/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkaactor/AkkaForkJoinPoolInstrumentation.java
instrumentation/akka-actor-fork-join-2.5/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkaactor/AkkaForkJoinPoolInstrumentation.java
RENAME
instrumentation/akka-actor-2.5/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkaactor/AkkaForkJoinTaskInstrumentation.java
instrumentation/akka-actor-fork-join-2.5/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkaactor/AkkaForkJoinTaskInstrumentation.java
RENAME
instrumentation/akka-actor-2.5/javaagent/src/test/groovy/AkkaExecutorInstrumentationTest.groovy
instrumentation/akka-actor-fork-join-2.5/javaagent/src/test/groovy/AkkaExecutorInstrumentationTest.groovy
RENAME
instrumentation/akka-actor-2.5/javaagent/src/test/java/AkkaAsyncChild.java
instrumentation/akka-actor-fork-join-2.5/javaagent/src/test/java/AkkaAsyncChild.java
MODIFY
settings.gradle
settings.gradle
@@ -81,6 +81,7 @@ include ':testing-common:library-for-integration-tests'
include ':smoke-tests'
include ':instrumentation:akka-actor-2.5:javaagent'
+include ':instrumentation:akka-actor-fork-join-2.5:javaagent'
include ':instrumentation:akka-http-10.0:javaagent'
include ':instrumentation:apache-camel-2.20:javaagent'
include ':instrumentation:apache-camel-2.20:javaagent-unit-tests'

Split akka actor instumentation (#3173)