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

feat: Update agent internals in early preparation for new features #532

Merged
merged 111 commits into from
May 24, 2023

Conversation

metal-messiah
Copy link
Member

@metal-messiah metal-messiah commented May 16, 2023

The agent code base now contains the non-functional foundations of session replay mechanics. Note that this code is dormant and disabled. It will not download or execute until the session replay feature and its downstream dependencies are in a finished state.

Overview

This PR contains internal changes to support upcoming features, and introduces some [WIP] feature modules. These modules will not be included in any agent builds until a complete UX is designed and implemented.

Important notes:

  • The feature will not run, as it is not included in the CDN loader classes. Also -- For future privacy considerations for customers, this feature will only download and execute any recording code AFTER a check for customer entitlements and enablement has been conducted on the backend. This means that the recoding functionality will have a slight delay from the beginning of the page lifecycle, and could theoretically miss recording something very early in the lifecycle of the page. This is a known and acknowledged risk, which is outweighed by privacy considerations.
  • The entitlement check has been mocked in the local test server as sr: 1.
  • As of today, the sampling decision is rolled locally for both error and full replay states. This may change in future states.

Related Issue(s)

Testing

Testing has not been adapted to this feature yet. Along with the tests themselves, testing architecture needs to be added to support this feature, namely mock route handling for the /blob endpoint.

@metal-messiah
Copy link
Member Author

metal-messiah commented May 21, 2023

Passing test with testing architecture changes --> https://github.com/newrelic/newrelic-browser-agent/actions/runs/5040202999

Workers run on cron job
Browser tests are pre-built w/ webpack to avoid the tree-shaking issue with browserify. This increases test run speed by more than 6x

@metal-messiah metal-messiah marked this pull request as ready for review May 21, 2023 23:42
@metal-messiah metal-messiah changed the title chore: Session Replay basics feat: Update agent internals in early preparation for new features May 23, 2023
src/features/session_replay/aggregate/index.js Outdated Show resolved Hide resolved
Copy link
Contributor

@patrickhousley patrickhousley left a comment

Choose a reason for hiding this comment

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

Verified the session replay feature does not load in the agent.

@metal-messiah
Copy link
Member Author

@metal-messiah metal-messiah merged commit 1ee675d into main May 24, 2023
@metal-messiah metal-messiah deleted the rrweb-investigation branch May 24, 2023 14:46
bjfield pushed a commit that referenced this pull request May 26, 2023
* Capture metrics for usage of MooTools and certain polyfills (#539) (903a7e1)

* Update agent internals in early preparation for new features (#532) (1ee675d)

* Address "configurable" warnings arising from user-agent module (#546) (7a7dace)

* Ensure runtime is preserved for late-configuration cases (#538) (229b8ed)

* Refactor usage of Array.from to address MooTools conflict (#544) (f1e6336)
metal-messiah pushed a commit that referenced this pull request Jun 5, 2023
* Capture metrics for usage of MooTools and certain polyfills (#539) (903a7e1)

* Update agent internals in early preparation for new features (#532) (1ee675d)

* Address "configurable" warnings arising from user-agent module (#546) (7a7dace)

* Ensure runtime is preserved for late-configuration cases (#538) (229b8ed)

* Refactor usage of Array.from to address MooTools conflict (#544) (f1e6336)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
large Large Engineering Effort MMF Work directly planned for in an MMF
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants