Skip to content

Commit 129531c

Browse files
authored
Disable finatra controller spans by default (#15118)
1 parent 09feedb commit 129531c

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

docs/instrumentation-list.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3786,19 +3786,26 @@ libraries:
37863786
- com.twitter:finagle-http_2.12:[23.11.0,]
37873787
finatra:
37883788
- name: finatra-2.9
3789-
description: This instrumentation for the Finatra web framework augments the telemetry
3790-
generated by the underlying Netty instrumentation. It provides more specific,
3791-
high-level context, such as route information, to the spans generated by Netty.
3789+
description: |
3790+
This instrumentation enriches HTTP server spans with route information, and enables controller spans for the Finatra web framework (controller spans are disabled by default).
37923791
library_link: https://github.com/twitter/finatra
3792+
features:
3793+
- HTTP_ROUTE
3794+
- CONTROLLER_SPANS
37933795
source_path: instrumentation/finatra-2.9
37943796
scope:
37953797
name: io.opentelemetry.finatra-2.9
37963798
target_versions:
37973799
javaagent:
37983800
- com.twitter:finatra-http_2.11:[2.9.0,]
37993801
- com.twitter:finatra-http_2.12:[2.9.0,]
3802+
configurations:
3803+
- name: otel.instrumentation.common.experimental.controller-telemetry.enabled
3804+
description: Enables the creation of experimental controller spans.
3805+
type: boolean
3806+
default: false
38003807
telemetry:
3801-
- when: default
3808+
- when: otel.instrumentation.common.experimental.controller-telemetry.enabled=true
38023809
spans:
38033810
- span_kind: INTERNAL
38043811
attributes:

instrumentation/finatra-2.9/javaagent/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ tasks {
8686
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
8787
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
8888

89+
jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true")
90+
8991
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
92+
systemProperty("metadataConfig", "otel.instrumentation.common.experimental.controller-telemetry.enabled=true")
9093
}
9194
}
9295

instrumentation/finatra-2.9/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/finatra/FinatraSingletons.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import io.opentelemetry.instrumentation.api.semconv.http.HttpServerRoute;
1717
import io.opentelemetry.instrumentation.api.semconv.http.HttpServerRouteSource;
1818
import io.opentelemetry.instrumentation.api.util.VirtualField;
19+
import io.opentelemetry.javaagent.bootstrap.internal.ExperimentalConfig;
1920

2021
public final class FinatraSingletons {
2122

@@ -35,6 +36,7 @@ public final class FinatraSingletons {
3536
? ClassNames.simpleName(request.controllerClass())
3637
: "<unknown>")
3738
.addAttributesExtractor(CodeAttributesExtractor.create(codeAttributesGetter))
39+
.setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled())
3840
.buildInstrumenter();
3941
}
4042

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1-
description: This instrumentation for the Finatra web framework augments the telemetry generated by the underlying Netty instrumentation. It provides more specific, high-level context, such as route information, to the spans generated by Netty.
1+
description: >
2+
This instrumentation enriches HTTP server spans with route information, and enables controller
3+
spans for the Finatra web framework (controller spans are disabled by default).
24
library_link: https://github.com/twitter/finatra
5+
features:
6+
- HTTP_ROUTE
7+
- CONTROLLER_SPANS
8+
configurations:
9+
- name: otel.instrumentation.common.experimental.controller-telemetry.enabled
10+
description: Enables the creation of experimental controller spans.
11+
type: boolean
12+
default: false

0 commit comments

Comments
 (0)