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: Add warning for large payloads #620

Merged
merged 4 commits into from
Jul 27, 2023
Merged

feat: Add warning for large payloads #620

merged 4 commits into from
Jul 27, 2023

Conversation

metal-messiah
Copy link
Member

Add warning for large payloads, which is typically caused by excessive custom attribute sizes.

Overview

This PR adds a check to the harvest cycle to check the body size. If the body is large (>750kb), it will log a warning to the console noting that customers should check their custom attributes.

Related Issue(s)

NR-137463

Testing

A new jest test representing this case has been added to harvest.test.js

@metal-messiah metal-messiah added the small Small Engineering Effort label Jul 17, 2023
@github-actions
Copy link

github-actions bot commented Jul 17, 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.14 kB (gzip) 51.04 kB / 17.14 kB (gzip) -0% / -0% (gzip)
nr-loader-full.min 44.61 kB / 15.2 kB (gzip) 44.61 kB / 15.2 kB (gzip) -0% / -0.01% (gzip)
nr-loader-rum.min 27.84 kB / 9.92 kB (gzip) 27.84 kB / 9.92 kB (gzip) -0% / -0% (gzip)
nr-loader-spa-polyfills.min 124.47 kB / 39.47 kB (gzip) 124.47 kB / 39.47 kB (gzip) -0% / -0% (gzip)
nr-loader-full-polyfills.min 116.46 kB / 37.35 kB (gzip) 116.46 kB / 37.35 kB (gzip) -0% / -0% (gzip)
nr-loader-rum-polyfills.min 96.45 kB / 31.58 kB (gzip) 96.45 kB / 31.58 kB (gzip) -0% / +0% (gzip)
nr-loader-worker.min 41.17 kB / 13.92 kB (gzip) 41.17 kB / 13.92 kB (gzip) -0% / +0.01% (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.18 kB / 17.04 kB (gzip) -0% / -0% (gzip)
Custom Lite Agent 27.99 kB / 9.85 kB (gzip) 27.99 kB / 9.85 kB (gzip) -0% / -0% (gzip)
Custom Pro Agent 44.66 kB / 15.02 kB (gzip) 44.66 kB / 15.02 kB (gzip) -0% / -0% (gzip)
Custom SPA Agent 51.06 kB / 17 kB (gzip) 51.06 kB / 17 kB (gzip) -0% / -0% (gzip)
Worker Agent 304.69 kB / 94.14 kB (gzip) 304.94 kB / 94.26 kB (gzip) +0.08% / +0.14% (gzip)
Other Standard CDN Assets

Released Assets

Asset Name Asset Size
recorder.1b18459f.min.js 166.07 kB / 52.32 kB (gzip)
spa-aggregate.68f643e9.min.js 20.93 kB / 7.42 kB (gzip)
page_view_timing-aggregate.d7fbc4fb.min.js 14.97 kB / 5.43 kB (gzip)
860.e349dcb2.min.js 14.09 kB / 5.27 kB (gzip)
session_trace-aggregate.973a2a56.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.86f3591a.min.js 9.55 kB / 3.65 kB (gzip)
metrics-aggregate.8f3b1670.min.js 8.56 kB / 2.93 kB (gzip)
646.fd5f577f.min.js 8.04 kB / 3.32 kB (gzip)
session_replay-aggregate.29998cae.min.js 7.94 kB / 2.91 kB (gzip)
ajax-aggregate.449a907c.min.js 7.13 kB / 3.06 kB (gzip)
compressor.ae9f91a8.min.js 7.09 kB / 3.57 kB (gzip)
page_action-aggregate.da8a4bbf.min.js 4.73 kB / 1.92 kB (gzip)
async-api.30bd804e.min.js 2.92 kB / 1.46 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.1b18459f.min.js 166.07 kB / 52.32 kB (gzip)
spa-aggregate.68f643e9.min.js 20.93 kB / 7.42 kB (gzip)
page_view_timing-aggregate.d7fbc4fb.min.js 14.97 kB / 5.43 kB (gzip)
860.e349dcb2.min.js 14.09 kB / 5.27 kB (gzip)
session_trace-aggregate.973a2a56.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.86f3591a.min.js 9.55 kB / 3.65 kB (gzip)
metrics-aggregate.8f3b1670.min.js 8.56 kB / 2.93 kB (gzip)
646.3b3d9a5a.min.js 8.28 kB / 3.46 kB (gzip)
session_replay-aggregate.29998cae.min.js 7.94 kB / 2.91 kB (gzip)
ajax-aggregate.449a907c.min.js 7.13 kB / 3.06 kB (gzip)
compressor.ae9f91a8.min.js 7.09 kB / 3.57 kB (gzip)
page_action-aggregate.da8a4bbf.min.js 4.73 kB / 1.92 kB (gzip)
async-api.30bd804e.min.js 2.92 kB / 1.46 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)
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.c6e2d80e-es5.min.js 32.26 kB / 8.5 kB (gzip)
compressor.79fb47d9-es5.min.js 30.02 kB / 11.29 kB (gzip)
spa-aggregate.cf7614a6-es5.min.js 24.02 kB / 8.11 kB (gzip)
session_replay-aggregate.307e7ec3-es5.min.js 19.24 kB / 6.52 kB (gzip)
page_view_timing-aggregate.4cf1986a-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.69bf7e5d-es5.min.js 12.33 kB / 4.4 kB (gzip)
385.1f3686e5-es5.min.js 10.62 kB / 4.16 kB (gzip)
ajax-aggregate.34fb41fa-es5.min.js 10.58 kB / 3.78 kB (gzip)
metrics-aggregate.9be0ba0b-es5.min.js 9.91 kB / 3.35 kB (gzip)
page_action-aggregate.710c9b26-es5.min.js 7.33 kB / 2.64 kB (gzip)
async-api.2b4763c8-es5.min.js 4.16 kB / 1.99 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.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.c6e2d80e-es5.min.js 32.26 kB / 8.5 kB (gzip)
compressor.79fb47d9-es5.min.js 30.02 kB / 11.29 kB (gzip)
spa-aggregate.cf7614a6-es5.min.js 24.02 kB / 8.11 kB (gzip)
session_replay-aggregate.307e7ec3-es5.min.js 19.24 kB / 6.52 kB (gzip)
page_view_timing-aggregate.4cf1986a-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.69bf7e5d-es5.min.js 12.33 kB / 4.4 kB (gzip)
385.a4393ec9-es5.min.js 10.87 kB / 4.3 kB (gzip)
ajax-aggregate.34fb41fa-es5.min.js 10.58 kB / 3.78 kB (gzip)
metrics-aggregate.9be0ba0b-es5.min.js 9.91 kB / 3.35 kB (gzip)
page_action-aggregate.710c9b26-es5.min.js 7.33 kB / 2.64 kB (gzip)
async-api.2b4763c8-es5.min.js 4.16 kB / 1.99 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)

