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: Stop reporting ajax events going to same beacon #609

Merged
merged 10 commits into from
Jul 27, 2023

Conversation

cwli24
Copy link
Contributor

@cwli24 cwli24 commented Jul 5, 2023

Network requests made to the same hostname as the agent's reporting beacon endpoint are no longer captured, by default. As an example, outgoing XHRs to the bam.nr-data.net URL where analytic data is typically sent would not reflectively record itself.

Overview

Primary purpose is to make "internal URL" reporting dynamic, so that when the beacon url is changed each time, the deny_list setting doesn't also have to change to retain the block. In other words, it's no longer necessary to include bam-cell.nr-data.net, etc. in the deny_list to prevent agent from reporting its own generated traffic by simply toggling the flag.

This also helps facilitate users who don't care about the agent's own reporting from showing on their NR1 dashboard and from being billed for such data.

Related Issue(s)

NR-99149, NR-136392
Bug: NR-140471

Testing

Verify that ajax events are not sent for network requests going to any domain that info.beacon or info.errorBeacon is also set to, when init.ajax.block_internal = true (default), but they then are when the flag is flipped to be false.

Also check that whether the initial init.ajax.deny_list is undefined or a preset list doesn't affect this behavior.

@cwli24 cwli24 added enhancement New feature or request small Small Engineering Effort MMF Work directly planned for in an MMF impact data safe to test labels Jul 5, 2023
@github-actions
Copy link

github-actions bot commented Jul 10, 2023

Static Badge

Last ran on July 27, 2023 13:36:39 CDT
Checking merge of (a12f61f) into main (d616f64)

@github-actions
Copy link

github-actions bot commented Jul 10, 2023

Asset Size Report

Merging this pull request will result in the following CDN asset size changes:

Asset Name Previous Size New Size Diff
nr-loader-spa.min 51.04 kB / 17.13 kB (gzip) 51.18 kB / 17.19 kB (gzip) +0.27% / +0.32% (gzip)
nr-loader-full.min 44.61 kB / 15.19 kB (gzip) 44.75 kB / 15.25 kB (gzip) +0.31% / +0.39% (gzip)
nr-loader-rum.min 27.84 kB / 9.92 kB (gzip) 27.98 kB / 9.97 kB (gzip) +0.5% / +0.55% (gzip)
nr-loader-spa-polyfills.min 124.47 kB / 39.47 kB (gzip) 124.77 kB / 39.6 kB (gzip) +0.24% / +0.32% (gzip)
nr-loader-full-polyfills.min 116.46 kB / 37.36 kB (gzip) 116.76 kB / 37.49 kB (gzip) +0.26% / +0.34% (gzip)
nr-loader-rum-polyfills.min 96.45 kB / 31.59 kB (gzip) 96.75 kB / 31.71 kB (gzip) +0.31% / +0.41% (gzip)
nr-loader-worker.min 41.17 kB / 13.92 kB (gzip) 41.31 kB / 13.97 kB (gzip) +0.34% / +0.38% (gzip)

Merging this pull request will result in the following NPM package consumer size changes:

Asset Name Previous Size New Size Diff
Browser Agent 51.18 kB / 17.04 kB (gzip) 51.32 kB / 17.09 kB (gzip) +0.27% / +0.32% (gzip)
Custom Lite Agent 27.99 kB / 9.85 kB (gzip) 28.13 kB / 9.91 kB (gzip) +0.5% / +0.55% (gzip)
Custom Pro Agent 44.66 kB / 15.02 kB (gzip) 44.8 kB / 15.08 kB (gzip) +0.31% / +0.37% (gzip)
Custom SPA Agent 51.06 kB / 17 kB (gzip) 51.2 kB / 17.05 kB (gzip) +0.27% / +0.34% (gzip)
Worker Agent 304.66 kB / 94.19 kB (gzip) 304.86 kB / 94.29 kB (gzip) +0.07% / +0.11% (gzip)
Other Standard CDN Assets

Released Assets

