-
Notifications
You must be signed in to change notification settings - Fork 45
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.70% 88.59% -0.12%
==========================================
Files 171 171
Lines 7330 7372 +42
Branches 1486 1501 +15
==========================================
+ Hits 6502 6531 +29
- Misses 717 726 +9
- Partials 111 115 +4
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
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.