Skip to content

Commit c8f0ba3

Browse files
traskheyams
andauthored
Add Quartz and Apache Camel preview instrumentations (#1899)
* 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 <[email protected]>
1 parent 5a731fd commit c8f0ba3

File tree

7 files changed

+35
-5
lines changed

7 files changed

+35
-5
lines changed

agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/configuration/Configuration.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@ public static class InternalConfiguration {
266266
}
267267

268268
public static class PreviewInstrumentation {
269+
270+
public DisabledByDefaultInstrumentation apacheCamel = new DisabledByDefaultInstrumentation();
271+
269272
// this is just here to detect if using this old setting in order to give a helpful message
270273
@Deprecated
271274
public DisabledByDefaultInstrumentation azureSdk = new DisabledByDefaultInstrumentation();
@@ -280,6 +283,8 @@ public static class PreviewInstrumentation {
280283
@Deprecated
281284
public DisabledByDefaultInstrumentation jaxws = new DisabledByDefaultInstrumentation();
282285

286+
public DisabledByDefaultInstrumentation quartz = new DisabledByDefaultInstrumentation();
287+
283288
// this is just here to detect if using this old setting in order to give a helpful message
284289
@Deprecated
285290
public DisabledByDefaultInstrumentation rabbitmq = new DisabledByDefaultInstrumentation();

agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/ConfigOverride.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,21 @@ static Config getConfig(Configuration config) {
7171
if (!config.instrumentation.springScheduling.enabled) {
7272
properties.put("otel.instrumentation.spring-scheduling.enabled", "false");
7373
}
74+
if (!config.preview.instrumentation.apacheCamel.enabled) {
75+
// apache-camel instrumentation is ON by default in OTEL
76+
properties.put("otel.instrumentation.apache-camel.enabled", "false");
77+
}
7478
if (config.preview.instrumentation.grizzly.enabled) {
7579
// grizzly instrumentation is off by default
7680
// TODO (trask) investigate if grizzly instrumentation can be enabled upstream by default now
7781
properties.put("otel.instrumentation.grizzly.enabled", "true");
7882
}
83+
if (!config.preview.instrumentation.quartz.enabled) {
84+
// quartz instrumentation is ON by default in OTEL
85+
properties.put("otel.instrumentation.quartz.enabled", "false");
86+
}
7987
if (!config.preview.instrumentation.springIntegration.enabled) {
88+
// springIntegration instrumentation is ON by default in OTEL
8089
properties.put("otel.instrumentation.spring-integration.enabled", "false");
8190
}
8291
if (!config.preview.captureControllerSpans) {

agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/statsbeat/Feature.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,13 @@ enum Feature {
4646
// JAVA_HTTP_CLIENT_DISABLED(16), no longer used
4747
// JAXWS_DISABLED(17), no longer used
4848
RABBITMQ_DISABLED(18),
49-
SPRING_INTEGRATION_DISABLED(19),
49+
SPRING_INTEGRATION_DISABLED(
50+
19), // preview instrumentation, spring-integration is ON by default in OTEL
5051
LEGACY_PROPAGATION_DISABLED(20),
51-
GRIZZLY_DISABLED(21), // preview instrumentation
52-
STATSBEAT_DISABLED(22); // disable non-essential statsbeat
52+
GRIZZLY_ENABLED(21), // preview instrumentation, grizzly is OFF by default in OTEL
53+
STATSBEAT_DISABLED(22), // disable non-essential statsbeat
54+
QUARTZ_DISABLED(23), // preview instrumentation, quartz is ON by default in OTEL
55+
APACHE_CAMEL_DISABLED(24); // preview instrumentation, apache camel is ON by default in OTEL
5356

5457
private static final Map<String, Feature> javaVendorFeatureMap;
5558

agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/statsbeat/FeatureStatsbeat.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,14 @@ void trackConfigurationOptions(Configuration config) {
129129
}
130130

131131
// preview instrumentation
132-
if (!config.preview.instrumentation.grizzly.enabled) {
133-
featureList.add(Feature.GRIZZLY_DISABLED);
132+
if (!config.preview.instrumentation.apacheCamel.enabled) {
133+
featureList.add(Feature.APACHE_CAMEL_DISABLED);
134+
}
135+
if (config.preview.instrumentation.grizzly.enabled) {
136+
featureList.add(Feature.GRIZZLY_ENABLED);
137+
}
138+
if (!config.preview.instrumentation.quartz.enabled) {
139+
featureList.add(Feature.QUARTZ_DISABLED);
134140
}
135141
if (!config.preview.instrumentation.springIntegration.enabled) {
136142
featureList.add(Feature.SPRING_INTEGRATION_DISABLED);

agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/statsbeat/Instrumentations.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ class Instrumentations {
118118
INSTRUMENTATION_MAP.put("io.opentelemetry.jaxrs-client-2.0", 67);
119119
INSTRUMENTATION_MAP.put("io.opentelemetry.jaxrs-client-2.0-resteasy-3.0", 68);
120120
INSTRUMENTATION_MAP.put("io.opentelemetry.grizzly-2.0", 69);
121+
INSTRUMENTATION_MAP.put("io.opentelemetry.quartz-2.0", 70);
122+
INSTRUMENTATION_MAP.put("io.opentelemetry.apache-camel-2.20", 71);
121123
}
122124

123125
// encode BitSet to a long

agent/instrumentation/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ dependencies {
3939
exclude("ch.qos.logback", "logback-core")
4040
}
4141

42+
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-apache-camel-2.20:$otelInstrumentationAlphaVersion")
4243
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-apache-httpasyncclient-4.1:$otelInstrumentationAlphaVersion")
4344
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-apache-httpclient-2.0:$otelInstrumentationAlphaVersion")
4445
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-apache-httpclient-4.0:$otelInstrumentationAlphaVersion")
@@ -106,6 +107,7 @@ dependencies {
106107
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-opentelemetry-annotations-1.0:$otelInstrumentationAlphaVersion")
107108
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-opentelemetry-api-1.0:$otelInstrumentationAlphaVersion")
108109
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-opentelemetry-api-metrics-1.0:$otelInstrumentationAlphaVersion")
110+
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-quartz-2.0:$otelInstrumentationAlphaVersion")
109111
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-rabbitmq-2.7:$otelInstrumentationAlphaVersion")
110112
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-reactor-3.1:$otelInstrumentationAlphaVersion")
111113
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-reactor-netty-0.9:$otelInstrumentationAlphaVersion")

agent/instrumentation/gradle.lockfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ io.opentelemetry.instrumentation:opentelemetry-lettuce-common:1.6.0+ai.patches-a
6666
io.opentelemetry.instrumentation:opentelemetry-mongo-3.1:1.6.0+ai.patches-alpha=runtimeClasspath
6767
io.opentelemetry.instrumentation:opentelemetry-netty-4.1:1.6.0+ai.patches-alpha=runtimeClasspath
6868
io.opentelemetry.instrumentation:opentelemetry-okhttp-3.0:1.6.0+ai.patches-alpha=runtimeClasspath
69+
io.opentelemetry.instrumentation:opentelemetry-quartz-2.0:1.6.0+ai.patches-alpha=runtimeClasspath
6970
io.opentelemetry.instrumentation:opentelemetry-reactor-3.1:1.6.0+ai.patches-alpha=runtimeClasspath
7071
io.opentelemetry.instrumentation:opentelemetry-rxjava-2.0:1.6.0+ai.patches-alpha=runtimeClasspath
7172
io.opentelemetry.instrumentation:opentelemetry-rxjava-3.0:1.6.0+ai.patches-alpha=runtimeClasspath
@@ -74,6 +75,7 @@ io.opentelemetry.instrumentation:opentelemetry-servlet-common:1.6.0+ai.patches-a
7475
io.opentelemetry.instrumentation:opentelemetry-servlet-javax-common:1.6.0+ai.patches-alpha=runtimeClasspath
7576
io.opentelemetry.instrumentation:opentelemetry-spring-integration-4.1:1.6.0+ai.patches-alpha=runtimeClasspath
7677
io.opentelemetry.instrumentation:opentelemetry-spring-webflux-5.0:1.6.0+ai.patches-alpha=runtimeClasspath
78+
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-apache-camel-2.20:1.6.0+ai.patches-alpha=runtimeClasspath
7779
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-apache-httpasyncclient-4.1:1.6.0+ai.patches-alpha=runtimeClasspath
7880
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-apache-httpclient-2.0:1.6.0+ai.patches-alpha=runtimeClasspath
7981
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-apache-httpclient-4.0:1.6.0+ai.patches-alpha=runtimeClasspath
@@ -145,6 +147,7 @@ io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-okhttp-3.0:1.
145147
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-opentelemetry-annotations-1.0:1.6.0+ai.patches-alpha=runtimeClasspath
146148
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-opentelemetry-api-1.0:1.6.0+ai.patches-alpha=runtimeClasspath
147149
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-opentelemetry-api-metrics-1.0:1.6.0+ai.patches-alpha=runtimeClasspath
150+
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-quartz-2.0:1.6.0+ai.patches-alpha=runtimeClasspath
148151
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-rabbitmq-2.7:1.6.0+ai.patches-alpha=runtimeClasspath
149152
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-reactor-3.1:1.6.0+ai.patches-alpha=runtimeClasspath
150153
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-reactor-netty-0.9:1.6.0+ai.patches-alpha=runtimeClasspath

0 commit comments

Comments
 (0)