Commit 24bfeea
committed
Add mixed-classpath scenario and Tomcat http.headers collection
Two related follow-ups to the #812 servlet-commons unification, both about HTTP
request-tag collection on the Tomcat/servlet path.
1. spring-6.x-mixed-servlet-scenario — an end-to-end repro of the #13938 field
condition: a Jakarta Spring 6 WAR that ALSO carries javax.servlet-api:4.0.1 at
compile scope, so both javax.servlet.* (from WEB-INF/lib) and jakarta.servlet.*
(from the Tomcat 10.1 container) are loadable in the deployed webapp at once. The
scenario asserts http.headers and http.params are still collected on the jakarta
entry span, proving servlet-commons' runtime instanceof dispatch resolves the live
request under a mixed classpath — previously only covered by the
HttpRequestWrappersTest unit test. One version by design (the resolution is
version-independent; version compatibility is already covered by spring-6.x-scenario).
2. Tomcat http.headers — http.headers was emitted only by the Spring MVC plugin, so
plugin.http.include_http_headers was a no-op for plain servlet apps served by the
Tomcat plugin. Add INCLUDE_HTTP_HEADERS + HTTP_HEADERS_LENGTH_THRESHOLD to
TomcatPluginConfig.Plugin.Http — the shared plugin.http.* namespace already used by
the Spring MVC and HttpClient plugins, so no new config key and no agent.config
change — and collect the configured request headers in TomcatInvokeInterceptor,
guarded no-op when the config is empty. Proven on the dedicated Tomcat scenarios,
where the Tomcat plugin owns the entry span: tomcat-9x (javax, Tomcat 9) and
tomcat-10x (jakarta, Tomcat 10) now carry a mock_header header and a q1 query param
on their internal self-call and assert http.headers + http.params, which also fills
the previously-missing jakarta http.params coverage.1 parent 64035d6 commit 24bfeea
28 files changed
Lines changed: 1185 additions & 4 deletions
File tree
- .github/workflows
- apm-sniffer/apm-sdk-plugin/tomcat-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat
- test/plugin/scenarios
- spring-6.x-mixed-servlet-scenario
- config
- src/main
- java/test/apache/skywalking/apm/testcase
- entity
- implinterface
- inherit
- restapi
- resttemplate
- spring3
- component
- dao
- service
- resources
- webapp/WEB-INF
- tomcat-10x-scenario
- config
- src/main/java/org/apache/skywalking/apm/testcase/tomcat10x
- tomcat-9x-scenario
- config
- src/main/java/org/apache/skywalking/apm/testcase/tomcat9x
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
67 | 74 | | |
68 | 75 | | |
69 | 76 | | |
| |||
115 | 122 | | |
116 | 123 | | |
117 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
118 | 146 | | |
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
41 | 55 | | |
42 | 56 | | |
43 | 57 | | |
0 commit comments