Checked if instrument enabled before measuring in oteltracegrpc#7825
Merged
dmathieu merged 10 commits intoopen-telemetry:mainfrom Feb 10, 2026
Merged
Checked if instrument enabled before measuring in oteltracegrpc#7825dmathieu merged 10 commits intoopen-telemetry:mainfrom
oteltracegrpc#7825dmathieu merged 10 commits intoopen-telemetry:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7825 +/- ##
=======================================
- Coverage 81.7% 81.7% -0.1%
=======================================
Files 304 304
Lines 23276 23281 +5
=======================================
- Hits 19024 19021 -3
- Misses 3865 3866 +1
- Partials 387 394 +7
🚀 New features to boost your workflow:
|
MrAlias
reviewed
Jan 22, 2026
15 tasks
oteltracegrpc
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements performance optimizations for the OTLP trace gRPC exporter by adding Enabled() checks before metric recording operations, preventing unnecessary computation when instruments are not configured with views. This addresses part of issue #7800 which tracks the adoption of the Enabled() method across all synchronous metric instruments in the project.
Changes:
- Added
Enabled()checks for all three metric instruments (inflightSpans, exportedSpans, opDuration) before performing metric operations - Optimized resource pooling to only allocate pool objects when metrics are actually enabled
- Refactored
get()function formatting for consistency
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dashpole
reviewed
Feb 3, 2026
dashpole
reviewed
Feb 3, 2026
dashpole
reviewed
Feb 4, 2026
dashpole
reviewed
Feb 4, 2026
dashpole
reviewed
Feb 9, 2026
dashpole
approved these changes
Feb 9, 2026
dmathieu
approved these changes
Feb 10, 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 otltracegrpc for checking if the operation is enabled before adding any metric or performing operation.
tracked in #7800