@codecov
Copy link

codecov bot commented Jul 17, 2023

Codecov Report

Merging #620 (bf1b24e) into main (3d9f2c0) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #620      +/-   ##
==========================================
+ Coverage   66.64%   66.66%   +0.02%     
==========================================
  Files         130      130              
  Lines        6011     6018       +7     
  Branches     1141     1142       +1     
==========================================
+ Hits         4006     4012       +6     
- Misses       1641     1642       +1     
  Partials      364      364              
Flag Coverage Δ
integration-tests 81.99% <100.00%> (+<0.01%) ⬆️
jest-component 21.17% <50.00%> (+0.01%) ⬆️
jest-unit 22.34% <100.00%> (+0.05%) ⬆️

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

Impacted Files Coverage Δ
src/common/harvest/harvest.js 97.67% <100.00%> (-0.51%) ⬇️

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

@github-actions
Copy link

github-actions bot commented Jul 17, 2023

Static Badge

Last ran on July 19, 2023 16:21:12 CDT
Checking merge of (bf1b24e) into main (3d9f2c0)

@metal-messiah
Copy link
Member Author

Should follow up with plan about surfacing "warnings" to NR1

@metal-messiah metal-messiah merged commit d616f64 into main Jul 27, 2023
@metal-messiah metal-messiah deleted the custom-attr-warn branch July 27, 2023 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
small Small Engineering Effort
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants