Skip to content

🐛[RUM-11247] Pass down error stack to isAllowedTrackingOrigins#3824

Merged
dd-mergequeue[bot] merged 27 commits intomainfrom
beltran.bulbarella/RUM-11247_2
Sep 25, 2025
Merged

🐛[RUM-11247] Pass down error stack to isAllowedTrackingOrigins#3824
dd-mergequeue[bot] merged 27 commits intomainfrom
beltran.bulbarella/RUM-11247_2

Conversation

@BeltranBulbarellaDD
Copy link
Contributor

@BeltranBulbarellaDD BeltranBulbarellaDD commented Sep 5, 2025

Motivation

Currently there are 9 function calls before isAllowedTrackingOrigins. Chrome passes the first 9, so if we were to add 1 more function call before, we would never get the extension prefix in the stack

Changes

Created the error stack in makeRumPublicApi and makeLogsPublicApi and passed it down to isAllowedTrackingOrigins function.

(First error is the new stack, second error is the previous stack)
Screenshot 2025-09-10 at 18 03 56

Test instructions

Use the dev extension and inject it in localHost:8080 while running the local SDK. If you print the error stack that isAllowedTrackingOrigins receives now and print a new error stack below it should be the same as the image above. We should see the error stack in a different location, closer to the top.

Also, to test the new detection logic. Go to a page that uses RUM, and install a browser extension, use the Local SDK on the page. Without this PR you should see the WARN_DOES_NOT_HAVE_ALLOWED_TRACKING_ORIGIN now you should see SDK is loaded more than once. This is unsupported and might have unexpected behavior.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Sep 5, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage
Patch Coverage: 95.00%
Total Coverage: 92.52% (-0.00%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: e31f5cb | Docs | Was this helpful? Give us feedback!

@cit-pr-commenter
Copy link

cit-pr-commenter bot commented Sep 8, 2025

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 161.50 KiB 161.63 KiB +127 B +0.08%
Rum Recorder 19.43 KiB 19.43 KiB 0 B 0.00%
Rum Profiler 5.32 KiB 5.32 KiB 0 B 0.00%
Logs 55.76 KiB 55.88 KiB +123 B +0.22%
Flagging 944 B 944 B 0 B 0.00%
Rum Slim 119.16 KiB 119.29 KiB +127 B +0.10%
Worker 23.60 KiB 23.60 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫 (%)
RUM - add global context 0.0061 0.0067 +9.84%
RUM - add action 0.0208 0.0208 0.00%
RUM - add error 0.0173 0.0199 +15.03%
RUM - add timing 0.0058 0.005 -13.79%
RUM - start view 0.0066 0.0059 -10.61%
RUM - start/stop session replay recording 0.001 0.0012 +20.00%
Logs - log message 0.0227 0.024 +5.73%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 24.80 KiB 25.58 KiB +793 B
RUM - add action 44.63 KiB 46.51 KiB +1.88 KiB
RUM - add timing 25.11 KiB 25.03 KiB -80 B
RUM - add error 49.74 KiB 50.57 KiB +856 B
RUM - start/stop session replay recording 23.72 KiB 23.23 KiB -502 B
RUM - start view 421.77 KiB 429.06 KiB +7.29 KiB
Logs - log message 87.60 KiB 91.50 KiB +3.90 KiB

🔗 RealWorld

@BeltranBulbarellaDD BeltranBulbarellaDD force-pushed the beltran.bulbarella/RUM-11247_2 branch from cbf7b31 to 5844f86 Compare September 8, 2025 11:36
@BeltranBulbarellaDD BeltranBulbarellaDD marked this pull request as ready for review September 10, 2025 16:03
@BeltranBulbarellaDD BeltranBulbarellaDD requested a review from a team as a code owner September 10, 2025 16:03
@BeltranBulbarellaDD BeltranBulbarellaDD marked this pull request as draft September 10, 2025 16:06
@BeltranBulbarellaDD BeltranBulbarellaDD marked this pull request as ready for review September 11, 2025 07:00
@BeltranBulbarellaDD
Copy link
Contributor Author

/to-staging

@dd-devflow-routing-codex
Copy link

dd-devflow-routing-codex bot commented Sep 24, 2025

View all feedbacks in Devflow UI.

2025-09-24 12:37:17 UTC ℹ️ Start processing command /to-staging


2025-09-24 12:37:25 UTC ℹ️ Branch Integration: starting soon, merge expected in approximately 23m (p90)

Commit e31f5cb6e9 will soon be integrated into staging-39.


2025-09-24 12:59:18 UTC ℹ️ Branch Integration: this commit was successfully integrated

Commit e31f5cb6e9 has been merged into staging-39 in merge commit 077c92b6db.

Check out the triggered pipeline on Gitlab 🦊

If you need to revert this integration, you can use the following command: /code revert-integration -b staging-39

dd-mergequeue bot added a commit that referenced this pull request Sep 24, 2025
Integrated commit sha: e31f5cb

Co-authored-by: BeltranBulbarellaDD <beltran.bulbarella@datadoghq.com>
@BeltranBulbarellaDD
Copy link
Contributor Author

/merge

@dd-devflow-routing-codex
Copy link

dd-devflow-routing-codex bot commented Sep 25, 2025

View all feedbacks in Devflow UI.

2025-09-25 07:04:28 UTC ℹ️ Start processing command /merge


2025-09-25 07:04:33 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 35m (p90).


2025-09-25 07:29:21 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue dd-mergequeue bot merged commit 3415c80 into main Sep 25, 2025
22 checks passed
@dd-mergequeue dd-mergequeue bot deleted the beltran.bulbarella/RUM-11247_2 branch September 25, 2025 07:29
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.

4 participants