Repository navigation
RUM-18764: refactor(rum)!: use Browser SDK start/stop Resource APIs on WebGL - #336
Conversation
0f2769e to
bd878d1
Compare
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd878d1bbc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Failed manual WebGL resources leave their Browser SDK tracking state and start attributes retained until key reuse or session renewal, allowing memory to accumulate during repeated failures.
🤖 Bits Code Review · Commit bd878d1
Let Browser SDK time and assemble manual resources. Close failed WebGL resources before emitting a separate network error, matching Flutter Web and releasing the Browser SDK tracking entry. Keep start information for error attributes and serialize optional stop options in C#. Forward stop attributes through the worker's string error overload and remove the obsolete WebGL resource DTOs. Add direct lifecycle coverage for overlapping keys, event dates, long durations, and attribute merging. Gate WebGL trace checks and Android failure-time checks pending SDK fixes. BREAKING CHANGE: Remove the deprecated StopResource overload accepting an Exception; use StopResourceWithError instead. Remove the WebGL ResourceTracker helper and DatadogWebGLRum date-provider constructor. Failed manual WebGL resources now emit a resource event as well as a network error event; Android and iOS keep their error-only behavior.
bd878d1 to
29fa4a2
Compare
There was a problem hiding this comment.
More details
The WebGL bridge passed JavaScript syntax validation. Unity unit and player integration behavior remains unverified because the Unity toolchain is unavailable.
🤖 Bits Code Review · Commit 29fa4a2
There was a problem hiding this comment.
The PR adopts Browser SDK resource lifecycles on WebGL, forwards error attributes, and emits both resource and network-error events for failures. The latest commit avoids mutating caller dictionaries but introduces the sole open finding: a duplicate attributesJson declaration blocking WebGL compilation; Unity runtime validation remains unavailable.
🤖 Bits Code Review · Commit 20e826e
Co-authored-by: romanG <158156364+rgaignault@users.noreply.github.com>
20e826e to
7dd1624
Compare
There was a problem hiding this comment.
More details
Browser SDK lifecycle forwarding passed the specialist’s mocked bridge checks, with no reportable defects identified. Full Unity integration behavior remains unverified because Unity is unavailable.
🤖 Bits Code Review · Commit 7dd1624
|
This comment will be updated automatically if new data arrives. 🔗 Commit SHA: fac28ee | Docs | View more details | Give us feedback! |
What and why?
Use Browser SDK
startResource/stopResourceto time successful manual WebGL resources and build their events. ReplaceResourceTrackerwith a small map retaining the method, URL, and start attributes needed to report network errors. Remove the unused resource event DTOs and build stop options as JSON in C# to omit absent status, size, and context.Add dedicated direct API tests for two keys sharing a URL and completing in reverse order, start dates, nanosecond durations beyond Int32, method/type/status/size, and attribute merging. On failure, WebGL expects a resource event plus a network error; mobile expects only the network error.
Fix the worker proxy's
StopResourceWithError(key, errorType, errorMessage, attributes)overload to forwardattributesto theErrorInfooverload. Previously, attributes supplied through this string overload were silently dropped on every platform.The error-date assertion expects failure time. It is gated off on Android, with a TODO to remove the gate once the SDK pin includes Android PR #4151 (RUM-19988). The test waits 250 ms before reporting failure so a request-start timestamp falls outside the assertion's tolerance.
Breaking: failed manual WebGL resources now emit a resource event as well as the network error. Remove deprecated
StopResource(key, Exception, attributes)(useStopResourceWithError), the public WebGLResourceTrackerhelper, and theDatadogWebGLRum(IDateProvider)constructor.Comparison with Flutter Web
The successful-resource approach follows Flutter #957.
stopResourcebefore reporting the network error through the plugin'saddEvent. This releases Browser SDK tracking and emits both a resource event and a network error. Mobile SDKs keep their error-only behavior.Comparison with develop
Ran the copied resource tests and long-duration decoder on isolated
developat3922872, with temporary trace assertions and payload capture. No develop SDK changes.rule_psrlocationdd(wrong key)contextNeither captured WebGL version populates the expected
_dd.trace_id,_dd.span_id, or_dd.rule_psrfields. Trace, span, sampling-rate, and context-removal assertions are enabled on Android and iOS. They are gated only on WebGL, with a TODO to follow up with Browser SDK; Unity's previousddversus_ddmapping was already malformed, so I did not replicate it.Review checklist