Skip to content

Commit

Permalink
Split akka actor instumentation (open-telemetry#3173)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurit authored and robododge committed Jun 17, 2021
1 parent a80399f commit c11052b
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ public AkkaActorInstrumentationModule() {

@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());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
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"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* 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());
}
}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit c11052b

Please sign in to comment.