Skip to content

sdk/log/observ: guard LogProcessed with Enabled#7848

Merged
MrAlias merged 4 commits intoopen-telemetry:mainfrom
NesterovYehor:logs-observ-guard-enabled
Feb 3, 2026
Merged

sdk/log/observ: guard LogProcessed with Enabled#7848
MrAlias merged 4 commits intoopen-telemetry:mainfrom
NesterovYehor:logs-observ-guard-enabled

Conversation

@NesterovYehor
Copy link
Copy Markdown
Contributor

@NesterovYehor NesterovYehor commented Jan 29, 2026

Guards SLP.LogProcessed with processed.Enabled(ctx) to avoid building metric
options/attributes when the processed counter is disabled.

BenchmarkSLP (noop MeterProvider):

LogProcessedWithError: ~106 ns/op, 232 B/op, 3 allocs/op -> ~0.46 ns/op, 0 B/op, 0 allocs/op
No behavior change when enabled; existing tests cover enabled path.
I don't believe this is a "notable" change, so doesn't need a CHANGELOG entry.
Issue: #7800

@pellared pellared added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jan 29, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.7%. Comparing base (4401cf2) to head (615c0e1).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #7848   +/-   ##
=====================================
  Coverage   81.7%   81.7%           
=====================================
  Files        304     304           
  Lines      23235   23236    +1     
=====================================
+ Hits       18993   18995    +2     
+ Misses      3860    3858    -2     
- Partials     382     383    +1     
Files with missing lines Coverage Δ
sdk/log/internal/observ/simple_log_processor.go 100.0% <100.0%> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MrAlias MrAlias merged commit e0ad47f into open-telemetry:main Feb 3, 2026
31 checks passed
@NesterovYehor NesterovYehor deleted the logs-observ-guard-enabled branch February 4, 2026 10:16
@MrAlias MrAlias added this to the v1.41.0 milestone Feb 26, 2026
dmathieu added a commit that referenced this pull request Mar 18, 2026
#8067)

Guards SpanStarted and spanLive with Enabled(ctx) to avoid building
metric
options/attributes when instruments are disabled.

```
BenchmarkTracer (noop MeterProvider):

  SpanStarted: ~1.77 ns/op -> ~0.48 ns/op (~3.7x)
  SpanLive:    ~2.05 ns/op -> ~0.52 ns/op (~3.9x)
  SpanEnded:   ~2.05 ns/op -> ~0.52 ns/op (~3.9x)
```

No behavior change when enabled; existing tests cover enabled path.
~~No CHANGELOG entry, following #7848.~~

Issue: #7800

---------

Co-authored-by: Damien Mathieu <42@dmathieu.com>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants