Skip to content

Commit

Permalink
Add Quartz and Apache Camel preview instrumentations (#1899)
Browse files Browse the repository at this point in the history
* Add Quartz preview instrumentation

* And Apache Camel preview instrumentation

* Statsbeat

* Update lock files

* Fix feature tracking for preview instrumentations

* Fix instrumentations on default by OTEL

* Fix spotlessApply

Co-authored-by: Helen Yang <heya@microsoft.com>
  • Loading branch information
trask and heyams authored Oct 5, 2021
1 parent 5a731fd commit c8f0ba3
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ public static class InternalConfiguration {
}

public static class PreviewInstrumentation {

public DisabledByDefaultInstrumentation apacheCamel = new DisabledByDefaultInstrumentation();

// this is just here to detect if using this old setting in order to give a helpful message
@Deprecated
public DisabledByDefaultInstrumentation azureSdk = new DisabledByDefaultInstrumentation();
Expand All @@ -280,6 +283,8 @@ public static class PreviewInstrumentation {
@Deprecated
public DisabledByDefaultInstrumentation jaxws = new DisabledByDefaultInstrumentation();

public DisabledByDefaultInstrumentation quartz = new DisabledByDefaultInstrumentation();

// this is just here to detect if using this old setting in order to give a helpful message
@Deprecated
public DisabledByDefaultInstrumentation rabbitmq = new DisabledByDefaultInstrumentation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,21 @@ static Config getConfig(Configuration config) {
if (!config.instrumentation.springScheduling.enabled) {
properties.put("otel.instrumentation.spring-scheduling.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");
}
if (config.preview.instrumentation.grizzly.enabled) {
// grizzly instrumentation is off by default
// TODO (trask) investigate if grizzly instrumentation can be enabled upstream by default now
properties.put("otel.instrumentation.grizzly.enabled", "true");
}
if (!config.preview.instrumentation.quartz.enabled) {
// quartz instrumentation is ON by default in OTEL
properties.put("otel.instrumentation.quartz.enabled", "false");
}
if (!config.preview.instrumentation.springIntegration.enabled) {
// springIntegration instrumentation is ON by default in OTEL
properties.put("otel.instrumentation.spring-integration.enabled", "false");
}
if (!config.preview.captureControllerSpans) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ enum Feature {
// JAVA_HTTP_CLIENT_DISABLED(16), no longer used
// JAXWS_DISABLED(17), no longer used
RABBITMQ_DISABLED(18),
SPRING_INTEGRATION_DISABLED(19),
SPRING_INTEGRATION_DISABLED(
19), // preview instrumentation, spring-integration is ON by default in OTEL
LEGACY_PROPAGATION_DISABLED(20),
GRIZZLY_DISABLED(21), // preview instrumentation
STATSBEAT_DISABLED(22); // disable non-essential statsbeat
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

private static final Map<String, Feature> javaVendorFeatureMap;

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

// preview instrumentation
if (!config.preview.instrumentation.grizzly.enabled) {
featureList.add(Feature.GRIZZLY_DISABLED);
if (!config.preview.instrumentation.apacheCamel.enabled) {
featureList.add(Feature.APACHE_CAMEL_DISABLED);
}
if (config.preview.instrumentation.grizzly.enabled) {
featureList.add(Feature.GRIZZLY_ENABLED);
}
if (!config.preview.instrumentation.quartz.enabled) {
featureList.add(Feature.QUARTZ_DISABLED);
}
if (!config.preview.instrumentation.springIntegration.enabled) {
featureList.add(Feature.SPRING_INTEGRATION_DISABLED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ class Instrumentations {
INSTRUMENTATION_MAP.put("io.opentelemetry.jaxrs-client-2.0", 67);
INSTRUMENTATION_MAP.put("io.opentelemetry.jaxrs-client-2.0-resteasy-3.0", 68);
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);
}

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

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")
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-apache-httpclient-4.0:$otelInstrumentationAlphaVersion")
Expand Down Expand Up @@ -106,6 +107,7 @@ dependencies {
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-opentelemetry-annotations-1.0:$otelInstrumentationAlphaVersion")
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-opentelemetry-api-1.0:$otelInstrumentationAlphaVersion")
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-opentelemetry-api-metrics-1.0:$otelInstrumentationAlphaVersion")
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-quartz-2.0:$otelInstrumentationAlphaVersion")
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-rabbitmq-2.7:$otelInstrumentationAlphaVersion")
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-reactor-3.1:$otelInstrumentationAlphaVersion")
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-reactor-netty-0.9:$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 @@ -66,6 +66,7 @@ io.opentelemetry.instrumentation:opentelemetry-lettuce-common:1.6.0+ai.patches-a
io.opentelemetry.instrumentation:opentelemetry-mongo-3.1:1.6.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.instrumentation:opentelemetry-netty-4.1:1.6.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.instrumentation:opentelemetry-okhttp-3.0:1.6.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.instrumentation:opentelemetry-quartz-2.0:1.6.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.instrumentation:opentelemetry-reactor-3.1:1.6.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.instrumentation:opentelemetry-rxjava-2.0:1.6.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.instrumentation:opentelemetry-rxjava-3.0:1.6.0+ai.patches-alpha=runtimeClasspath
Expand All @@ -74,6 +75,7 @@ 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-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
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-apache-httpclient-4.0:1.6.0+ai.patches-alpha=runtimeClasspath
Expand Down Expand Up @@ -145,6 +147,7 @@ io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-okhttp-3.0:1.
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-opentelemetry-annotations-1.0:1.6.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-opentelemetry-api-1.0:1.6.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-opentelemetry-api-metrics-1.0:1.6.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-quartz-2.0:1.6.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-rabbitmq-2.7:1.6.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-reactor-3.1:1.6.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-reactor-netty-0.9:1.6.0+ai.patches-alpha=runtimeClasspath
Expand Down

0 comments on commit c8f0ba3

Please sign in to comment.