Skip to content

fix: Capture potential missing tail data for session trace #624

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

Merged
merged 5 commits into from
Aug 16, 2023

Conversation

cwli24
Copy link
Contributor

@cwli24 cwli24 commented Jul 21, 2023

Send buffered session trace data in certain cases when it's being discarded at the tail end of a captured session.

Overview

In the old session trace behavior, it had discarded or not sent remaining session trace nodes when it hit the max duration life of the feature, even though the nodes were added before the max duration time. Likewise, on EoL of the page, session trace would not run final harvest if the buffered nodes is less than the required minimum of 30, which causes that valid data to be amiss. This PR patches both of those issues.

Related Issue(s)

NR-138555

Testing

Workflows listed in bug ticket's AC list should hold true, namely:

  • trace sends final harvest of < 30 nodes when in standalone
  • if there are any additional nodes buffered between the max duration point of time and its immediately preceding interval harvest, those are also sent, not discarded

@codecov
Copy link

codecov bot commented Jul 21, 2023

Codecov Report

Merging #624 (3c76bfc) into main (043becf) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #624      +/-   ##
==========================================
+ Coverage   69.94%   69.95%   +0.01%     
==========================================
  Files         134      134              
  Lines        5995     5988       -7     
  Branches     1141     1139       -2     
==========================================
- Hits         4193     4189       -4     
+ Misses       1487     1486       -1     
+ Partials      315      313       -2     
Flag Coverage Δ
jest 76.84% <100.00%> (ø)

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

Files Changed Coverage Δ
src/features/session_trace/aggregate/index.js 52.76% <ø> (-0.09%) ⬇️
src/common/harvest/harvest.js 100.00% <100.00%> (ø)

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

@github-actions
Copy link

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.01% (gzip)
nr-loader-full.min 44.61 kB / 15.2 kB (gzip) 44.61 kB / 15.2 kB (gzip) -0% / -0% (gzip)
nr-loader-rum.min 27.84 kB / 9.92 kB (gzip) 27.84 kB / 9.92 kB (gzip) -0% / -0.01% (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.01% (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.72 kB / 94.15 kB (gzip) 304.83 kB / 94.18 kB (gzip) +0.04% / +0.02% (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.d2c35ed3.min.js 7.97 kB / 2.93 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.f51d91f6.min.js 12.32 kB / 4.54 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.b4fe5874.min.js 8.07 kB / 3.33 kB (gzip)
session_replay-aggregate.d2c35ed3.min.js 7.97 kB / 2.93 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.a08aab5e-es5.min.js 19.27 kB / 6.54 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.ca5b7991-es5.min.js 32.34 kB / 8.52 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.a08aab5e-es5.min.js 19.27 kB / 6.54 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.ecd67831-es5.min.js 10.67 kB / 4.18 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)

@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
@github-actions
Copy link

github-actions bot commented Aug 15, 2023

Static Badge

Last ran on August 16, 2023 10:11:58 CDT
Checking merge of (3c76bfc) into main (043becf)

Copy link
Member

@metal-messiah metal-messiah left a comment

Choose a reason for hiding this comment

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

👍 assuming tests pass

@patrickhousley patrickhousley removed the needs follow up Issue needs follow-up to ensure the problem has been solved by a release, PR, or otherwise. label Aug 16, 2023
@patrickhousley
Copy link
Contributor

I verified the safari tests that failed in github actions are passing locally. They appear to just be flakey.

@patrickhousley patrickhousley merged commit 1941427 into main Aug 16, 2023
@patrickhousley patrickhousley deleted the trace-nr-138555 branch August 16, 2023 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants