Skip to content

sdk/trace/internal/observ: guard SpanStarted and spanLive with Enabled#8067

Open
kouji-yoshimura wants to merge 1 commit intoopen-telemetry:mainfrom
kouji-yoshimura:trace-observ-guard-enabled
Open

sdk/trace/internal/observ: guard SpanStarted and spanLive with Enabled#8067
kouji-yoshimura wants to merge 1 commit intoopen-telemetry:mainfrom
kouji-yoshimura:trace-observ-guard-enabled

Conversation

@kouji-yoshimura
Copy link

@kouji-yoshimura kouji-yoshimura commented Mar 16, 2026

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

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 16, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: kouji-yoshimura / name: yoshimura (752aa1e)

@kouji-yoshimura
Copy link
Author

@cla-bot check

@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.6%. Comparing base (972a6e5) to head (752aa1e).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #8067   +/-   ##
=====================================
  Coverage   81.6%   81.6%           
=====================================
  Files        304     304           
  Lines      23446   23452    +6     
=====================================
+ Hits       19135   19140    +5     
- Misses      3929    3930    +1     
  Partials     382     382           
Files with missing lines Coverage Δ
sdk/trace/internal/observ/tracer.go 100.0% <100.0%> (ø)

... and 5 files with indirect coverage changes

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants