chore: Added audit logging for OTEL metrics#4018
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4018 +/- ##
==========================================
- Coverage 97.35% 97.33% -0.02%
==========================================
Files 507 513 +6
Lines 61530 61610 +80
Branches 1 1
==========================================
+ Hits 59903 59970 +67
- Misses 1627 1640 +13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jsumners-nr
commented
May 21, 2026
Comment on lines
+215
to
+222
| loggingFunctions.audit = function audit(...args) { | ||
| if (this.options.auditLogging === true) { | ||
| return this.info.apply(this, args) | ||
| } | ||
| if (this.traceEnabled() === true) { | ||
| return this.trace.apply(this, args) | ||
| } | ||
| } |
Contributor
Author
There was a problem hiding this comment.
I added this because the only place I could find where we use config.audit_log is at
node-newrelic/lib/collector/remote-method.js
Lines 258 to 267 in 6289502
I thought it would be rather silly to duplicate the above logic multiple times in this new code. So I centralized it in the logger.
bizob2828
requested changes
May 26, 2026
Co-authored-by: Bob Evans <robert.evans25@gmail.com>
bizob2828
approved these changes
May 27, 2026
This was referenced Jun 1, 2026
Closed
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR resolves #4015.
Technically, we are supposed to log the URI for every outgoing request. But we can't access the transport. So the best we'd be able to do is to log the URL that we pass in for configuration. I omitted that because I don't see the benefit.
Additionally, I brought up the fact that we can't access the transport in our Slack channel and had a discussion about the "MUST" requirements in the spec PR. The consensus is that some agents may not be able to meet those requirements, and should be able to make a best effort. We can't meet any of the "MUST" requirements as they are outlined, so this is our best effort.