Skip to content

Checked if Instrument Enabled before measuring in otlpgrpc - #7824

Merged
dmathieu merged 10 commits into
open-telemetry:mainfrom
itssaharsh:otlpobs
Feb 10, 2026
Merged

Checked if Instrument Enabled before measuring in otlpgrpc#7824
dmathieu merged 10 commits into
open-telemetry:mainfrom
itssaharsh:otlpobs

Conversation

@itssaharsh

Copy link
Copy Markdown
Contributor

This pr updates otlploggprc for cecking if the operation is enabled before addinng any metric or performing operation.

tracked in #7800

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jan 21, 2026

Copy link
Copy Markdown

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: dmathieu / name: Damien Mathieu (2cc238b)

@codecov

codecov Bot commented Jan 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.6%. Comparing base (53c10af) to head (2cc238b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...log/otlploggrpc/internal/observ/instrumentation.go 90.0% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           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     
Files with missing lines Coverage Δ
...log/otlploggrpc/internal/observ/instrumentation.go 90.9% <90.0%> (-8.4%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@itssaharsh itssaharsh changed the title Checked if operation is Enabled before adding to metrics Jan 24, 2026
Copilot AI review requested due to automatic review settings February 3, 2026 05:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 before Add() calls on the inflight metric in ExportLogs method
  • Added Enabled() checks before metric operations in the End method for inflight, exported, and duration metrics

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@itssaharsh
itssaharsh requested a review from dashpole February 4, 2026 13:37
itssaharsh and others added 2 commits February 4, 2026 22:14
…tion.go

Co-authored-by: David Ashpole <dashpole@google.com>
Comment thread exporters/otlp/otlplog/otlploggrpc/internal/observ/instrumentation.go Outdated
@dmathieu dmathieu added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Feb 10, 2026
@dmathieu
dmathieu merged commit 490fd7f into open-telemetry:main Feb 10, 2026
31 of 32 checks passed
@MrAlias MrAlias added this to the v1.41.0 milestone Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

5 participants