opentelemetry-java-instrume.../instrumentation/jaxrs
Ago Allikmaa a9788a22de
Provide ability to add HTTP server response headers, with Tomcat implementation (#7990)
This allows custom distributions of the agent to register
`HttpServerResponseCustomizer` implementations. When a supported HTTP
server instrumentation starts processing a response, the `onStart`
method of all registered implementations will be invoked with the
`Context` of the SERVER span, an instrumentation-specific response
object and `HttpServerResponseMutator` instance that allows appending
headers to that response.

The intent of this is to allow custom distributions to set a header
containing span context information, such as the trace and span IDs. As
such, the initial implementation only allows appending response headers
and nothing else.

The `HttpServerResponseCustomizer` and related classes are currently in
a subpackage of the `io.opentelemetry.javaagent.bootstrap` package in
`javaagent-extension-api`. This makes them get loaded in the bootstrap
classloader, thus directly accessible from instrumentations. I am not
aware if there is an elegant way to put it in the agent classloader
instead, yet have the same instance accessible from both
`AgentInstaller` and instrumentations.

This also includes Tomcat-specific implementation in order to be able to
demonstrate that it works, and add automated testing of this to
HttpServerTest including one implementation.
2023-03-13 17:46:39 +01:00
..
jaxrs-1.0/javaagent Update HTTP span name extractors (#7730) 2023-02-14 07:40:05 -08:00
jaxrs-2.0 Upgrade to gradle 8.0.2 (#7978) 2023-03-07 10:29:26 +02:00
jaxrs-3.0 Fix jaxrs annotation instrumentation on openliberty (#7890) 2023-02-24 13:00:11 +02:00
jaxrs-common Provide ability to add HTTP server response headers, with Tomcat implementation (#7990) 2023-03-13 17:46:39 +01:00
README.md More spotless (#7126) 2022-11-11 05:01:21 +00:00

README.md

Settings for the Jaxrs instrumentation

System property Type Default Description
otel.instrumentation.jaxrs.experimental-span-attributes Boolean false Enable the capture of experimental span attributes.