Skip to content

Commit daba083

Browse files
authored
Metadata for instrumentations starting with G (#14521)
1 parent 7cbd16e commit daba083

File tree

12 files changed

+276
-0
lines changed

12 files changed

+276
-0
lines changed

docs/instrumentation-list.yaml

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2873,20 +2873,94 @@ libraries:
28732873
type: STRING
28742874
geode:
28752875
- name: geode-1.4
2876+
description: This instrumentation enables database CLIENT spans and metrics for
2877+
Apache Geode cache operations.
28762878
source_path: instrumentation/geode-1.4
28772879
scope:
28782880
name: io.opentelemetry.geode-1.4
28792881
target_versions:
28802882
javaagent:
28812883
- org.apache.geode:geode-core:[1.4.0,)
2884+
configurations:
2885+
- name: otel.instrumentation.common.db-statement-sanitizer.enabled
2886+
description: Enables statement sanitization for database queries.
2887+
type: boolean
2888+
default: true
2889+
telemetry:
2890+
- when: default
2891+
spans:
2892+
- span_kind: CLIENT
2893+
attributes:
2894+
- name: db.name
2895+
type: STRING
2896+
- name: db.operation
2897+
type: STRING
2898+
- name: db.statement
2899+
type: STRING
2900+
- name: db.system
2901+
type: STRING
2902+
- when: otel.semconv-stability.opt-in=database
2903+
metrics:
2904+
- name: db.client.operation.duration
2905+
description: Duration of database client operations.
2906+
type: HISTOGRAM
2907+
unit: s
2908+
attributes:
2909+
- name: db.namespace
2910+
type: STRING
2911+
- name: db.operation.name
2912+
type: STRING
2913+
- name: db.system.name
2914+
type: STRING
2915+
spans:
2916+
- span_kind: CLIENT
2917+
attributes:
2918+
- name: db.namespace
2919+
type: STRING
2920+
- name: db.operation.name
2921+
type: STRING
2922+
- name: db.query.text
2923+
type: STRING
2924+
- name: db.system.name
2925+
type: STRING
28822926
google:
28832927
- name: google-http-client-1.19
2928+
description: This instrumentation enables HTTP CLIENT spans and metrics for Google
2929+
HTTP Client requests.
28842930
source_path: instrumentation/google-http-client-1.19
28852931
scope:
28862932
name: io.opentelemetry.google-http-client-1.19
28872933
target_versions:
28882934
javaagent:
28892935
- com.google.http-client:google-http-client:[1.19.0,)
2936+
configurations:
2937+
- name: otel.instrumentation.http.known-methods
2938+
description: |
2939+
Configures the instrumentation to recognize an alternative set of HTTP request methods. All other methods will be treated as `_OTHER`.
2940+
type: list
2941+
default: CONNECT,DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,TRACE
2942+
- name: otel.instrumentation.http.client.capture-request-headers
2943+
description: List of HTTP request headers to capture in HTTP client telemetry.
2944+
type: list
2945+
default: ''
2946+
- name: otel.instrumentation.http.client.capture-response-headers
2947+
description: List of HTTP response headers to capture in HTTP client telemetry.
2948+
type: list
2949+
default: ''
2950+
- name: otel.instrumentation.common.peer-service-mapping
2951+
description: Used to specify a mapping from host names or IP addresses to peer
2952+
services.
2953+
type: map
2954+
default: ''
2955+
- name: otel.instrumentation.http.client.emit-experimental-telemetry
2956+
description: |
2957+
Enable the capture of experimental HTTP client telemetry. Adds the `http.request.body.size` and `http.response.body.size` attributes to spans, and records `http.client.request.size` and `http.client.response.size` metrics.
2958+
type: boolean
2959+
default: false
2960+
- name: otel.instrumentation.http.client.experimental.redact-query-parameters
2961+
description: Redact sensitive URL parameters. See https://opentelemetry.io/docs/specs/semconv/http/http-spans.
2962+
type: boolean
2963+
default: true
28902964
telemetry:
28912965
- when: default
28922966
metrics:
@@ -2920,12 +2994,24 @@ libraries:
29202994
type: STRING
29212995
grails:
29222996
- name: grails-3.0
2997+
description: |
2998+
This instrumentation enriches existing SERVER spans with route information, and optionally enables experimental controller (INTERNAL) spans for Grails applications.
29232999
source_path: instrumentation/grails-3.0
29243000
scope:
29253001
name: io.opentelemetry.grails-3.0
29263002
target_versions:
29273003
javaagent:
29283004
- org.grails:grails-web-url-mappings:[3.0,)
3005+
configurations:
3006+
- name: otel.instrumentation.common.experimental.controller-telemetry.enabled
3007+
description: Enables the creation of experimental controller (INTERNAL) spans.
3008+
type: boolean
3009+
default: false
3010+
telemetry:
3011+
- when: otel.instrumentation.common.experimental.controller-telemetry.enabled=true
3012+
spans:
3013+
- span_kind: INTERNAL
3014+
attributes: []
29293015
graphql:
29303016
- name: graphql-java-12.0
29313017
source_path: instrumentation/graphql-java/graphql-java-12.0
@@ -2948,12 +3034,85 @@ libraries:
29483034
- com.graphql-java:graphql-java:20.0
29493035
grizzly:
29503036
- name: grizzly-2.3
3037+
description: This instrumentation enables HTTP SERVER spans and metrics for Grizzly
3038+
applications.
29513039
source_path: instrumentation/grizzly-2.3
29523040
scope:
29533041
name: io.opentelemetry.grizzly-2.3
29543042
target_versions:
29553043
javaagent:
29563044
- org.glassfish.grizzly:grizzly-http:[2.3,)
3045+
configurations:
3046+
- name: otel.instrumentation.http.known-methods
3047+
description: |
3048+
Configures the instrumentation to recognize an alternative set of HTTP request methods. All other methods will be treated as `_OTHER`.
3049+
type: list
3050+
default: CONNECT,DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,TRACE
3051+
- name: otel.instrumentation.http.server.capture-request-headers
3052+
description: List of HTTP request headers to capture in HTTP server telemetry.
3053+
type: list
3054+
default: ''
3055+
- name: otel.instrumentation.http.server.capture-response-headers
3056+
description: List of HTTP response headers to capture in HTTP server telemetry.
3057+
type: list
3058+
default: ''
3059+
- name: otel.instrumentation.common.peer-service-mapping
3060+
description: Used to specify a mapping from host names or IP addresses to peer
3061+
services.
3062+
type: map
3063+
default: ''
3064+
- name: otel.instrumentation.http.server.emit-experimental-telemetry
3065+
description: |
3066+
Enable the capture of experimental HTTP server telemetry. Adds the `http.request.body.size` and `http.response.body.size` attributes to spans, and records `http.server.request.body.size` and `http.server.response.body.size` metrics.
3067+
type: boolean
3068+
default: false
3069+
telemetry:
3070+
- when: default
3071+
metrics:
3072+
- name: http.server.request.duration
3073+
description: Duration of HTTP server requests.
3074+
type: HISTOGRAM
3075+
unit: s
3076+
attributes:
3077+
- name: http.request.method
3078+
type: STRING
3079+
- name: http.response.status_code
3080+
type: LONG
3081+
- name: network.protocol.version
3082+
type: STRING
3083+
- name: url.scheme
3084+
type: STRING
3085+
spans:
3086+
- span_kind: SERVER
3087+
attributes:
3088+
- name: client.address
3089+
type: STRING
3090+
- name: error.type
3091+
type: STRING
3092+
- name: http.request.method
3093+
type: STRING
3094+
- name: http.request.method_original
3095+
type: STRING
3096+
- name: http.response.status_code
3097+
type: LONG
3098+
- name: network.peer.address
3099+
type: STRING
3100+
- name: network.peer.port
3101+
type: LONG
3102+
- name: network.protocol.version
3103+
type: STRING
3104+
- name: server.address
3105+
type: STRING
3106+
- name: server.port
3107+
type: LONG
3108+
- name: url.path
3109+
type: STRING
3110+
- name: url.query
3111+
type: STRING
3112+
- name: url.scheme
3113+
type: STRING
3114+
- name: user_agent.original
3115+
type: STRING
29573116
grpc:
29583117
- name: grpc-1.6
29593118
source_path: instrumentation/grpc-1.6
@@ -2976,13 +3135,25 @@ libraries:
29763135
- com.google.guava:guava:10.0
29773136
gwt:
29783137
- name: gwt-2.0
3138+
description: This instrumentation enables SERVER spans for GWT RPC requests.
29793139
source_path: instrumentation/gwt-2.0
29803140
scope:
29813141
name: io.opentelemetry.gwt-2.0
29823142
target_versions:
29833143
javaagent:
29843144
- com.google.gwt:gwt-servlet:[2.0.0,)
29853145
- org.gwtproject:gwt-servlet:[2.10.0,)
3146+
telemetry:
3147+
- when: default
3148+
spans:
3149+
- span_kind: SERVER
3150+
attributes:
3151+
- name: rpc.method
3152+
type: STRING
3153+
- name: rpc.service
3154+
type: STRING
3155+
- name: rpc.system
3156+
type: STRING
29863157
hibernate:
29873158
- name: hibernate-3.3
29883159
source_path: instrumentation/hibernate/hibernate-3.3

instrumentation-docs/instrumentations.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ readonly INSTRUMENTATIONS=(
132132
"couchbase:couchbase-2.6:javaagent:testStableSemconv"
133133
"couchbase:couchbase-2.6:javaagent:testExperimental"
134134
"dropwizard:dropwizard-views-0.7:javaagent:test"
135+
"geode-1.4:javaagent:test"
136+
"geode-1.4:javaagent:testStableSemconv"
137+
"grails-3.0:javaagent:test"
138+
"grizzly-2.3:javaagent:test"
139+
"gwt-2.0:javaagent:test"
135140
)
136141

137142
# Some instrumentation test suites don't run ARM, so we use colima to run them in an x86_64

instrumentation/geode-1.4/javaagent/build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,18 @@ dependencies {
1717
annotationProcessor("com.google.auto.value:auto-value")
1818
}
1919

20+
val collectMetadata = findProperty("collectMetadata")?.toString() ?: "false"
21+
2022
tasks {
2123
val testStableSemconv by registering(Test::class) {
2224
jvmArgs("-Dotel.semconv-stability.opt-in=database")
25+
26+
systemProperty("collectMetadata", collectMetadata)
27+
systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database")
28+
}
29+
30+
test {
31+
systemProperty("collectMetadata", collectMetadata)
2332
}
2433

2534
check {

instrumentation/geode-1.4/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/geode/PutGetTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@
55

66
package io.opentelemetry.javaagent.instrumentation.geode;
77

8+
import static io.opentelemetry.instrumentation.testing.junit.db.DbClientMetricsTestUtil.assertDurationMetric;
89
import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable;
910
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
1011
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_NAME;
12+
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_NAMESPACE;
1113
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_OPERATION;
14+
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_OPERATION_NAME;
1215
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_STATEMENT;
1316
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_SYSTEM;
17+
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_SYSTEM_NAME;
1418
import static org.junit.jupiter.api.Assertions.assertEquals;
1519
import static org.junit.jupiter.api.Assertions.assertTrue;
1620

@@ -52,6 +56,15 @@ private static Stream<Arguments> provideParameters() {
5256
Arguments.of("One", Integer.valueOf(1)));
5357
}
5458

59+
@Test
60+
@SuppressWarnings("deprecation") // using deprecated semconv
61+
void testDurationMetric() {
62+
region.put("key", "value");
63+
64+
assertDurationMetric(
65+
testing, "io.opentelemetry.geode-1.4", DB_SYSTEM_NAME, DB_NAMESPACE, DB_OPERATION_NAME);
66+
}
67+
5568
@ParameterizedTest
5669
@MethodSource("provideParameters")
5770
void testPutAndGet(Object key, Object value) {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
description: This instrumentation enables database CLIENT spans and metrics for Apache Geode cache operations.
2+
configurations:
3+
- name: otel.instrumentation.common.db-statement-sanitizer.enabled
4+
description: Enables statement sanitization for database queries.
5+
type: boolean
6+
default: true
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
description: This instrumentation enables HTTP CLIENT spans and metrics for Google HTTP Client requests.
2+
configurations:
3+
- name: otel.instrumentation.http.known-methods
4+
description: >
5+
Configures the instrumentation to recognize an alternative set of HTTP request methods. All
6+
other methods will be treated as `_OTHER`.
7+
type: list
8+
default: "CONNECT,DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,TRACE"
9+
- name: otel.instrumentation.http.client.capture-request-headers
10+
description: List of HTTP request headers to capture in HTTP client telemetry.
11+
type: list
12+
default: ""
13+
- name: otel.instrumentation.http.client.capture-response-headers
14+
description: List of HTTP response headers to capture in HTTP client telemetry.
15+
type: list
16+
default: ""
17+
- name: otel.instrumentation.common.peer-service-mapping
18+
description: Used to specify a mapping from host names or IP addresses to peer services.
19+
type: map
20+
default: ""
21+
- name: otel.instrumentation.http.client.emit-experimental-telemetry
22+
description: >
23+
Enable the capture of experimental HTTP client telemetry. Adds the `http.request.body.size`
24+
and `http.response.body.size` attributes to spans, and records `http.client.request.size` and
25+
`http.client.response.size` metrics.
26+
type: boolean
27+
default: false
28+
- name: otel.instrumentation.http.client.experimental.redact-query-parameters
29+
description: Redact sensitive URL parameters. See https://opentelemetry.io/docs/specs/semconv/http/http-spans.
30+
type: boolean
31+
default: true

instrumentation/grails-3.0/javaagent/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,8 @@ tasks {
8181
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
8282
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
8383
jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true")
84+
85+
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
86+
systemProperty("metadataConfig", "otel.instrumentation.common.experimental.controller-telemetry.enabled=true")
8487
}
8588
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
description: >
2+
This instrumentation enriches existing SERVER spans with route information, and optionally enables
3+
experimental controller (INTERNAL) spans for Grails applications.
4+
configurations:
5+
- name: otel.instrumentation.common.experimental.controller-telemetry.enabled
6+
description: Enables the creation of experimental controller (INTERNAL) spans.
7+
type: boolean
8+
default: false

instrumentation/grizzly-2.3/javaagent/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ tasks {
2424
// required on jdk17
2525
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
2626
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
27+
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
2728
}
2829
}
2930

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
description: This instrumentation enables HTTP SERVER spans and metrics for Grizzly applications.
2+
configurations:
3+
- name: otel.instrumentation.http.known-methods
4+
description: >
5+
Configures the instrumentation to recognize an alternative set of HTTP request methods. All
6+
other methods will be treated as `_OTHER`.
7+
type: list
8+
default: "CONNECT,DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,TRACE"
9+
- name: otel.instrumentation.http.server.capture-request-headers
10+
description: List of HTTP request headers to capture in HTTP server telemetry.
11+
type: list
12+
default: ""
13+
- name: otel.instrumentation.http.server.capture-response-headers
14+
description: List of HTTP response headers to capture in HTTP server telemetry.
15+
type: list
16+
default: ""
17+
- name: otel.instrumentation.common.peer-service-mapping
18+
description: Used to specify a mapping from host names or IP addresses to peer services.
19+
type: map
20+
default: ""
21+
- name: otel.instrumentation.http.server.emit-experimental-telemetry
22+
description: >
23+
Enable the capture of experimental HTTP server telemetry. Adds the `http.request.body.size` and
24+
`http.response.body.size` attributes to spans, and records `http.server.request.body.size`
25+
and `http.server.response.body.size` metrics.
26+
type: boolean
27+
default: false

0 commit comments

Comments
 (0)