Skip to content

Commit a3c68e2

Browse files
jaydelucalaurit
andauthored
JAXWS metadata (#14864)
Co-authored-by: Lauri Tulmin <[email protected]>
1 parent 89ed9eb commit a3c68e2

File tree

21 files changed

+201
-52
lines changed

21 files changed

+201
-52
lines changed

docs/contributing/documenting-instrumentation.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ instrumentation.
8383
Example:
8484

8585
```yaml
86+
display_name: "Example Instrumentation"
8687
description: "This instrumentation enables..."
8788
semantic_conventions:
8889
- HTTP_CLIENT_SPANS
@@ -117,6 +118,15 @@ additional_telemetry:
117118
type: "STRING"
118119
```
119120
121+
### Display Name (optional)
122+
123+
Display name is mostly used for UI purposes, and has two main uses:
124+
125+
- Providing a more user-friendly name for the instrumentation than the module name
126+
(e.g., "Apache CXF JAX-RS 2.x" instead of "jaxrs-2.0-cxf-3.2").
127+
- Collapsing multiple related modules into a single display name
128+
(e.g., "Akka Actors" for both "akka-actor-2.3" and "akka-actor-fork-join-2.5").
129+
120130
### Description (required)
121131
122132
At a minimum, every instrumentation metadata file should include a `description`.
@@ -150,6 +160,13 @@ Some notes when writing descriptions:
150160
the description unless they are essential to understanding the purpose of the instrumentation.
151161
* It is not usually necessary to include specific library or framework version numbers in the
152162
description, unless that context is significant in some way.
163+
* When describing instrumentations with controller or view spans:
164+
* Always explicitly state that controller/view spans are disabled by default
165+
* Use the phrase "(controller spans are disabled by default)" or "(view spans are disabled by default)"
166+
* When an instrumentation has both enabled-by-default features (like HTTP_ROUTE) and disabled-by-default
167+
features (like CONTROLLER_SPANS or VIEW_SPANS), describe the enabled features first, then the disabled features
168+
* Example: "This instrumentation enriches HTTP server spans with route information, and enables
169+
controller spans for Apache CXF JAX-WS web services (controller spans are disabled by default)."
153170

154171

155172
### Semantic Conventions
@@ -185,11 +202,13 @@ the relevant functionality descriptions.
185202
List of possible options:
186203

187204
* `HTTP_ROUTE`: Instrumentation that enriches HTTP spans with route information
188-
* `EXPERIMENTAL_ONLY`: Instrumentation that is experimental and may not be stable
189-
* `CONTEXT_PROPAGATION`: Instrumentation that provides context propagation capabilities
205+
* `CONTEXT_PROPAGATION`: Instrumentation that propagates OpenTelemetry context across application or thread boundaries. This applies to:
206+
* Inter-process/application context propagation: Passing context through headers between applications (HTTP, gRPC, messaging, etc.)
207+
* Inter-thread context propagation: Passing context from one thread to another (executors, actors, reactive streams, etc.)
208+
* Does not include standard single-threaded scope management or normal span creation patterns
190209
* `AUTO_INSTRUMENTATION_SHIM`: Instrumentation that adapts or bridges instrumentation from upstream libraries or frameworks
191-
* `CONTROLLER_SPANS`: Instrumentation that generates controller-level spans
192-
* `VIEW_SPANS`: Instrumentation that generates view-level spans
210+
* `CONTROLLER_SPANS`: Instrumentation that generates controller-level spans for controller/handler methods in web frameworks (disabled by default, experimental)
211+
* `VIEW_SPANS`: Instrumentation that generates view-level spans for view rendering such as templates or JSP (disabled by default, experimental)
193212

194213
### Library Link
195214

docs/instrumentation-list.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4772,34 +4772,108 @@ libraries:
47724772
type: BOOLEAN
47734773
jaxws:
47744774
- name: jaxws-2.0
4775+
display_name: JAX-WS
4776+
description: |
4777+
This instrumentation enables controller spans for JAX-WS Provider implementations (controller spans are disabled by default).
4778+
library_link: https://github.com/jakartaee/jax-ws-api
4779+
features:
4780+
- CONTROLLER_SPANS
47754781
source_path: instrumentation/jaxws/jaxws-2.0
47764782
scope:
47774783
name: io.opentelemetry.jaxws-2.0
47784784
target_versions:
47794785
javaagent:
47804786
- javax.xml.ws:jaxws-api:[2.0,]
4787+
configurations:
4788+
- name: otel.instrumentation.common.experimental.controller-telemetry.enabled
4789+
description: Enables the creation of experimental controller spans.
4790+
type: boolean
4791+
default: false
4792+
telemetry:
4793+
- when: otel.instrumentation.common.experimental.controller-telemetry.enabled=true
4794+
spans:
4795+
- span_kind: INTERNAL
4796+
attributes:
4797+
- name: code.function
4798+
type: STRING
4799+
- name: code.namespace
4800+
type: STRING
47814801
- name: jaxws-2.0-axis2-1.6
4802+
display_name: Apache Axis2 1.6 JAX-WS 2.x
4803+
description: |
4804+
This instrumentation enriches HTTP server spans with route information, and enables controller spans for Apache Axis2 JAX-WS web services (controller spans are disabled by default).
4805+
library_link: https://axis.apache.org/axis2/java/core/
4806+
features:
4807+
- HTTP_ROUTE
4808+
- CONTROLLER_SPANS
47824809
source_path: instrumentation/jaxws/jaxws-2.0-axis2-1.6
47834810
scope:
47844811
name: io.opentelemetry.jaxws-2.0-axis2-1.6
47854812
target_versions:
47864813
javaagent:
47874814
- org.apache.axis2:axis2-jaxws:[1.6.0,)
4815+
configurations:
4816+
- name: otel.instrumentation.common.experimental.controller-telemetry.enabled
4817+
description: Enables the creation of experimental controller spans.
4818+
type: boolean
4819+
default: false
4820+
telemetry:
4821+
- when: otel.instrumentation.common.experimental.controller-telemetry.enabled=true
4822+
spans:
4823+
- span_kind: INTERNAL
4824+
attributes: []
47884825
- name: jaxws-cxf-3.0
4826+
display_name: Apache CXF 3.x JAX-WS
4827+
description: |
4828+
This instrumentation enriches HTTP server spans with route information, and enables controller spans for Apache CXF JAX-WS web services (controller spans are disabled by default).
4829+
library_link: https://cxf.apache.org/
4830+
features:
4831+
- HTTP_ROUTE
4832+
- CONTROLLER_SPANS
47894833
source_path: instrumentation/jaxws/jaxws-cxf-3.0
47904834
scope:
47914835
name: io.opentelemetry.jaxws-cxf-3.0
47924836
target_versions:
47934837
javaagent:
47944838
- org.apache.cxf:cxf-rt-frontend-jaxws:[3.0.0,)
4839+
configurations:
4840+
- name: otel.instrumentation.common.experimental.controller-telemetry.enabled
4841+
description: Enables the creation of experimental controller spans.
4842+
type: boolean
4843+
default: false
4844+
telemetry:
4845+
- when: otel.instrumentation.common.experimental.controller-telemetry.enabled=true
4846+
spans:
4847+
- span_kind: INTERNAL
4848+
attributes: []
47954849
- name: jaxws-jws-api-1.1
4850+
display_name: JWS API
4851+
description: |
4852+
This instrumentation enables controller spans for methods annotated with the @WebService annotation from the JWS API (controller spans are disabled by default).
4853+
library_link: https://github.com/jakartaee/jws-api
47964854
disabled_by_default: true
4855+
features:
4856+
- CONTROLLER_SPANS
47974857
source_path: instrumentation/jaxws/jaxws-jws-api-1.1
47984858
scope:
47994859
name: io.opentelemetry.jaxws-jws-api-1.1
48004860
target_versions:
48014861
javaagent:
48024862
- javax.jws:javax.jws-api:[1.1,]
4863+
configurations:
4864+
- name: otel.instrumentation.common.experimental.controller-telemetry.enabled
4865+
description: Enables the creation of experimental controller spans.
4866+
type: boolean
4867+
default: false
4868+
telemetry:
4869+
- when: otel.instrumentation.common.experimental.controller-telemetry.enabled=true
4870+
spans:
4871+
- span_kind: INTERNAL
4872+
attributes:
4873+
- name: code.function
4874+
type: STRING
4875+
- name: code.namespace
4876+
type: STRING
48034877
- name: jaxws-metro-2.2
48044878
source_path: instrumentation/jaxws/jaxws-metro-2.2
48054879
scope:

instrumentation-docs/instrumentations.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ readonly INSTRUMENTATIONS=(
119119
"jaxrs:jaxrs-3.0:jaxrs-3.0-jersey-3.0:javaagent:testExperimental"
120120
"jaxrs:jaxrs-3.0:jaxrs-3.0-resteasy-6.0:javaagent:test"
121121
"jaxrs:jaxrs-3.0:jaxrs-3.0-resteasy-6.0:javaagent:testExperimental"
122+
"jaxws:jaxws-2.0:javaagent:test"
123+
"jaxws:jaxws-2.0-axis2-1.6:javaagent:test"
124+
"jaxws:jaxws-cxf-3.0:javaagent:test"
125+
"jaxws:jaxws-jws-api-1.1:javaagent:test"
122126
"jetty-httpclient:jetty-httpclient-12.0:javaagent:test"
123127
"jetty-httpclient:jetty-httpclient-9.2:javaagent:test"
124128
"jodd-http-4.2:javaagent:test"

instrumentation-docs/readme.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ public class SpringWebInstrumentationModule extends InstrumentationModule
138138
* The specific functionality that the instrumentation provides
139139
* Options are:
140140
* HTTP_ROUTE
141-
* EXPERIMENTAL_ONLY
142141
* CONTEXT_PROPAGATION
143142
* AUTO_INSTRUMENTATION_SHIM
144143
* CONTROLLER_SPANS

instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/internal/InstrumentationFeature.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
*/
1212
public enum InstrumentationFeature {
1313
HTTP_ROUTE,
14-
EXPERIMENTAL_ONLY,
1514
CONTEXT_PROPAGATION,
1615
AUTO_INSTRUMENTATION_SHIM,
1716
CONTROLLER_SPANS,

instrumentation/apache-httpasyncclient-4.1/metadata.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ library_link: https://hc.apache.org/index.html
44
semantic_conventions:
55
- HTTP_CLIENT_SPANS
66
- HTTP_CLIENT_METRICS
7+

instrumentation/jaxws/jaxws-2.0-axis2-1.6-testing/build.gradle.kts

Lines changed: 0 additions & 45 deletions
This file was deleted.

instrumentation/jaxws/jaxws-2.0-axis2-1.6/javaagent/build.gradle.kts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,54 @@ muzzle {
1616
}
1717
}
1818

19+
val axis2Version = "1.6.0"
20+
1921
dependencies {
2022
bootstrap(project(":instrumentation:servlet:servlet-common:bootstrap"))
2123

2224
library("org.apache.axis2:axis2-jaxws:1.6.0")
2325

2426
compileOnly(project(":muzzle"))
2527
compileOnly("jakarta.servlet:jakarta.servlet-api:5.0.0")
28+
29+
testLibrary("org.apache.axis2:axis2-jaxws:$axis2Version")
30+
testLibrary("org.apache.axis2:axis2-transport-http:$axis2Version")
31+
testLibrary("org.apache.axis2:axis2-transport-local:$axis2Version")
32+
33+
testImplementation(project(":instrumentation:jaxws:jaxws-2.0-common-testing"))
34+
35+
testInstrumentation(project(":instrumentation:jaxws:jaxws-2.0:javaagent"))
36+
testInstrumentation(project(":instrumentation:jaxws:jaxws-jws-api-1.1:javaagent"))
37+
testInstrumentation(project(":instrumentation:jaxws:jaxws-2.0-axis2-1.6:javaagent"))
38+
39+
testInstrumentation(project(":instrumentation:servlet:servlet-3.0:javaagent"))
40+
testInstrumentation(project(":instrumentation:jetty:jetty-8.0:javaagent"))
41+
42+
testImplementation("javax.xml.bind:jaxb-api:2.2.11")
43+
testImplementation("com.sun.xml.bind:jaxb-core:2.2.11")
44+
testImplementation("com.sun.xml.bind:jaxb-impl:2.2.11")
45+
46+
testImplementation("com.sun.xml.ws:jaxws-rt:2.2.8")
47+
testImplementation("com.sun.xml.ws:jaxws-tools:2.2.8")
48+
49+
latestDepTestLibrary("org.apache.axis2:axis2-jaxws:1.+") // see jaxws-3.0-axis2-2.0-testing module
50+
latestDepTestLibrary("org.apache.axis2:axis2-transport-http:1.+") // see jaxws-3.0-axis2-2.0-testing module
51+
latestDepTestLibrary("org.apache.axis2:axis2-transport-local:1.+") // see jaxws-3.0-axis2-2.0-testing module
52+
}
53+
54+
configurations.configureEach {
55+
if (name.contains("test")) {
56+
// axis has a dependency on servlet2 api, get rid of it - otherwise the servlet3 instrumentation
57+
// will fail during tests
58+
exclude("javax.servlet", "servlet-api")
59+
}
60+
}
61+
62+
tasks.withType<Test>().configureEach {
63+
// required on jdk17
64+
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
65+
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
66+
jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true")
67+
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
68+
systemProperty("metadataConfig", "otel.instrumentation.common.experimental.controller-telemetry.enabled=true")
2669
}
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)