Repository navigation
Conversation
Pull request dashboard statusWaiting on reviewers · refreshed 2026-10-24 16:31 UTC Review the latest changes. Status above doesn't look right?
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8947 +/- ##
============================================
+ Coverage 90.41% 90.45% +0.03%
- Complexity 10981 11033 +52
============================================
Files 1019 1021 +2
Lines 30016 30160 +144
Branches 3917 3937 +20
============================================
+ Hits 27140 27282 +142
+ Misses 1923 1915 -8
- Partials 953 963 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rooks-ns
force-pushed
the
feat/context-scoped-attributes
branch
from
October 13, 2026 22:24
403a57c to
7d8f465
Compare
rooks-ns
marked this pull request as ready for review
October 14, 2026 18:25
rooks-ns
force-pushed
the
feat/context-scoped-attributes
branch
3 times, most recently
from
October 14, 2026 21:45
3b2ce44 to
e7872d7
Compare
rooks-ns
marked this pull request as draft
October 18, 2026 12:22
rooks-ns
force-pushed
the
feat/context-scoped-attributes
branch
from
October 19, 2026 23:48
e7872d7 to
657d862
Compare
rooks-ns
marked this pull request as ready for review
October 20, 2026 14:20
Implements prototype for Context-scoped attributes per OTEP open-telemetry#4931 and Issue open-telemetry#8532: - Add ContextAttributes API in :api:incubator for setting/getting/extracting attributes on Context - Support opt-in context-scoped attributes configuration across SdkTracerProvider, SdkLoggerProvider, and SdkMeterProvider - Inherit context attributes in SdkSpanBuilder, SdkLogRecordBuilder, and synchronous metric storage (Delta & Cumulative) - Expose configuration via declarative-config (tracer_provider, logger_provider, meter_provider) - Add comprehensive unit, incubating, and multi-signal integration tests
rooks-ns
force-pushed
the
feat/context-scoped-attributes
branch
from
October 22, 2026 16:49
657d862 to
ef1468f
Compare
Contributor
Author
|
@jack-berg Please take a look . Thank you. |
This branch has not been deployed
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.
Overview
Prototypes Context-scoped attributes (OTEP #4931, #8532), allowing Traces, Logs, and synchronous Metrics to automatically inherit attributes from the active
Contextwithout manually adding them at every call site.Key Decisions (Spec Gaps Resolved)
bind(), but Java incubator retains it.BoundStorageHandle) record only to their pre-bound timeseries with zero runtime attribute merging. This guarantees zero allocations on hot paths and prevents cardinality explosion on shared infrastructure (e.g., connection pools). Unbound instruments continue to merge context attributes dynamically.setNoParent()preserves Context Attributes:setNoParent()historically reset context toContext.root(), unintentionally deleting context attributes and baggage.Context.root()withcurrent.with(Span.getInvalid()). This detaches the parent span while keeping context attributes and baggage available forSamplerandSpanProcessor. UsesetParent(Context.root())for full isolation.Signal Implementation Summary
api:incubator):ContextAttributes.add(Context, Attributes)(merges into context) andget(Context)(SDK reader).sdk:trace): Merges context attributes beforeSampler.shouldSample(); unifies context across sampling, span creation, andSpanProcessor.onStart().sdk:logs): Merges onemit()into an isolated record attributes map to prevent attribute leakage when reusingLogRecordBuilder.sdk:metrics): Merges context attributes on unbound instruments before view filtering; bypassescanUseRootContextoptimization when active.Sdk*ProviderUtilor declaratively viacontext_scoped_attributes/development.Verification
ContextScopedAttributesSpanTest(attributes, precedence, limits, andsetNoParent()context preservation) &SdkSpanBuilderTest(legacy compatibility).ContextScopedAttributesMetricTest(dynamic unbound enrichment, bound handle isolation, same-context co-existence).ContextScopedAttributesLogTest(merging, collision precedence, builder reuse).ContextScopedAttributesIntegrationTest(multi-signal E2E); clean runs acrossspotless,checkstyle,jApiCmp, andanimalsniffer.