Skip to content

🐛 [RUM-5645] Add a ff to avoid using "fetch keepalive" #3640

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rgaignault
Copy link
Contributor

@rgaignault rgaignault commented Jun 17, 2025

Motivation

Currently, the Browser SDK uses fetch keepalive to send data to Datadog when it is supported (see code).

Because browsers enforce a limit on the amount of data that can be sent by “fetch keepalive” requests at the same time, it can impact some websites when it also use “fetch keepalive”

Changes

We could avoid using fetch keepalive to send data to Datadog when the page is sending request. For the moment we want to test it with a a feature flag

Test instructions

Checklist

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

@rgaignault rgaignault requested a review from a team as a code owner June 17, 2025 11:31
@rgaignault rgaignault force-pushed the romanG/avoid-keepalive-when-page-not-exiting branch from 179593e to d4c9d08 Compare June 17, 2025 11:33
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.23%. Comparing base (3c18298) to head (d4c9d08).
Report is 61 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3640   +/-   ##
=======================================
  Coverage   92.22%   92.23%           
=======================================
  Files         313      313           
  Lines        8041     8044    +3     
  Branches     1815     1816    +1     
=======================================
+ Hits         7416     7419    +3     
  Misses        625      625           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

})

it('should use regular fetch (without keepalive) when feature flag is enabled', async () => {
addExperimentalFeatures([ExperimentalFeature.AVOID_FETCH_KEEPALIVE])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: just use mockExperimentalFeatures, so you don't need to reset them

@rgaignault
Copy link
Contributor Author

/to-staging

@dd-devflow
Copy link
Contributor

dd-devflow bot commented Jul 3, 2025

View all feedbacks in Devflow UI.

2025-07-03 11:03:06 UTC ℹ️ Start processing command /to-staging


2025-07-03 11:03:13 UTC ℹ️ Branch Integration: starting soon, merge expected in approximately 10m48s (p90)

Commit d4c9d08886 will soon be integrated into staging-27.


2025-07-03 11:16:06 UTC ℹ️ Branch Integration: This commit was successfully integrated

Commit d4c9d08886 has been merged into staging-27 in merge commit b6272ddf00.

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-27

dd-mergequeue bot added a commit that referenced this pull request Jul 3, 2025
…taging-27

Integrated commit sha: d4c9d08

Co-authored-by: rgaignault <[email protected]>
@dd-devflow dd-devflow bot added the staging-27 label Jul 3, 2025
@rgaignault rgaignault changed the title 🐛 [RUM-5645] Add a ff to avoid using "fetch keepalive" for retry 🐛 [RUM-5645] Add a ff to avoid using "fetch keepalive" Jul 3, 2025
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