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-2729] collect connectivity data #2560

Merged
merged 5 commits into from Jan 16, 2024
Merged

✨ [RUM-2729] collect connectivity data #2560

merged 5 commits into from Jan 16, 2024

Conversation

bcaudan
Copy link
Contributor

@bcaudan bcaudan commented Jan 9, 2024

Motivation

Collect connectivity data to provide more context on end user environment.

Changes

Collect when available:

  • status: connected | not_connected
  • interface: bluetooth | wifi | ...
  • effective_type: 2g | 3g | ...

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@bcaudan bcaudan force-pushed the bcaudan/connectivity branch 2 times, most recently from 34b9945 to 0baba70 Compare January 10, 2024 13:36
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (15293de) 92.84% compared to head (0baba70) 92.85%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2560      +/-   ##
==========================================
+ Coverage   92.84%   92.85%   +0.01%     
==========================================
  Files         228      229       +1     
  Lines        6719     6731      +12     
  Branches     1481     1484       +3     
==========================================
+ Hits         6238     6250      +12     
  Misses        481      481              

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

@bcaudan
Copy link
Contributor Author

bcaudan commented Jan 10, 2024

/to-staging

@dd-devflow
Copy link

dd-devflow bot commented Jan 10, 2024

🚂 Branch Integration: starting soon, merge in < 7m

Commit 0baba70447 will soon be integrated into staging-02.

This build is going to start soon! (estimated merge in less than 7m)

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

dd-mergequeue bot added a commit that referenced this pull request Jan 10, 2024
Co-authored-by: Bastien Caudan <bastien.caudan@datadoghq.com>
@dd-devflow
Copy link

dd-devflow bot commented Jan 10, 2024

🚂 Branch Integration: This commit was successfully integrated

Commit 0baba70447 has been merged into staging-02 in merge commit 0682e6189d.

Check out the triggered pipeline on Gitlab 🦊

@bcaudan bcaudan marked this pull request as ready for review January 10, 2024 14:58
@bcaudan bcaudan requested a review from a team as a code owner January 10, 2024 14:58
@bcaudan bcaudan merged commit 8fbbe0e into main Jan 16, 2024
17 checks passed
@bcaudan bcaudan deleted the bcaudan/connectivity branch January 16, 2024 08:45
@tarsojabbes
Copy link

Hey, @bcaudan, I was looking for someone using Network Information API and found out Datadog was doing something similar to what I'm working on. Your approach was quite the same as mine, except that I'm having trouble to access interface as it always returns undefined. Have you ever encountered problems like this with your solution? (Probably related to the experimental nature of this API). Also, it only collects network connectivity information in Chrome and Edge, right?

@bcaudan
Copy link
Contributor Author

bcaudan commented Mar 29, 2024

Hi @tarsojabbes,

Looking at the spec, there is no interface attribute, so not sure what you are trying to achieve exactly.
For browser support, you should probably check https://caniuse.com/?search=navigator.connection.

@tarsojabbes
Copy link

tarsojabbes commented Mar 29, 2024

Super thanks for your feedback!

My bad, when I said interface I was thinking about the navigator.connection.type, to catch if the user was using either wifi, cellular etc 😄 I also checked the link for Can I Use, it's really limited to a few browsers (I didn't know about this website, pretty handy btw), and now it makes a 100% sense that I'm getting undefined for navigator.connection.type

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.

None yet

4 participants