Add `HttpServerResponseCustomizer` support for Servlet 2.2/3.0/5.0 and
Jetty 8/11 instrumentations. Enabled testing for it in JaxRs tests as
well since those should now all be covered due to servlet
instrumentations. Fixed Jetty 11 test source set directory name.
Known limitation - response headers do not work on Jetty 8 for internal
exception pages caused by throwing an exception that is handled outside
of instrumentation scope, working around this would require an
additional instrumentation and/or keeping an expired `Context` instance
referenced by the response object. This does not appear to be an issue
on Jetty 11. Additionally, calling `ServletResponse#reset` can wipe
headers as well, for which there is no workaround (yet?) in this PR.
* Update gradle to 7.5
* Bump to 7.5.1
* gradle 7.5.1 with jdk17
* spotless
* one more --add-opens
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
* Merge javaagent-instrumentation-api into javaagent-extension-api
* remove some leftover references to javaagent-instrumentation-api
* add missing instrumentation-api to distro example
* Add `http.route` to the server span when `ServerSpanNaming` is updated
* fix camel tests
* fix test compilation failure
* assert route in camel instrumentation
* don't report 400 level as error for server spans
* fix HttpServerTest base class
* fix JspInstrumentationForward test
* split HttpStatusConverter into client and server implementations, and create two HttpSpanStatusExtractor.create methods, one for server and one for client.
* rebase
* fix test
* spotless
* fix test
* remove unused
* use strongly typed attributes converters and rename to overloaded create()
* fix tests
* remove redundant assert
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
* Test captured HTTP headers - HTTP server tests, part 2
* Turn off captured HTTP headers testing for grizzly
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
* Extract HTTP request/response headers as span attributes
* fix muzzle
* code review comments
* fix compilation failure after merge conflict
* avoid using streams API when transforming the headers list
* fix liberty extractor
* fix spring webmvc extractor
* Make it possible to use InstrumentationContext (now VirtualField) from library instrumentation
* fix tests
* fix javadocs
* fix some more tests
* code review comments
* setIfNull, computeIfNull
* Build servlet mapping resolver only when needed
* move factory interface to boot loader to ensure that everybody has the same class for it
* spotless
* Helper classes should not look up ContextStore on each access
* Convert servlet to instrumenter api
* make classes final
* Remove some tracer files
* remove xxx
* fix liberty and wildfly exception smoke test
* fix async smoke test on liberty
* Apply suggestions from code review
Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
* generic TextMapGetter for servlets
* not going to use http.route for servlets
* simplify
* add servlet timeout in attribute extractor
* move classes from library to javaagent
* remove unneeded dependency
* make method private
* move helper class initialization to singleton, remove helpers that don't have any methods, add shouldStart checks
* Update instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/ServletRequestContext.java
Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
* add import
* rename methods that start and end spans
Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>