Skip to content

feat(servlet): add jakarta-servlet-6.0 instrumentation module for Servlet API 6.0/6.1#11588

Closed
wconti27 wants to merge 1 commit into
masterfrom
conti/feat/jakarta-servlet-6.0
Closed

feat(servlet): add jakarta-servlet-6.0 instrumentation module for Servlet API 6.0/6.1#11588
wconti27 wants to merge 1 commit into
masterfrom
conti/feat/jakarta-servlet-6.0

Conversation

@wconti27
Copy link
Copy Markdown
Contributor

@wconti27 wconti27 commented Jun 6, 2026

Summary

Adds a new jakarta-servlet-6.0 instrumentation module (jakarta.servlet-api ≥ 6.0, muzzle range [6.0,)) that extends the existing jakarta-servlet-5.0 instrumentation with new APIs introduced in Servlet 6.0/6.1:

  • HttpServletRequest.getRequestId()http.request_id span tag
  • HttpServletRequest.getProtocolRequestId()network.protocol_request_id
  • HttpServletRequest.getServletConnection().getConnectionId()network.connection.id
  • HttpServletRequest.getServletConnection().getProtocol()network.protocol.name
  • HttpServletResponse.sendRedirect(String, int, boolean) — IAST UnvalidatedRedirectModule sink (Servlet 6.1 abstract)
  • HttpCookie.getAttribute("SameSite") / getAttribute("Partitioned") for cookie security attribute tracking

Test plan

  • ./gradlew :dd-java-agent:instrumentation:servlet:jakarta-servlet-6.0:test — all tests pass
  • Servlet60InstrumentationTest (JUnit 5) covers core span tag assertions
  • Servlet60IastInstrumentationTest uses AbstractInstrumentationTest to exercise the SendRedirect3ArgAdvice through real ByteBuddy advice wiring
  • latestDepTest picks up jakarta.servlet-api:6.+

Part of Spring Boot 4 support

This is one of several PRs adding Spring Boot 4 / Jakarta EE 11 support across the dd-trace-java instrumentation stack.

🤖 Generated with APM Instrumentation Toolkit

…vlet API 6.0/6.1

Adds a new jakarta-servlet-6.0 instrumentation module covering
jakarta.servlet-api 6.0 and later (muzzle range [6.0,)).

New APIs instrumented beyond the 5.0 module:
- HttpServletRequest.getRequestId() → http.request_id span tag
- HttpServletRequest.getProtocolRequestId() → network.protocol_request_id
- HttpServletRequest.getServletConnection().getConnectionId() → network.connection.id
- HttpServletRequest.getServletConnection().getProtocol() → network.protocol.name
- HttpServletResponse.sendRedirect(String, int, boolean) — IAST unvalidated-redirect sink
- HttpCookie.getAttribute("SameSite") / getAttribute("Partitioned") for cookie security attrs

Includes Servlet60InstrumentationTest (JUnit 5) and Servlet60IastInstrumentationTest
(ByteBuddy advice integration test via AbstractInstrumentationTest).

Updates metadata/supported-configurations.json and settings.gradle.kts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented Jun 6, 2026

❌ New Groovy Files Detected

Please avoid introducing new .groovy files to this repository.

  • dd-java-agent/instrumentation/servlet/jakarta-servlet-6.0/src/test/groovy/IastJakartaServletInstrumentationTest.groovy
  • dd-java-agent/instrumentation/servlet/jakarta-servlet-6.0/src/test/groovy/JakartaHttpServletRequestInstrumentationTest.groovy
  • dd-java-agent/instrumentation/servlet/jakarta-servlet-6.0/src/test/groovy/JakartaHttpServletResponseInstrumentationTest.groovy
  • dd-java-agent/instrumentation/servlet/jakarta-servlet-6.0/src/test/groovy/JakartaJspWriterCallsiteTest.groovy
  • dd-java-agent/instrumentation/servlet/jakarta-servlet-6.0/src/test/groovy/JakartaJspWriterFullDetectionCallsiteTest.groovy
  • dd-java-agent/instrumentation/servlet/jakarta-servlet-6.0/src/test/groovy/JakartaMultipartInstrumentationTest.groovy
  • dd-java-agent/instrumentation/servlet/jakarta-servlet-6.0/src/test/groovy/RumHttpServletResponseWrapperTest.groovy
  • dd-java-agent/instrumentation/servlet/jakarta-servlet-6.0/src/testFixtures/groovy/datadog/trace/instrumentation/servlet5/AsyncRumServlet.groovy
  • dd-java-agent/instrumentation/servlet/jakarta-servlet-6.0/src/testFixtures/groovy/datadog/trace/instrumentation/servlet5/RumServlet.groovy
  • dd-java-agent/instrumentation/servlet/jakarta-servlet-6.0/src/testFixtures/groovy/datadog/trace/instrumentation/servlet5/TestServlet5.groovy

Instead, rewrite the new file(s) in Java / JUnit. See the How to Test With JUnit Guide for more details.

If this PR needs an exception, add the tag: override-groovy-enforcement label to bypass this workflow.

@datadog-official
Copy link
Copy Markdown
Contributor

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 1 Pipeline job failed

Enforce Groovy Migration | Enforce Groovy migration   View in Datadog   GitHub Actions

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 8e2bd47 | Docs | Datadog PR Page | Give us feedback!

@wconti27 wconti27 closed this Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant