-
Notifications
You must be signed in to change notification settings - Fork 14
Add RUM_INJECTION scenario to test Real User Monitoring SDK injection #5813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
Co-authored-by: Charles de Beauchesne <[email protected]>
amarziali
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s expected that the Java RUM injection will not send the Content-Type header when the injection is enabled and the MIME type is text/html. Because the Java RUM injector does not buffer the response, it cannot know in advance whether injection will occur. For this reason, it prevents the Content-Length header from being set, which forces the response to use chunked transfer encoding. This behavior is as designed. I believe a dedicated scenario should be created for this set of tests.
Motivation
RUM (Real User Monitoring) auto-injection is a tracer feature that automatically injects the RUM SDK script into HTML responses served by instrumented applications. This allows frontend monitoring to be enabled without requiring manual code changes in the application.
Until now, system-tests had no way to validate this functionality because:
https://docs.datadoghq.com/real_user_monitoring/application_monitoring/browser/setup/server/java/
Related with this draft PR: https://github.com/DataDog/system-tests/pull/5809/files
Changes
New /html endpoint:
Introduces an HTML controller to the Java Spring Boot weblog. This is the first endpoint in system-tests that serves rendered HTML content (via Thymeleaf templates) rather than JSON responses. This pattern can be extended to other weblogs as needed.
New RUM_INJECTION scenario:
A dedicated end-to-end scenario that enables RUM injection via environment variables:
Test validations:
✅ HTML response is well-formed
✅ RUM SDK script (datadoghq-browser-agent.com/datadog-rum-v*) is injected
✅ RUM initialization call (window.DD_RUM.init) is present
The new scenario is not added to the CI yet.
Workflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
[<language>], double-check that only<language>is impacted by the changebuild-XXX-imagelabel is present