Repository navigation
Fix RUM injection for Jakarta servlets not extending HttpServlet - #13018
gh-worker-dd-mergequeue-cf854d[bot] merged 7 commits into
Conversation
The Jakarta RUM response wrapping only matched HttpServlet subclasses, so servlets implementing jakarta.servlet.Servlet directly, such as JSF's FacesServlet, never had the RUM SDK injected. Match every Servlet instead. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: pawelchcki <pawel.chcki@gmail.com>
|
Bits Code status: ✅ Done Comment @DataDog to request changes |
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
Co-authored-by: pawelchcki <pawel.chcki@gmail.com>
The "Enforce Groovy migration" check fails on newly added .groovy files. Move the fixture to src/testFixtures/java, keeping the same package and class names so the Tomcat test needs no change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: pawelchcki <pawel.chcki@gmail.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
More details
Static inspection supports the configuration-gated matcher: non-HttpServlet servlets become eligible for RUM wrapping, while RUM-disabled matching retains its previous scope. No concrete regression was established from the broader tracing advice raised in discussion.
🤖 Bits Code Review · Commit c50175c
When the marker is not found, the injecting writer still buffers the end of the response when service exits, and only the instrumentation's commit flushes it. The existing RUM tests close the writer, which commits too, so they could not detect a missing commit. Cover HttpServlet and non-HttpServlet servlets, with and without </head>. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: pawelchcki <pawel.chcki@gmail.com>
There was a problem hiding this comment.
More details
The separate RUM advice covers direct Servlet implementations and drains buffered responses independently of the HttpServlet-only tracing guard, preserving the tracing scope raised in the human discussion.
🤖 Bits Code Review · Commit cf4e308
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
amarziali
left a comment
There was a problem hiding this comment.
Thanks for the fix. Looks good for platform. You still need the approval of IDM
|
/merge |
|
View all feedbacks in Devflow UI.
It will be processed automatically as soon as GitHub reports it as mergeable. View in MergeQueue UI.
andrea.marziali@datadoghq.com unqueued this merge request |
|
@dougqh indeed the PR description was outdated thanks for having spotted it. I updated the PR to better reflect the situation and in a less verbose way. I think it's OK now |
|
/code blockers |
|
View all feedbacks in Devflow UI.
Detected 2 merge blocker(s) to address: 🟠 Pending
|
There was a problem hiding this comment.
More details
Static review supports the separate RUM nesting guard and response commit path preserving tracing ownership while covering non-HttpServlet implementations. No actionable defect was identified in wrapping, nested calls, async redispatch, or principal extraction.
🤖 Bits Code Review · Commit c0f4246
|
/merge -c |
|
View all feedbacks in Devflow UI.
|
|
/merge -c |
|
View all feedbacks in Devflow UI.
|
c0f4246 to
0b3780f
Compare
0b3780f to
d1361e9
Compare
There was a problem hiding this comment.
More details
Static review found no actionable defect in the servlet wrapping lifecycle, including nested-call ownership, buffered response draining, and async wrapper reuse. Runtime behavior remains unverified.
🤖 Bits Code Review · Commit d1361e9
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
What Does This Do
Fixes RUM auto-injection for Jakarta Servlet 5+ applications whose servlets do not extend
HttpServlet, including JSF'sFacesServlet.Moves RUM response wrapping into dedicated instrumentation covering all
jakarta.servlet.Servletimplementations. This broader matching is installed only when RUM injection is enabled. When RUM injection is disabled, the new instrumentation is disabled and servlet matching stays unchanged. The existing tracing instrumentation keeps its current matching behavior.Motivation
A customer reported that RUM injection worked on their landing page but was missing from JSF pages, despite those pages returning
text/html.Jakarta RUM wrapping previously depended on
HttpServlet.service(). Servlets such asFacesServlet, which implementServletdirectly, bypassed it.Additional Notes
Servlet.service(), preserving filter ordering and the existing principal-extraction behavior.HttpServletservlets do not interfere with tracing. Nested calls leave buffered output for the owning call to drain.</head>.javax.servletinstrumentation is unchanged.Regression coverage includes generic-servlet injection and content-type handling, complete responses with unclosed writers, nested calls, exception paths, async redispatch, and principal extraction.
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [RUMS-6411]
🤖 Generated with Claude Code (https://claude.com/claude-code)
PR by Bits - View session in Datadog
Comment @DataDog to request changes