Encapsulate SDK Tracer observability - #7331
Merged
Merged
Conversation
MrAlias
force-pushed
the
enc-trace-sdk-tracer-obs
branch
from
September 8, 2025 19:29
57eb2d4 to
6d02ae4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7331 +/- ##
=======================================
- Coverage 85.4% 85.4% -0.1%
=======================================
Files 267 268 +1
Lines 24295 24297 +2
=======================================
+ Hits 20758 20759 +1
- Misses 3160 3161 +1
Partials 377 377
🚀 New features to boost your workflow:
|
MrAlias
force-pushed
the
enc-trace-sdk-tracer-obs
branch
2 times, most recently
from
September 8, 2025 20:04
58591c0 to
cccf667
Compare
MrAlias
force-pushed
the
enc-trace-sdk-tracer-obs
branch
from
September 8, 2025 20:36
cccf667 to
10b4c11
Compare
MrAlias
marked this pull request as ready for review
September 8, 2025 20:43
MrAlias
requested review from
XSAM,
dashpole,
dmathieu,
flc1125 and
pellared
as code owners
September 8, 2025 20:43
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR encapsulates SDK Tracer observability functionality by moving instrumentation logic from the main tracer type into a dedicated internal observability package. The refactoring improves maintainability by separating concerns and provides better performance through optimized attribute caching.
- Extracts observability instrumentation into a new
sdk/trace/internal/observpackage - Replaces direct metric handling in tracer with a dedicated
observ.Tracertype - Updates all references to use the new observability constants and interfaces
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
sdk/trace/tracer.go |
Replaces inline observability fields and logic with observ.Tracer instance |
sdk/trace/provider.go |
Updates tracer creation to use new observ.NewTracer() constructor |
sdk/trace/span.go |
Simplifies span end observability calls using new interface |
sdk/trace/internal/observ/tracer.go |
New observability tracer implementation with optimized attribute caching |
sdk/trace/internal/observ/tracer_test.go |
Comprehensive tests for the new observability functionality |
sdk/trace/trace_test.go |
Updates test expectations to use new observability scope constants |
sdk/trace/provider_test.go |
Adjusts test assertions for new observability interface |
.codespellignore |
Adds "observ" to ignored words list |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
dashpole
approved these changes
Sep 15, 2025
pellared
approved these changes
Sep 15, 2025
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.
Split from #7316
Follow guidelines and move instrumentation into its own type.
Benchmarks
Added
sdk/trace/internal/observbenchmarksExisting
sdk/tracebenchmarks