Asset Name Asset Size
recorder.1b18459f.min.js 166.07 kB / 52.32 kB (gzip)
spa-aggregate.8f3e40eb.min.js 20.93 kB / 7.42 kB (gzip)
page_view_timing-aggregate.cadb6112.min.js 14.97 kB / 5.43 kB (gzip)
860.e349dcb2.min.js 14.09 kB / 5.27 kB (gzip)
session_trace-aggregate.ad30378e.min.js 12.24 kB / 4.53 kB (gzip)
page_view_event-aggregate.c8b08262.min.js 11.1 kB / 4.19 kB (gzip)
jserrors-aggregate.8d5a5045.min.js 9.55 kB / 3.65 kB (gzip)
metrics-aggregate.4a42050e.min.js 8.56 kB / 2.93 kB (gzip)
646.8621d5a1.min.js 7.97 kB / 3.36 kB (gzip)
session_replay-aggregate.d194df74.min.js 7.97 kB / 2.93 kB (gzip)
ajax-aggregate.70d0e393.min.js 7.13 kB / 3.06 kB (gzip)
compressor.ae9f91a8.min.js 7.09 kB / 3.57 kB (gzip)
page_action-aggregate.b9750214.min.js 4.73 kB / 1.92 kB (gzip)
async-api.b23990ec.min.js 2.69 kB / 1.38 kB (gzip)
session-manager.2a64278a.min.js 1.47 kB / 740 B (gzip)
lazy-feature-loader.94d9d1a8.min.js 1.17 kB / 498 B (gzip)

Built Assets

Asset Name Asset Size
recorder.643cfeda.min.js 166.33 kB / 52.44 kB (gzip)
spa-aggregate.495db083.min.js 20.96 kB / 7.45 kB (gzip)
page_view_timing-aggregate.d72a908a.min.js 14.99 kB / 5.44 kB (gzip)
860.8fec16f2.min.js 14.09 kB / 5.27 kB (gzip)
session_trace-aggregate.2137f2a6.min.js 12.24 kB / 4.53 kB (gzip)
page_view_event-aggregate.e765729e.min.js 11.12 kB / 4.19 kB (gzip)
jserrors-aggregate.f8100d3b.min.js 9.55 kB / 3.65 kB (gzip)
metrics-aggregate.0d982f48.min.js 8.56 kB / 2.93 kB (gzip)
646.a8872fbe.min.js 7.97 kB / 3.36 kB (gzip)
session_replay-aggregate.948ed12b.min.js 7.97 kB / 2.93 kB (gzip)
ajax-aggregate.629e6d59.min.js 7.19 kB / 3.1 kB (gzip)
compressor.772ac1fe.min.js 7.09 kB / 3.57 kB (gzip)
page_action-aggregate.636893b0.min.js 4.73 kB / 1.92 kB (gzip)
async-api.eaff3276.min.js 2.69 kB / 1.38 kB (gzip)
session-manager.22036a2b.min.js 1.47 kB / 742 B (gzip)
lazy-feature-loader.d2774909.min.js 1.17 kB / 498 B (gzip)
Other Polyfill CDN Assets

Released Assets

Asset Name Asset Size
recorder.1b18459f-es5.min.js 166.76 kB / 52.35 kB (gzip)
nr-polyfills.min.js 52.15 kB / 17.95 kB (gzip)
session_trace-aggregate.9e80b0c8-es5.min.js 32.26 kB / 8.5 kB (gzip)
compressor.79fb47d9-es5.min.js 30.02 kB / 11.29 kB (gzip)
spa-aggregate.6fca7999-es5.min.js 24.02 kB / 8.11 kB (gzip)
session_replay-aggregate.a65bc615-es5.min.js 19.27 kB / 6.54 kB (gzip)
page_view_timing-aggregate.7bce32b5-es5.min.js 18.67 kB / 6.17 kB (gzip)
173.71bbedb0-es5.min.js 17.41 kB / 6.14 kB (gzip)
page_view_event-aggregate.7a2d4522-es5.min.js 12.64 kB / 4.8 kB (gzip)
jserrors-aggregate.51a9defc-es5.min.js 12.33 kB / 4.4 kB (gzip)
ajax-aggregate.740e379d-es5.min.js 10.58 kB / 3.78 kB (gzip)
385.b201f8ff-es5.min.js 10.47 kB / 4.18 kB (gzip)
metrics-aggregate.443bcd71-es5.min.js 9.91 kB / 3.35 kB (gzip)
page_action-aggregate.a6f70ea3-es5.min.js 7.33 kB / 2.64 kB (gzip)
async-api.a6d107e3-es5.min.js 3.84 kB / 1.89 kB (gzip)
session-manager.ae4f9cf3-es5.min.js 1.7 kB / 785 B (gzip)
lazy-feature-loader.60c98be9-es5.min.js 1.2 kB / 509 B (gzip)

Built Assets

Asset Name Asset Size
recorder.643cfeda-es5.min.js 167.03 kB / 52.48 kB (gzip)
nr-polyfills.min.js 52.26 kB / 18.01 kB (gzip)
session_trace-aggregate.c02f2a42-es5.min.js 32.26 kB / 8.5 kB (gzip)
compressor.5b9c7398-es5.min.js 30.02 kB / 11.29 kB (gzip)
session_replay-aggregate.6c0aba07-es5.min.js 19.27 kB / 6.54 kB (gzip)
page_view_timing-aggregate.3d86db09-es5.min.js 18.68 kB / 6.17 kB (gzip)
spa-aggregate.1f73f06f-es5.min.js 17.77 kB / 6.14 kB (gzip)
173.3788d9f7-es5.min.js 17.41 kB / 6.14 kB (gzip)
page_view_event-aggregate.e71662d2-es5.min.js 12.65 kB / 4.8 kB (gzip)
jserrors-aggregate.2883be04-es5.min.js 12.33 kB / 4.4 kB (gzip)
385.6d401e84-es5.min.js 10.47 kB / 4.18 kB (gzip)
metrics-aggregate.c4251142-es5.min.js 9.91 kB / 3.35 kB (gzip)
945.d2c7843e-es5.min.js 7.51 kB / 2.72 kB (gzip)
page_action-aggregate.087bc19b-es5.min.js 7.33 kB / 2.64 kB (gzip)
ajax-aggregate.d44e21ef-es5.min.js 4.35 kB / 2.07 kB (gzip)
async-api.bb0e3099-es5.min.js 3.84 kB / 1.89 kB (gzip)
session-manager.618cfdd6-es5.min.js 1.7 kB / 783 B (gzip)
lazy-feature-loader.c4f55624-es5.min.js 1.22 kB / 514 B (gzip)

@cwli24
Copy link
Contributor Author

cwli24 commented Jul 10, 2023

@codecov
Copy link

codecov bot commented Jul 17, 2023

Codecov Report

Merging #609 (a12f61f) into main (d616f64) will increase coverage by 1.02%.
The diff coverage is 83.33%.

@@            Coverage Diff             @@
##             main     #609      +/-   ##
==========================================
+ Coverage   66.67%   67.69%   +1.02%     
==========================================
  Files         130      130              
  Lines        6008     6012       +4     
  Branches     1139     1149      +10     
==========================================
+ Hits         4006     4070      +64     
+ Misses       1639     1595      -44     
+ Partials      363      347      -16     
Flag Coverage Δ
integration-tests 82.85% <91.66%> (+0.69%) ⬆️
jest-component 21.17% <7.14%> (-0.01%) ⬇️
jest-unit 23.14% <32.14%> (+0.97%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/common/config/state/init.js 92.59% <ø> (ø)
src/common/config/state/runtime.js 100.00% <ø> (ø)
src/features/ajax/aggregate/index.js 56.62% <73.91%> (+3.37%) ⬆️
src/common/deny-list/deny-list.js 86.11% <100.00%> (+77.15%) ⬆️
src/loaders/configure/configure.js 90.32% <100.00%> (+0.66%) ⬆️

... and 1 file with indirect coverage changes

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

@metal-messiah
Copy link
Member

Lets merge with main and run all wdio tests, but otherwise looks good

@metal-messiah metal-messiah added the needs follow up Issue needs follow-up to ensure the problem has been solved by a release, PR, or otherwise. label Jul 27, 2023
@patrickhousley patrickhousley merged commit ca43edf into main Jul 27, 2023
@patrickhousley patrickhousley deleted the ajax-block-internal branch July 27, 2023 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request impact data MMF Work directly planned for in an MMF needs follow up Issue needs follow-up to ensure the problem has been solved by a release, PR, or otherwise. small Small Engineering Effort
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants