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

fix: Prevent agent using invalid date header #1122

Merged
merged 1 commit into from
Jul 24, 2024
Merged

Conversation

patrickhousley
Copy link
Contributor

@patrickhousley patrickhousley commented Jul 24, 2024

Shut down the agent when unable to read a correctly formatted date header for the page view event harvest. This prevents harvesting data with wildly inaccurate timestamps. This should only happen with third-party or non-agent code has tampered with the ajax response headers.

Overview

Adding supportability metrics to track when the calculated time diff is >= 12 hours, >= 6 hours, or >= 1 hour.

Related Issue(s)

https://new-relic.atlassian.net/browse/NR-295258
https://source.datanerd.us/agents/angler/pull/600

Testing

Copy link

github-actions bot commented Jul 24, 2024

Asset Size Report

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

Agent Asset Previous Size New Size Diff
lite loader 32.44 kB / 11.33 kB (gzip) 32.44 kB / 11.33 kB (gzip) 0% / 0% (gzip)
lite async-chunk 50.14 kB / 16.15 kB (gzip) 50.9 kB / 16.39 kB (gzip) 1.5% / 1.45% (gzip)
pro loader 53.3 kB / 18.04 kB (gzip) 53.3 kB / 18.04 kB (gzip) 0% / 0.01% (gzip)
pro async-chunk 96.37 kB / 28.8 kB (gzip) 97.12 kB / 29.04 kB (gzip) 0.78% / 0.83% (gzip)
spa loader 61.24 kB / 20.48 kB (gzip) 61.24 kB / 20.48 kB (gzip) 0% / 0.01% (gzip)
spa async-chunk 111.42 kB / 33.14 kB (gzip) 112.18 kB / 33.37 kB (gzip) 0.68% / 0.7% (gzip)
lite-polyfills loader 125.99 kB / 40.61 kB (gzip) 125.99 kB / 40.62 kB (gzip) 0% / 0.02% (gzip)
lite-polyfills async-chunk 64.2 kB / 18.49 kB (gzip) 64.99 kB / 18.73 kB (gzip) 1.23% / 1.3% (gzip)
pro-polyfills loader 148.55 kB / 46.95 kB (gzip) 148.55 kB / 46.95 kB (gzip) 0% / 0% (gzip)
pro-polyfills async-chunk 116.53 kB / 31.11 kB (gzip) 117.32 kB / 31.32 kB (gzip) 0.68% / 0.69% (gzip)
spa-polyfills loader 156.75 kB / 49.11 kB (gzip) 156.75 kB / 49.11 kB (gzip) 0% / 0% (gzip)
spa-polyfills async-chunk 133.44 kB / 35.78 kB (gzip) 134.23 kB / 35.99 kB (gzip) 0.59% / 0.59% (gzip)

Copy link

github-actions bot commented Jul 24, 2024

Static Badge

Last ran on July 24, 2024 11:17:29 CDT
Checking merge of (8c6db74) into main (c22a39d)

Copy link

codecov bot commented Jul 24, 2024

Codecov Report

Attention: Patch coverage is 29.41176% with 12 lines in your changes missing coverage. Please review.

Project coverage is 87.70%. Comparing base (c22a39d) to head (bb76965).

Files Patch % Lines
src/features/page_view_event/aggregate/index.js 0.00% 6 Missing and 4 partials ⚠️
src/common/timing/time-keeper.js 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1122      +/-   ##
==========================================
- Coverage   87.83%   87.70%   -0.13%     
==========================================
  Files         162      162              
  Lines        7267     7282      +15     
  Branches     1428     1435       +7     
==========================================
+ Hits         6383     6387       +4     
- Misses        766      773       +7     
- Partials      118      122       +4     
Flag Coverage Δ
unit-tests 76.21% <29.41%> (-0.17%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@patrickhousley patrickhousley changed the title chore: adding SMs for time diff fix: Prevent agent using invalid date header Jul 24, 2024
@patrickhousley patrickhousley merged commit 6851c1b into main Jul 24, 2024
19 of 21 checks passed
@patrickhousley patrickhousley deleted the time-diff-sm branch July 24, 2024 17:53
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