Add dual-semconv support to RPC attributes extractors#16130
Merged
trask merged 14 commits intoopen-telemetry:mainfrom Feb 25, 2026
Merged
Add dual-semconv support to RPC attributes extractors#16130trask merged 14 commits intoopen-telemetry:mainfrom
trask merged 14 commits intoopen-telemetry:mainfrom
Conversation
…xtractor RpcCommonAttributesExtractor now conditionally emits old (rpc.system, rpc.service, rpc.method) and/or stable (rpc.system.name, rpc.method, rpc.method_original, error.type) attributes based on SemconvStability flags. RpcSpanNameExtractor uses getRpcMethod() for stable semconv with system name fallback. In dup mode, old rpc.method is omitted from spans to avoid clashing with stable rpc.method. Instead, a ContextCustomizer stores the old method value in context via a ContextKey for metrics to read. Also adds RpcAttributesGetter.isPredefined() for rpc.method vs rpc.method_original handling.
a1e958a to
fc4a9eb
Compare
steverao
reviewed
Feb 11, 2026
...a/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcAttributesExtractorTest.java
Outdated
Show resolved
Hide resolved
Member
Author
|
@trask please take a look |
trask
reviewed
Feb 12, 2026
...ain/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcAttributesGetter.java
Outdated
Show resolved
Hide resolved
Draft
trask
reviewed
Feb 13, 2026
...ava/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcSpanNameExtractorTest.java
Outdated
Show resolved
Hide resolved
...ava/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcSpanNameExtractorTest.java
Show resolved
Hide resolved
...in/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcSpanNameExtractor.java
Outdated
Show resolved
Hide resolved
...in/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcSpanNameExtractor.java
Outdated
Show resolved
Hide resolved
...ain/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcAttributesGetter.java
Outdated
Show resolved
Hide resolved
| internalSet(attributes, RPC_SYSTEM, getter.getSystem(request)); | ||
| internalSet(attributes, RPC_SERVICE, getter.getService(request)); | ||
| internalSet(attributes, RPC_METHOD, getter.getMethod(request)); | ||
| String system = getter.getSystem(request); |
Member
There was a problem hiding this comment.
let's introduce getRpcSystemName
mark getSystem as deprecated // to be removed in 3.0
then the getter can be responsible for returning the stable / old name from each of the methods
I realize this is different from what we did with database, but I think it would be better
Member
Author
There was a problem hiding this comment.
Done — added getRpcSystemName() as default method, deprecated getSystem() with "to be removed in 3.0". Extractor now calls getRpcSystemName() directly for stable semconv instead of going through stableRpcSystemName() mapping.
- Add getRpcSystemName() to RpcAttributesGetter, deprecate getSystem() - Remove isPredefined() and RPC_METHOD_ORIGINAL — defer until use case exists - Getter implementations now responsible for returning stable/old system names - Remove system fallback in RpcSpanNameExtractor (system name is required) - Simplify test setup per reviewer suggestions Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Resolve merge conflicts by keeping dual-semconv support changes. Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
… removal Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
trask
reviewed
Feb 24, 2026
...in/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcSpanNameExtractor.java
Outdated
Show resolved
Hide resolved
trask
reviewed
Feb 24, 2026
...ain/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcAttributesGetter.java
Outdated
Show resolved
Hide resolved
trask
reviewed
Feb 24, 2026
...io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcCommonAttributesExtractor.java
Outdated
Show resolved
Hide resolved
trask
reviewed
Feb 24, 2026
...ain/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcAttributesGetter.java
Outdated
Show resolved
Hide resolved
...ain/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcAttributesGetter.java
Outdated
Show resolved
Hide resolved
… fixes Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
e06b3a5 to
7b59479
Compare
trask
reviewed
Feb 24, 2026
...in/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcSpanNameExtractor.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
trask
approved these changes
Feb 25, 2026
This was referenced Feb 26, 2026
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.
#15871