Skip to content

Add dual-semconv support to RPC attributes extractors#16130

Merged
trask merged 14 commits intoopen-telemetry:mainfrom
zeitlinger:pr3-rpc-dual-semconv-extractors
Feb 25, 2026
Merged

Add dual-semconv support to RPC attributes extractors#16130
trask merged 14 commits intoopen-telemetry:mainfrom
zeitlinger:pr3-rpc-dual-semconv-extractors

Conversation

@zeitlinger
Copy link
Member

@zeitlinger zeitlinger commented Feb 10, 2026

  • Part of Add RPC semantic convention stable opt-in support #15932 — split into smaller reviewable PRs. This is PR 3 of 5 (depends on Expand RpcAttributesGetter interface for stable RPC semconv support #16121).
  • 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.
  • Adds RpcAttributesGetter.isPredefined() for rpc.method vs rpc.method_original handling

#15871

…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.
@zeitlinger zeitlinger force-pushed the pr3-rpc-dual-semconv-extractors branch from a1e958a to fc4a9eb Compare February 10, 2026 14:19
@zeitlinger
Copy link
Member Author

@trask please take a look

@zeitlinger zeitlinger mentioned this pull request Feb 13, 2026
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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
… fixes

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger force-pushed the pr3-rpc-dual-semconv-extractors branch from e06b3a5 to 7b59479 Compare February 24, 2026 16:46
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@trask trask merged commit 55c6d21 into open-telemetry:main Feb 25, 2026
85 checks passed
@zeitlinger zeitlinger deleted the pr3-rpc-dual-semconv-extractors branch February 26, 2026 10:00
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.

3 participants