wu-sheng opened a new pull request, #814:
URL: https://github.com/apache/skywalking-java/pull/814

   ### Collect HTTP request headers on Tomcat entry spans, plus mixed-classpath 
/ jakarta `http.params` test coverage
   
   Two related follow-ups to the servlet-commons unification (#812), both about 
HTTP request-tag collection on the Tomcat/servlet path.
   
   1. **Tomcat `http.headers`.** `http.headers` was emitted only by the Spring 
MVC plugin, so `plugin.http.include_http_headers` was a dead no-op for plain 
servlet apps (e.g. RESTEasy) served by the Tomcat plugin. 
`TomcatPluginConfig.Plugin.Http` now declares `INCLUDE_HTTP_HEADERS` + 
`HTTP_HEADERS_LENGTH_THRESHOLD` — the shared `plugin.http.*` namespace the 
Tomcat plugin already uses for its params threshold, so **no new config key and 
no `agent.config` change** — and `TomcatInvokeInterceptor` collects the 
configured request headers, guarded to a no-op when the config is empty.
   
   2. **`spring-6.x-mixed-servlet-scenario`.** An end-to-end repro of the 
apache/skywalking#13938 field condition: a Jakarta Spring 6 WAR that also 
carries `javax.servlet-api:4.0.1` at compile scope, so both `javax.servlet.*` 
(WEB-INF/lib) and `jakarta.servlet.*` (Tomcat 10.1 container) are loadable at 
once. Asserts `http.headers`/`http.params` are still collected on the jakarta 
entry span, proving `servlet-commons`' runtime `instanceof` dispatch resolves 
the live request under a mixed classpath — until now only covered by the 
`HttpRequestWrappersTest` unit test.
   
   ### Feature checklist
   - [x] Update the [`CHANGES` 
log](https://github.com/apache/skywalking-java/blob/main/CHANGES.md).
   - [x] Tests (plugin scenarios) added to verify the change: 
`tomcat-9x-scenario` (javax, Tomcat 9) and `tomcat-10x-scenario` (jakarta, 
Tomcat 10) now assert `http.headers` + `http.params` on the Tomcat entry span 
(which also fills the previously-missing jakarta `http.params` coverage); 
`spring-6.x-mixed-servlet-scenario` asserts them under a mixed classpath. All 
verified locally.
   
   Notes: the Tomcat header collection reuses the same 
`plugin.http.include_http_headers` config as Spring MVC. When both plugins own 
the entry (Spring-on-Tomcat), `EntrySpan`'s multi-entry override keeps only the 
innermost entry's tags, so the tag is not duplicated. Header collection is 
tested on the dedicated single-plugin Tomcat scenarios rather than a mixed 
Spring/Tomcat one, so the assertion is unambiguous.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to