-
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: Add auto-logging feature #1274
base: main
Are you sure you want to change the base?
Conversation
Removing existing wrapLogger calls in preamble to tell them apart.
Asset Size Report
Merging this pull request will result in the following asset size changes:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1274 +/- ##
==========================================
- Coverage 88.54% 88.48% -0.07%
==========================================
Files 170 170
Lines 7325 7362 +37
Branches 1480 1495 +15
==========================================
+ Hits 6486 6514 +28
- Misses 723 731 +8
- Partials 116 117 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
newrelic.wrapLogger(console, 'info', {customAttributes: {wrappedFn: 'console.info'}, level: 'info'}) | ||
newrelic.wrapLogger(console, 'debug', {customAttributes: {wrappedFn: 'console.debug'}, level: 'debug'}) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was removed for the experimental publish to staging
src/features/utils/aggregate-base.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since session isn't applicable to all (or even a majority) of the features, I think you should leave it out of the base class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(ah, just saw this EOD yesterday) - when i introduced it at the time, I hadn't the association that aggregate-base should only contain code relevant to all/majority of features, just methods/attrs that could be common and it's up to specific features whether they use 'em 🤔
I can move the logic back into the feat agg constructors. Can't really think of anywhere else or anything i want to introduce yet. Lmk if you have other thoughts!
The auto-logging feature builds on top of the current API calls
log
andwrapLogger
. The api calls continue to provide a way to add custom attributes as needed. Otherwise, customers may simply configure browser logs (on/off, logging level, and sampling rates), which will capture logging statements from the browserconsole
across a given session automatically.Overview
This PR includes work that:
log
flag received from rum call to BCSRelated Issue(s)
https://new-relic.atlassian.net/browse/NR-323591
https://new-relic.atlassian.net/browse/NR-323597
https://new-relic.atlassian.net/browse/NR-341932
Testing
Extended the existing e2e tests for logging harvests:
Extended existing logging aggregate unit and e2e tests around handling the flag. Includes tests for each logging mode to ensure log messages of equal or higher levels are collected. For example, if the log flag = 3 (INFO), then collect console.error, console.warn, console.info, and console.log events.
Extended existing tests to ensure no harvests when rum flag = 0 and events are drained.