Skip to content
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

💥 [RUMF-1589] automatically start recording #2275

Merged
merged 7 commits into from
Jun 5, 2023

Conversation

bcaudan
Copy link
Contributor

@bcaudan bcaudan commented May 30, 2023

Motivation

Avoid confusion between "sessions sampled for replay" and "sessions with replay attached" by recording replay by default for sessions sampled for replay.

Changes

  • automatically records sessions that are sampled for replay
  • introduction of startSessionReplayRecordingManually configuration parameter to opt out of automatic recordings

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

Copy link
Contributor Author

bcaudan commented May 30, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@codecov-commenter
Copy link

codecov-commenter commented May 30, 2023

Codecov Report

Merging #2275 (2084ec4) into prerelease-v5 (cf5f10e) will increase coverage by 0.15%.
The diff coverage is 100.00%.

@@                Coverage Diff                @@
##           prerelease-v5    #2275      +/-   ##
=================================================
+ Coverage          93.94%   94.10%   +0.15%     
=================================================
  Files                201      201              
  Lines               6028     6038      +10     
  Branches            1318     1319       +1     
=================================================
+ Hits                5663     5682      +19     
+ Misses               365      356       -9     
Impacted Files Coverage Δ
packages/rum-core/src/domain/configuration.ts 98.24% <ø> (ø)
packages/rum-core/src/boot/rumPublicApi.ts 92.07% <100.00%> (+0.68%) ⬆️
packages/rum/src/boot/recorderApi.ts 87.03% <100.00%> (-3.35%) ⬇️

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@bcaudan bcaudan force-pushed the bcaudan/v5-recording-auto-start branch 2 times, most recently from 9e3ec07 to 7d8c010 Compare May 31, 2023 16:30
@bcaudan bcaudan force-pushed the bcaudan/v5-recording-auto-start branch from 7d8c010 to 41ed23c Compare June 1, 2023 13:30
@bcaudan bcaudan force-pushed the bcaudan/v5-recording-auto-start branch from 41ed23c to 568cbca Compare June 1, 2023 13:46
@bcaudan bcaudan marked this pull request as ready for review June 1, 2023 14:01
@bcaudan bcaudan requested review from a team as code owners June 1, 2023 14:01
@@ -854,6 +856,33 @@ describe('rum public api', () => {
DefaultPrivacyLevel.MASK_USER_INPUT
)
})

it('api calls before init are performed after onRumStart', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice test!

packages/rum/src/boot/recorderApi.spec.ts Outdated Show resolved Hide resolved
@bcaudan
Copy link
Contributor Author

bcaudan commented Jun 5, 2023

/to-staging

@dd-devflow
Copy link

dd-devflow bot commented Jun 5, 2023

🚂 Branch Integration: starting soon, merge in < 0s

commit 2084ec4 will soon be integrated into staging-23.

This build is going to start soon! (estimated merge in less than 0s)

you can cancel this operation by commenting your pull request with /to-staging -c!

@dd-devflow
Copy link

dd-devflow bot commented Jun 5, 2023

🚂 Branch Integration: this commit was successfully integrated

commit 2084ec4 has been merged into staging-23

@dd-devflow dd-devflow bot added the staging-23 label Jun 5, 2023
@bcaudan bcaudan merged commit f875c2b into prerelease-v5 Jun 5, 2023
@bcaudan bcaudan deleted the bcaudan/v5-recording-auto-start branch June 5, 2023 12:25
bcaudan added a commit that referenced this pull request Jun 15, 2023
…aging-24

 pm_trace_id: 16846806
 feature_branch_pipeline_id: 16846806
 source: to-staging

* commit '1790641c80e4f8cf5d562f0ea944856f6bc72276':
  👌remove console override
  👌add test for all statuses/apis
  Remove error.origin
  Improve types
  💥[RUMF-1228] Remove console error message prefix (#2289)
  💥 [RUMF-1555] Rework logger context APIs (#2285)
  💥[RUMF-1152] sanitize resource method names (#2288)
  🔥 [RUMF-1555] Remove `startTime` in xhr start context (#2287)
  💥 [RUMF-1555] Remove `event` in action domain context (#2286)
  ♻️ Remove deprecated context manager APIs (#2284)
  💥 [RUMF-1589] automatically start recording (#2275)
  🐛 [RUMF-1499] Don't send duration for resources crossing a page frozen state (#2271)
  💥 [RUMF-1588] Update default session replay behaviour (#2257)
  💥 [RUMF-1587] Remove `premiumSampleRate` and `replaySampleRate` (#2256)
  💥 [RUMF-1554] Drop some deprecated public APIs (#2241)
  💥[RUMF-1554] Drop some deprecated config parameters (#2238)
  💥 Promote track frustration as default action behaviour (#2232)
bcaudan added a commit that referenced this pull request Jul 6, 2023
…nto staging-27

 pm_trace_id: 17523917
 feature_branch_pipeline_id: 17523917
 source: to-staging

* commit '11385ba83689c56a29da7f94922036d5a5a4487c':
  fix
  v5.0.0-alpha.0
  💥 [RUMF-1577] Stop collecting foreground periods (#2311)
  💥 [RUMF-1473] Ignore untrusted event (#2308)
  💥[RUMF-1564] remove intake subdomains (#2309)
  💥 beforeSend domain context: use PerformanceEntry (#2300)
  💥 Typings: consistent beforeSend return type (#2303)
  💥[RUMF-1230] Only apply main logger configuration to its own logs (#2298)
  💥[RUMF-1229] Logs: remove `error.origin` attribute (#2294)
  💥[RUMF-1228] Remove console error message prefix (#2289)
  💥 [RUMF-1555] Rework logger context APIs (#2285)
  💥[RUMF-1152] sanitize resource method names (#2288)
  🔥 [RUMF-1555] Remove `startTime` in xhr start context (#2287)
  💥 [RUMF-1555] Remove `event` in action domain context (#2286)
  ♻️ Remove deprecated context manager APIs (#2284)
  💥 [RUMF-1589] automatically start recording (#2275)
  🐛 [RUMF-1499] Don't send duration for resources crossing a page frozen state (#2271)
  💥 [RUMF-1588] Update default session replay behaviour (#2257)
  💥 [RUMF-1587] Remove `premiumSampleRate` and `replaySampleRate` (#2256)
  💥 [RUMF-1554] Drop some deprecated public APIs (#2241)
  💥[RUMF-1554] Drop some deprecated config parameters (#2238)
  💥 Promote track frustration as default action behaviour (#2232)
bcaudan added a commit that referenced this pull request Jul 20, 2023
 pm_trace_id: 18017467
 feature_branch_pipeline_id: 18017467
 source: to-staging

* commit '5bc99408ea1dffffedaf9e13facb23f14c1f0c0f':
  v5.0.0-alpha.0 (#2321)
  💥 [RUMF-1577] Stop collecting foreground periods (#2311)
  💥 [RUMF-1473] Ignore untrusted event (#2308)
  💥[RUMF-1564] remove intake subdomains (#2309)
  💥 beforeSend domain context: use PerformanceEntry (#2300)
  💥 Typings: consistent beforeSend return type (#2303)
  💥[RUMF-1230] Only apply main logger configuration to its own logs (#2298)
  💥[RUMF-1229] Logs: remove `error.origin` attribute (#2294)
  💥[RUMF-1228] Remove console error message prefix (#2289)
  💥 [RUMF-1555] Rework logger context APIs (#2285)
  💥[RUMF-1152] sanitize resource method names (#2288)
  🔥 [RUMF-1555] Remove `startTime` in xhr start context (#2287)
  💥 [RUMF-1555] Remove `event` in action domain context (#2286)
  ♻️ Remove deprecated context manager APIs (#2284)
  💥 [RUMF-1589] automatically start recording (#2275)
  🐛 [RUMF-1499] Don't send duration for resources crossing a page frozen state (#2271)
  💥 [RUMF-1588] Update default session replay behaviour (#2257)
  💥 [RUMF-1587] Remove `premiumSampleRate` and `replaySampleRate` (#2256)
  💥 [RUMF-1554] Drop some deprecated public APIs (#2241)
  💥[RUMF-1554] Drop some deprecated config parameters (#2238)
  💥 Promote track frustration as default action behaviour (#2232)
bcaudan added a commit that referenced this pull request Jul 24, 2023
…to staging-30

 pm_trace_id: 18134140
 feature_branch_pipeline_id: 18134140
 source: to-staging

* commit '0a071035d316ab4a89e7ce06c7e0182e51dd0ef3':
  v5.0.0-alpha.0 (#2321)
  💥 [RUMF-1577] Stop collecting foreground periods (#2311)
  💥 [RUMF-1473] Ignore untrusted event (#2308)
  💥[RUMF-1564] remove intake subdomains (#2309)
  💥 beforeSend domain context: use PerformanceEntry (#2300)
  💥 Typings: consistent beforeSend return type (#2303)
  💥[RUMF-1230] Only apply main logger configuration to its own logs (#2298)
  💥[RUMF-1229] Logs: remove `error.origin` attribute (#2294)
  💥[RUMF-1228] Remove console error message prefix (#2289)
  💥 [RUMF-1555] Rework logger context APIs (#2285)
  💥[RUMF-1152] sanitize resource method names (#2288)
  🔥 [RUMF-1555] Remove `startTime` in xhr start context (#2287)
  💥 [RUMF-1555] Remove `event` in action domain context (#2286)
  ♻️ Remove deprecated context manager APIs (#2284)
  💥 [RUMF-1589] automatically start recording (#2275)
  🐛 [RUMF-1499] Don't send duration for resources crossing a page frozen state (#2271)
  💥 [RUMF-1588] Update default session replay behaviour (#2257)
  💥 [RUMF-1587] Remove `premiumSampleRate` and `replaySampleRate` (#2256)
  💥 [RUMF-1554] Drop some deprecated public APIs (#2241)
  💥[RUMF-1554] Drop some deprecated config parameters (#2238)
  💥 Promote track frustration as default action behaviour (#2232)
amortemousque added a commit that referenced this pull request Sep 19, 2023
 pm_trace_id: 20186620
 feature_branch_pipeline_id: 20186620
 source: to-staging

* commit 'f69f12e544b6325b6a4977a2ffb9d66e8dd8a394':
  👷 fix merge
  ✨ [RUM-255] add allowUntrustedEvents config parameter (#2347)
  💥 [RUMF-1597] Drop `plan` and send `sampled_for_replay` (#2293)
  v5.0.0-alpha.0 (#2321)
  💥 [RUMF-1577] Stop collecting foreground periods (#2311)
  💥 [RUMF-1473] Ignore untrusted event (#2308)
  💥[RUMF-1564] remove intake subdomains (#2309)
  💥 beforeSend domain context: use PerformanceEntry (#2300)
  💥 Typings: consistent beforeSend return type (#2303)
  💥[RUMF-1230] Only apply main logger configuration to its own logs (#2298)
  💥[RUMF-1229] Logs: remove `error.origin` attribute (#2294)
  💥[RUMF-1228] Remove console error message prefix (#2289)
  💥 [RUMF-1555] Rework logger context APIs (#2285)
  💥[RUMF-1152] sanitize resource method names (#2288)
  🔥 [RUMF-1555] Remove `startTime` in xhr start context (#2287)
  💥 [RUMF-1555] Remove `event` in action domain context (#2286)
  ♻️ Remove deprecated context manager APIs (#2284)
  💥 [RUMF-1589] automatically start recording (#2275)
  🐛 [RUMF-1499] Don't send duration for resources crossing a page frozen state (#2271)
  💥 [RUMF-1588] Update default session replay behaviour (#2257)
  💥 [RUMF-1587] Remove `premiumSampleRate` and `replaySampleRate` (#2256)
  💥 [RUMF-1554] Drop some deprecated public APIs (#2241)
  💥[RUMF-1554] Drop some deprecated config parameters (#2238)
  💥 Promote track frustration as default action behaviour (#2232)
yannickadam added a commit that referenced this pull request Oct 3, 2023
 pm_trace_id: 20829111
 feature_branch_pipeline_id: 20829111
 source: to-staging

* commit '4196b47176ab4153b6dd6c64661272f3f299b9fc':
  Update lock file
  👷 fix merge
  ✨ [RUM-255] add allowUntrustedEvents config parameter (#2347)
  💥 [RUMF-1597] Drop `plan` and send `sampled_for_replay` (#2293)
  v5.0.0-alpha.0 (#2321)
  💥 [RUMF-1577] Stop collecting foreground periods (#2311)
  💥 [RUMF-1473] Ignore untrusted event (#2308)
  💥[RUMF-1564] remove intake subdomains (#2309)
  💥 beforeSend domain context: use PerformanceEntry (#2300)
  💥 Typings: consistent beforeSend return type (#2303)
  💥[RUMF-1230] Only apply main logger configuration to its own logs (#2298)
  💥[RUMF-1229] Logs: remove `error.origin` attribute (#2294)
  💥[RUMF-1228] Remove console error message prefix (#2289)
  💥 [RUMF-1555] Rework logger context APIs (#2285)
  💥[RUMF-1152] sanitize resource method names (#2288)
  🔥 [RUMF-1555] Remove `startTime` in xhr start context (#2287)
  💥 [RUMF-1555] Remove `event` in action domain context (#2286)
  ♻️ Remove deprecated context manager APIs (#2284)
  💥 [RUMF-1589] automatically start recording (#2275)
  🐛 [RUMF-1499] Don't send duration for resources crossing a page frozen state (#2271)
  💥 [RUMF-1588] Update default session replay behaviour (#2257)
  💥 [RUMF-1587] Remove `premiumSampleRate` and `replaySampleRate` (#2256)
  💥 [RUMF-1554] Drop some deprecated public APIs (#2241)
  💥[RUMF-1554] Drop some deprecated config parameters (#2238)
  💥 Promote track frustration as default action behaviour (#2232)
bcaudan added a commit that referenced this pull request Oct 9, 2023
 pm_trace_id: 21159925
 feature_branch_pipeline_id: 21159925
 source: to-staging

* commit '1a45207eb54828a9ae04a48d773416ec3d6d7e38':
  🐛 bridge action e2e: wait for click chain timeout (#2460)
  v4.50.1 (#2459)
  ✨ [RUM-1210] Add W3C tracecontext to default propagator types (#2443)
  Update lock file
  👷 fix merge
  ✨ [RUM-255] add allowUntrustedEvents config parameter (#2347)
  💥 [RUMF-1597] Drop `plan` and send `sampled_for_replay` (#2293)
  v5.0.0-alpha.0 (#2321)
  💥 [RUMF-1577] Stop collecting foreground periods (#2311)
  💥 [RUMF-1473] Ignore untrusted event (#2308)
  💥[RUMF-1564] remove intake subdomains (#2309)
  💥 beforeSend domain context: use PerformanceEntry (#2300)
  💥 Typings: consistent beforeSend return type (#2303)
  💥[RUMF-1230] Only apply main logger configuration to its own logs (#2298)
  💥[RUMF-1229] Logs: remove `error.origin` attribute (#2294)
  💥[RUMF-1228] Remove console error message prefix (#2289)
  💥 [RUMF-1555] Rework logger context APIs (#2285)
  💥[RUMF-1152] sanitize resource method names (#2288)
  🔥 [RUMF-1555] Remove `startTime` in xhr start context (#2287)
  💥 [RUMF-1555] Remove `event` in action domain context (#2286)
  ♻️ Remove deprecated context manager APIs (#2284)
  💥 [RUMF-1589] automatically start recording (#2275)
  🐛 [RUMF-1499] Don't send duration for resources crossing a page frozen state (#2271)
  💥 [RUMF-1588] Update default session replay behaviour (#2257)
  💥 [RUMF-1587] Remove `premiumSampleRate` and `replaySampleRate` (#2256)
  💥 [RUMF-1554] Drop some deprecated public APIs (#2241)
  💥[RUMF-1554] Drop some deprecated config parameters (#2238)
  💥 Promote track frustration as default action behaviour (#2232)
bcaudan added a commit that referenced this pull request Oct 9, 2023
* 💥 Promote track frustration as default action behaviour (#2232)

* 💥[RUMF-1554] Drop some deprecated config parameters (#2238)

* 💥 drop proxyUrl

* 💥 drop sampleRate

* 💥 drop allowedTracingOrigins

* 💥 drop tracingSampleRate

* 💥 drop trackInteractions

* 👌 typo

Co-authored-by: Yannick Adam <[email protected]>

* 👌remove outdated comment

---------

Co-authored-by: Yannick Adam <[email protected]>

* 💥 [RUMF-1554] Drop some deprecated public APIs (#2241)

* 💥 Drop removeUser

* 💥 Drop (Rum|Logger)GlobalContext APIs

* 💥 [RUMF-1587] Remove `premiumSampleRate` and `replaySampleRate` (#2256)

* 🔥 [RUMF-1587] Remove `premiumSampleRate` and `replaySampleRate`

* 👌 wording

Co-authored-by: Aymeric <[email protected]>

* 👌use trackResources/LongTasks directly from configuration

* 👌remove useless config copy

---------

Co-authored-by: Aymeric <[email protected]>

* 💥 [RUMF-1588] Update default session replay behaviour (#2257)

* 💥 update default sessionReplaySampleRate

* 💥 update default defaultPrivacyLevel

* tweak obfuscation scenarios

* 🐛 [RUMF-1499] Don't send duration for resources crossing a page frozen state (#2271)

* 💥 [RUMF-1589] automatically start recording (#2275)

* ♻️ buffer start/stop recorder API calls before init

* ✨add option to opt out of automatic recording

* 💥automatically start recording by default

* ♻️ cleanup scenarios using replay

* 👌fix test description

* ♻️ Remove deprecated context manager APIs (#2284)

* 💥 [RUMF-1555] Remove `event` in action domain context (#2286)

* 🔥 [RUMF-1555] Remove `startTime` in xhr start context (#2287)

* 💥[RUMF-1152] sanitize resource method names (#2288)

* 💥 [RUMF-1555] Rework logger context APIs (#2285)

* 💥[RUMF-1228] Remove console error message prefix (#2289)

* 💥[RUMF-1229] Logs: remove `error.origin` attribute (#2294)

* Improve types

* Remove error.origin

* 👌add test for all statuses/apis

* 👌remove console override

* 💥[RUMF-1230] Only apply main logger configuration to its own logs (#2298)

* 💥 add main logger context only to main logger logs

* 💥 apply main logger level only to main logger logs

* ♻️ merge logger context with message context in logger collection

* 💥 Typings: consistent beforeSend return type (#2303)

* 💥 beforeSend domain context: use PerformanceEntry (#2300)

* 💥[RUMF-1564] remove intake subdomains (#2309)

* 💥 [RUMF-1473] Ignore untrusted event (#2308)

* 💥 [RUMF-1577] Stop collecting foreground periods (#2311)

* v5.0.0-alpha.0 (#2321)

* 💥 [RUMF-1597] Drop `plan` and send `sampled_for_replay` (#2293)

* 🔥remove session plan

* ✨send `session.sampled_for_replay`

* 👷update sandbox

no need to start replay anymore

* ✨ [RUM-255] add allowUntrustedEvents config parameter (#2347)

* ♻️ remove track(Resources|LongTasks) from core configuration

* ✨add allowUntrustedEvents config param

* ✨addEventListener: take configuration.allowUntrustedEvents into account

* ♻️ propagate signature change

* update rum-events-format

* 👷 fix merge

* Update lock file

* ✨ [RUM-1210] Add W3C tracecontext to default propagator types (#2443)

* Ensure both Datadog and Tracecontext headers are present by default

* 🐛 bridge action e2e: wait for click chain timeout (#2460)

consistent failure on this test on firefox since the action behaviour update

---------

Co-authored-by: Yannick Adam <[email protected]>
Co-authored-by: Aymeric <[email protected]>
Co-authored-by: Aymeric <[email protected]>
bcaudan added a commit that referenced this pull request Oct 16, 2023
* 💥 Promote track frustration as default action behaviour (#2232)

* 💥[RUMF-1554] Drop some deprecated config parameters (#2238)

* 💥 drop proxyUrl

* 💥 drop sampleRate

* 💥 drop allowedTracingOrigins

* 💥 drop tracingSampleRate

* 💥 drop trackInteractions

* 👌 typo

Co-authored-by: Yannick Adam <[email protected]>

* 👌remove outdated comment

---------

Co-authored-by: Yannick Adam <[email protected]>

* 💥 [RUMF-1554] Drop some deprecated public APIs (#2241)

* 💥 Drop removeUser

* 💥 Drop (Rum|Logger)GlobalContext APIs

* 💥 [RUMF-1587] Remove `premiumSampleRate` and `replaySampleRate` (#2256)

* 🔥 [RUMF-1587] Remove `premiumSampleRate` and `replaySampleRate`

* 👌 wording

Co-authored-by: Aymeric <[email protected]>

* 👌use trackResources/LongTasks directly from configuration

* 👌remove useless config copy

---------

Co-authored-by: Aymeric <[email protected]>

* 💥 [RUMF-1588] Update default session replay behaviour (#2257)

* 💥 update default sessionReplaySampleRate

* 💥 update default defaultPrivacyLevel

* tweak obfuscation scenarios

* 🐛 [RUMF-1499] Don't send duration for resources crossing a page frozen state (#2271)

* 💥 [RUMF-1589] automatically start recording (#2275)

* ♻️ buffer start/stop recorder API calls before init

* ✨add option to opt out of automatic recording

* 💥automatically start recording by default

* ♻️ cleanup scenarios using replay

* 👌fix test description

* ♻️ Remove deprecated context manager APIs (#2284)

* 💥 [RUMF-1555] Remove `event` in action domain context (#2286)

* 🔥 [RUMF-1555] Remove `startTime` in xhr start context (#2287)

* 💥[RUMF-1152] sanitize resource method names (#2288)

* 💥 [RUMF-1555] Rework logger context APIs (#2285)

* 💥[RUMF-1228] Remove console error message prefix (#2289)

* 💥[RUMF-1229] Logs: remove `error.origin` attribute (#2294)

* Improve types

* Remove error.origin

* 👌add test for all statuses/apis

* 👌remove console override

* 💥[RUMF-1230] Only apply main logger configuration to its own logs (#2298)

* 💥 add main logger context only to main logger logs

* 💥 apply main logger level only to main logger logs

* ♻️ merge logger context with message context in logger collection

* 💥 Typings: consistent beforeSend return type (#2303)

* 💥 beforeSend domain context: use PerformanceEntry (#2300)

* 💥[RUMF-1564] remove intake subdomains (#2309)

* 💥 [RUMF-1473] Ignore untrusted event (#2308)

* 💥 [RUMF-1577] Stop collecting foreground periods (#2311)

* v5.0.0-alpha.0 (#2321)

* 💥 [RUMF-1597] Drop `plan` and send `sampled_for_replay` (#2293)

* 🔥remove session plan

* ✨send `session.sampled_for_replay`

* 👷update sandbox

no need to start replay anymore

* ✨ [RUM-255] add allowUntrustedEvents config parameter (#2347)

* ♻️ remove track(Resources|LongTasks) from core configuration

* ✨add allowUntrustedEvents config param

* ✨addEventListener: take configuration.allowUntrustedEvents into account

* ♻️ propagate signature change

* update rum-events-format

* 👷 fix merge

* Update lock file

* ✨ [RUM-1210] Add W3C tracecontext to default propagator types (#2443)

* Ensure both Datadog and Tracecontext headers are present by default

* Update READMEs for v5

---------

Co-authored-by: Yannick Adam <[email protected]>
Co-authored-by: Aymeric <[email protected]>
Co-authored-by: Aymeric <[email protected]>
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