Checked if Instrument Enabled before measuring in otlpgrpc - #7824
Merged
Conversation
itssaharsh
requested review from
MrAlias,
XSAM,
dashpole,
dmathieu,
flc1125 and
pellared
as code owners
January 21, 2026 20:18
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7824 +/- ##
=======================================
- Coverage 81.7% 81.6% -0.1%
=======================================
Files 304 304
Lines 23281 23285 +4
=======================================
- Hits 19021 19013 -8
- Misses 3866 3867 +1
- Partials 394 405 +11
🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds Enabled() checks before metric operations in the otlploggrpc exporter to optimize performance by avoiding computationally expensive operations when metrics are disabled. This is part of the broader effort tracked in issue #7800 to use the Enabled method across all synchronous metric instruments in the project.
Changes:
- Added
Enabled()checks beforeAdd()calls on the inflight metric inExportLogsmethod - Added
Enabled()checks before metric operations in theEndmethod for inflight, exported, and duration metrics
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dashpole
reviewed
Feb 3, 2026
15 tasks
dashpole
reviewed
Feb 4, 2026
…tion.go Co-authored-by: David Ashpole <dashpole@google.com>
dmathieu
approved these changes
Feb 5, 2026
dashpole
reviewed
Feb 9, 2026
dashpole
approved these changes
Feb 9, 2026
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 updates otlploggprc for cecking if the operation is enabled before addinng any metric or performing operation.
tracked in #7800