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

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

Conversation

yannickadam
Copy link
Contributor

@yannickadam yannickadam commented Sep 28, 2023

Motivation

To promote the support and usage of OpenTelemetry, the default propagatorTypes now include tracecontext in addition to Datadog.

Changes

While building the RUM configuration object, the SDK will now add both tracecontext and datadog as the default propagatorTypes when the allowedTracingURLs parameter does not contain the propagatorTypes parameter.

Testing

Initialize the SDK with the allowedTracingURLs, such as:

...
allowedTracingUrls: [/.*/]
...

Check in the network panel of your browser that the traceparent and x-datadog-* headers are added to every resource requested through fetch or XHR.

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@codecov-commenter
Copy link

codecov-commenter commented Sep 28, 2023

Codecov Report

Merging #2443 (83339e5) into prerelease-v5 (4196b47) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@              Coverage Diff               @@
##           prerelease-v5    #2443   +/-   ##
==============================================
  Coverage          93.34%   93.34%           
==============================================
  Files                223      223           
  Lines               6534     6535    +1     
  Branches            1432     1432           
==============================================
+ Hits                6099     6100    +1     
  Misses               435      435           
Files Coverage Δ
packages/rum-core/src/domain/configuration.ts 98.27% <100.00%> (+0.03%) ⬆️

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

@yannickadam yannickadam changed the title [RUM-1210] Change default propagator type to W3C tracecontext ✨ [RUM-1210] Add W3C tracecontext to default propagator types Oct 3, 2023
@yannickadam yannickadam marked this pull request as ready for review October 3, 2023 15:20
@yannickadam yannickadam requested a review from a team as a code owner October 3, 2023 15:20
@yannickadam yannickadam merged commit 4c7860f into prerelease-v5 Oct 4, 2023
@yannickadam yannickadam deleted the yannick.adam/RUM_1210_change_default_propagator_type_to_tracecontext branch October 4, 2023 09:52
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 <yannick.adam@datadoghq.com>

* 👌remove outdated comment

---------

Co-authored-by: Yannick Adam <yannick.adam@datadoghq.com>

* 💥 [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 <aymeric.mortemousque@datadoghq.com>

* 👌use trackResources/LongTasks directly from configuration

* 👌remove useless config copy

---------

Co-authored-by: Aymeric <aymeric.mortemousque@datadoghq.com>

* 💥 [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 <yannick.adam@datadoghq.com>
Co-authored-by: Aymeric <aymeric.mortemousque@datadoghq.com>
Co-authored-by: Aymeric <aymeric@mortemousque.com>
Comment on lines 62 to +64
expect(headers['x-datadog-trace-id']).toMatch(/\d+/)
expect(headers['x-datadog-origin']).toBe('rum')
expect(headers['traceparent']).toMatch(/^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-01$/)

Choose a reason for hiding this comment

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

A check on trace id would be nice that the trace id in traceparent and traceid is same

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 <yannick.adam@datadoghq.com>

* 👌remove outdated comment

---------

Co-authored-by: Yannick Adam <yannick.adam@datadoghq.com>

* 💥 [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 <aymeric.mortemousque@datadoghq.com>

* 👌use trackResources/LongTasks directly from configuration

* 👌remove useless config copy

---------

Co-authored-by: Aymeric <aymeric.mortemousque@datadoghq.com>

* 💥 [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 <yannick.adam@datadoghq.com>
Co-authored-by: Aymeric <aymeric.mortemousque@datadoghq.com>
Co-authored-by: Aymeric <aymeric@mortemousque.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants