-
Notifications
You must be signed in to change notification settings - Fork 44
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: Origin of agent webpack chunks now changeable #659
Conversation
Asset Size Report
Merging this pull request will result in the following asset size changes:
|
Codecov Report
@@ Coverage Diff @@
## main #659 +/- ##
==========================================
+ Coverage 86.63% 86.76% +0.13%
==========================================
Files 135 136 +1
Lines 5251 5273 +22
Branches 720 724 +4
==========================================
+ Hits 4549 4575 +26
+ Misses 641 635 -6
- Partials 61 63 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 5 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Co-authored-by: Jordan Porter <[email protected]>
I think we need to regroup on the config values and implementation of this. We will likely actually need a new property for both values (something like init.proxy.beacon, init.proxy.assets) instead of overwriting beacon/errorBeacon. This will be necessary for compatibility/sanity with customers reverting back to the standard beacon values in the DB (once those have been changed to a custom value, theres no easy way to get the initial value back for the customer). I also can't help but feel in combination with #673 that we may be over-engineering all these url checks. The combo of those 2 PRs is growing the lite build by more than 5%, for something that should be relatively benign (just adding a property and overwriting the beacon and asset values if set) and unused by the large majority of customers. Validating the url could likely be accomplished by good docs to follow and less by hard-coding checks and parsing all over the agent so we should circle back on this as well. |
Reworked: validations removed and the input moved to a new object in the init config. |
Allow the agent to operate through a proxy. The agent needs to be able to fetch its source code and send analytics to a different domain, and this solves the former. NPM is not affected.
Overview
In support of NR-152264 / Proxy Support, a configuration has been exposed that will change where the agent chunk is loaded from. In context, our default domain
js-agent.newrelic.com
is on many ad blocker list today which prevent us from collecting data from end users. The use case here is to circumvent that block by using a proxy to fetch agent assets. (The beacon can also be changed so that analytics data flow throw another--or the same--proxy server.)Note that this applies to agent pulled from the CDN (installation methods: copy+paste or APM-injected). Agent installed via NPM should not be affected by this change, as it's irrelevant.
Related Issue(s)
NR-149705
Testing
Existing CDN / NPM agent tests ensure new code does not break default functionality. New e2e has been added that tests the chunk source switching behavior.
UPDATE: this has been merged with #673 .