Skip to content

Commit

Permalink
Add akka preview instrumentation (#1911)
Browse files Browse the repository at this point in the history
* Add akka preview instrumentation

* Fix comment

* Update lock files
  • Loading branch information
trask authored Oct 11, 2021
1 parent 27f49eb commit e87d920
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ public static class InternalConfiguration {

public static class PreviewInstrumentation {

public DisabledByDefaultInstrumentation akka = new DisabledByDefaultInstrumentation();

public DisabledByDefaultInstrumentation apacheCamel = new DisabledByDefaultInstrumentation();

// this is just here to detect if using this old setting in order to give a helpful message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ static Config getConfig(Configuration config) {
if (!config.instrumentation.springScheduling.enabled) {
properties.put("otel.instrumentation.spring-scheduling.enabled", "false");
}
if (!config.preview.instrumentation.akka.enabled) {
// akka instrumentation is ON by default in OTEL
properties.put("otel.instrumentation.akka-actor.enabled", "false");
properties.put("otel.instrumentation.akka-http.enabled", "false");
}
if (!config.preview.instrumentation.apacheCamel.enabled) {
// apache-camel instrumentation is ON by default in OTEL
properties.put("otel.instrumentation.apache-camel.enabled", "false");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ enum Feature {
GRIZZLY_ENABLED(21), // preview instrumentation, grizzly is OFF by default in OTEL
STATSBEAT_DISABLED(22), // disable non-essential statsbeat
QUARTZ_DISABLED(23), // preview instrumentation, quartz is ON by default in OTEL
APACHE_CAMEL_DISABLED(24); // preview instrumentation, apache camel is ON by default in OTEL
APACHE_CAMEL_DISABLED(24), // preview instrumentation, apache camel is ON by default in OTEL
AKKA_DISABLED(25); // preview instrumentation, akka is ON by default in OTEL

private static final Map<String, Feature> javaVendorFeatureMap;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ void trackConfigurationOptions(Configuration config) {
}

// preview instrumentation
if (!config.preview.instrumentation.akka.enabled) {
featureList.add(Feature.AKKA_DISABLED);
}
if (!config.preview.instrumentation.apacheCamel.enabled) {
featureList.add(Feature.APACHE_CAMEL_DISABLED);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class Instrumentations {
INSTRUMENTATION_MAP.put("io.opentelemetry.grizzly-2.0", 69);
INSTRUMENTATION_MAP.put("io.opentelemetry.quartz-2.0", 70);
INSTRUMENTATION_MAP.put("io.opentelemetry.apache-camel-2.20", 71);
INSTRUMENTATION_MAP.put("io.opentelemetry.akka-http-10.0", 72);
}

// encode BitSet to a long
Expand Down
3 changes: 3 additions & 0 deletions agent/instrumentation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ dependencies {
exclude("ch.qos.logback", "logback-core")
}

implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-akka-actor-2.5:$otelInstrumentationAlphaVersion")
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-akka-actor-fork-join-2.5:$otelInstrumentationAlphaVersion")
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-akka-http-10.0:$otelInstrumentationAlphaVersion")
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-apache-camel-2.20:$otelInstrumentationAlphaVersion")
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-apache-httpasyncclient-4.1:$otelInstrumentationAlphaVersion")
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-apache-httpclient-2.0:$otelInstrumentationAlphaVersion")
Expand Down
3 changes: 3 additions & 0 deletions agent/instrumentation/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ io.opentelemetry.instrumentation:opentelemetry-servlet-common:1.6.0+ai.patches-a
io.opentelemetry.instrumentation:opentelemetry-servlet-javax-common:1.6.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.instrumentation:opentelemetry-spring-integration-4.1:1.6.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.instrumentation:opentelemetry-spring-webflux-5.0:1.6.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-akka-actor-2.5:1.6.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-akka-actor-fork-join-2.5:1.6.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-akka-http-10.0:1.6.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-apache-camel-2.20:1.6.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-apache-httpasyncclient-4.1:1.6.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-apache-httpclient-2.0:1.6.0+ai.patches-alpha=runtimeClasspath
Expand Down

0 comments on commit e87d920

Please sign in to comment.