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-5090] Collect resource protocol #3087

Merged
merged 5 commits into from
Oct 25, 2024

Conversation

RomanGaignault
Copy link
Contributor

@RomanGaignault RomanGaignault commented Oct 23, 2024

Motivation

Adding the network protocol information (e.g., http/1.1, h2) to resource events will provide deeper insights into how resources are fetched by the browser.

Changes

Utilized performanceTiming.nextHopProtocol to obtain the protocol information for same-origin requests.
Note: nextHopProtocol is only available for same-origin resources and might be restricted by the Timing-Allow-Origin header for cross-origin resources.

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@RomanGaignault RomanGaignault requested a review from a team as a code owner October 23, 2024 11:55
@RomanGaignault RomanGaignault marked this pull request as draft October 23, 2024 11:56
@codecov-commenter
Copy link

codecov-commenter commented Oct 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.21%. Comparing base (2fc52c9) to head (10cc941).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3087      +/-   ##
==========================================
- Coverage   93.68%   93.21%   -0.47%     
==========================================
  Files         276      276              
  Lines        7628     7631       +3     
  Branches     1712     1714       +2     
==========================================
- Hits         7146     7113      -33     
- Misses        482      518      +36     

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

Copy link

cit-pr-commenter bot commented Oct 23, 2024

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 161.36 KiB 161.46 KiB 102 B +0.06%
Logs 56.07 KiB 56.07 KiB 0 B 0.00%
Rum Slim 109.87 KiB 109.97 KiB 102 B +0.09%
Worker 25.21 KiB 25.21 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base Average Cpu Time (ms) Local Average Cpu Time (ms) 𝚫
addglobalcontext 0.002 0.002 -0.000
addaction 0.039 0.033 -0.006
addtiming 0.001 0.001 -0.000
adderror 0.042 0.031 -0.011
startstopsessionreplayrecording 1.194 0.977 -0.217
startview 1.320 1.000 -0.319
logmessage 0.021 0.019 -0.002
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 8.95 KiB 7.56 KiB -1420 B
addaction 40.47 KiB 38.29 KiB -2235 B
addtiming 7.01 KiB 6.09 KiB -941 B
adderror 44.93 KiB 43.13 KiB -1839 B
startstopsessionreplayrecording 5.53 KiB 5.66 KiB 138 B
startview 462.39 KiB 467.17 KiB 4.78 KiB
logmessage 40.20 KiB 39.73 KiB -490 B

🔗 RealWorld

@RomanGaignault RomanGaignault changed the title collect ressource protocol ✨[RUM-5090] collect ressource protocol Oct 23, 2024
@RomanGaignault RomanGaignault marked this pull request as ready for review October 23, 2024 12:10
@RomanGaignault RomanGaignault changed the title ✨[RUM-5090] collect ressource protocol ✨[RUM-5090] Collect ressource protocol Oct 23, 2024
Copy link
Member

@BenoitZugmeyer BenoitZugmeyer left a comment

Choose a reason for hiding this comment

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

You'll need to add that field in rum-events-format (around here), get it merged, run rum-events-format:sync in the SDK repo and update this PR

@@ -79,6 +79,7 @@ describe('resourceCollection', () => {
download: jasmine.any(Object),
first_byte: jasmine.any(Object),
status_code: 200,
request_protocol: 'HTTP/1.0',
Copy link
Member

Choose a reason for hiding this comment

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

💬 suggestion: ‏rename request_protocol to protocol, as it is not only the request protocol but also the response and everything around :)

Copy link
Member

@BenoitZugmeyer BenoitZugmeyer left a comment

Choose a reason for hiding this comment

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

Put it in staging before merging the PR, to make sure it works as expected there.

@RomanGaignault
Copy link
Contributor Author

/to-staging

dd-mergequeue bot added a commit that referenced this pull request Oct 24, 2024
Integrated commit sha: 86cfedc

Co-authored-by: roman.gaignault <roman.gaignault@datadoghq.com>
@dd-devflow
Copy link

dd-devflow bot commented Oct 24, 2024

🚂 Branch Integration: This commit was successfully integrated

Commit 86cfedc81b has been merged into staging-43 in merge commit 6e41e1c15a.

Check out the triggered pipeline on Gitlab 🦊

@DataDog DataDog deleted a comment from dd-devflow bot Oct 24, 2024
@RomanGaignault
Copy link
Contributor Author

/to-staging

@dd-devflow
Copy link

dd-devflow bot commented Oct 24, 2024

🚂 Branch Integration: starting soon, median merge time is 10m

Commit 10cc9416e0 will soon be integrated into staging-43.

Use /to-staging -c to cancel this operation!

dd-mergequeue bot added a commit that referenced this pull request Oct 24, 2024
Integrated commit sha: 10cc941

Co-authored-by: roman.gaignault <roman.gaignault@datadoghq.com>
@dd-devflow
Copy link

dd-devflow bot commented Oct 24, 2024

🚂 Branch Integration: This commit was successfully integrated

Commit 10cc9416e0 has been merged into staging-43 in merge commit 92887b842b.

Check out the triggered pipeline on Gitlab 🦊

Copy link
Contributor

@cy-moi cy-moi left a comment

Choose a reason for hiding this comment

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

Nice!

@RomanGaignault RomanGaignault merged commit 20faae1 into main Oct 25, 2024
20 checks passed
@RomanGaignault RomanGaignault deleted the romanG/collect-ressource-protocol branch October 25, 2024 09:47
cy-moi pushed a commit that referenced this pull request Oct 31, 2024
* collect ressource protocol

* update unit test

* changed request_protocol name to protocol

* format sync

* add protocol for xhr and fetch request
@RomanGaignault RomanGaignault changed the title ✨[RUM-5090] Collect ressource protocol ✨[RUM-5090] Collect resource protocol Nov 5, 2024
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