Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add play framework preview instrumentation #1958

Merged
merged 1 commit into from
Nov 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ public static class InternalConfiguration {

public static class PreviewInstrumentation {

public DisabledByDefaultInstrumentation play = new DisabledByDefaultInstrumentation();

public DisabledByDefaultInstrumentation akka = new DisabledByDefaultInstrumentation();

public DisabledByDefaultInstrumentation apacheCamel = new DisabledByDefaultInstrumentation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ static Config getConfig(Configuration config) {
properties.put("otel.instrumentation.akka-actor.enabled", "false");
properties.put("otel.instrumentation.akka-http.enabled", "false");
}
if (!config.preview.instrumentation.play.enabled) {
// play instrumentation is ON by default in OTEL
properties.put("otel.instrumentation.play.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 {
QUARTZ_DISABLED(21), // preview instrumentation, quartz is ON by default in OTEL
APACHE_CAMEL_DISABLED(22), // preview instrumentation, apache camel is ON by default in OTEL
AKKA_DISABLED(23), // preview instrumentation, akka is ON by default in OTEL
PROPAGATION_DISABLED(24);
PROPAGATION_DISABLED(24),
PLAY_DISABLED(25); // preview instrumentation, play is ON by default in OTEL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


private static final Map<String, Feature> javaVendorFeatureMap;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ void trackConfigurationOptions(Configuration config) {
if (config.preview.instrumentation.grizzly.enabled) {
featureList.add(Feature.GRIZZLY_ENABLED);
}
if (!config.preview.instrumentation.play.enabled) {
featureList.add(Feature.PLAY_DISABLED);
}
if (!config.preview.instrumentation.quartz.enabled) {
featureList.add(Feature.QUARTZ_DISABLED);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ class Instrumentations {
INSTRUMENTATION_MAP.put("io.opentelemetry.servlet-3.0", 52);
INSTRUMENTATION_MAP.put("io.opentelemetry.servlet-common", 53);
INSTRUMENTATION_MAP.put("io.opentelemetry.spring-scheduling-3.1", 54);
INSTRUMENTATION_MAP.put("io.opentelemetry.play-2.4", 55);
INSTRUMENTATION_MAP.put("io.opentelemetry.play-2.6", 56);
}

// 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 @@ -112,6 +112,8 @@ 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-play-2.4:$otelInstrumentationAlphaVersion")
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-play-2.6:$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")
Expand Down
2 changes: 2 additions & 0 deletions agent/instrumentation/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-okhttp-3.0:1.
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-opentelemetry-annotations-1.0:1.7.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-opentelemetry-api-1.0:1.7.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-opentelemetry-api-metrics-1.0:1.7.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-play-2.4:1.7.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-play-2.6:1.7.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-quartz-2.0:1.7.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-rabbitmq-2.7:1.7.0+ai.patches-alpha=runtimeClasspath
io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-reactor-3.1:1.7.0+ai.patches-alpha=runtimeClasspath
Expand Down