Skip to content

Add RPC semantic convention stability infrastructure#16112

Merged
trask merged 3 commits intoopen-telemetry:mainfrom
zeitlinger:pr/rpc-semconv-1-infrastructure
Feb 6, 2026
Merged

Add RPC semantic convention stability infrastructure#16112
trask merged 3 commits intoopen-telemetry:mainfrom
zeitlinger:pr/rpc-semconv-1-infrastructure

Conversation

@zeitlinger
Copy link
Member

@zeitlinger zeitlinger commented Feb 6, 2026

Towards #15932

Add infrastructure for RPC stable semantic convention opt-in support:

  • Add emitOldRpcSemconv() and emitStableRpcSemconv() flags to SemconvStability
  • Add stableRpcSystemName() mapping function (apache_dubbo→dubbo, connect_rpc→connectrpc)
  • Add getOldRpcMethodAttributeKey() helper to avoid attribute key clashes in dual mode
  • Add getOldRpcMetricAttributes() helper to map deprecated key to stable key for metrics
  • Add 'rpc' and 'rpc/dup' to test task JVM args in build.gradle.kts

The stability flags default to emitting old semconv only, ensuring no behavioral changes. This infrastructure enables future PRs to add stable RPC semantic convention support.

#15871

Add infrastructure for RPC stable semantic convention opt-in support:
- Add emitOldRpcSemconv() and emitStableRpcSemconv() flags to SemconvStability
- Add stableRpcSystemName() mapping function (apache_dubbo→dubbo, connect_rpc→connectrpc)
- Add getOldRpcMethodAttributeKey() helper to avoid attribute key clashes in dual mode
- Add getOldRpcMetricAttributes() helper to map deprecated key to stable key for metrics
- Add 'rpc' and 'rpc/dup' to test task JVM args in build.gradle.kts

The stability flags default to emitting old semconv only, ensuring no behavioral changes.
This infrastructure enables future PRs to add stable RPC semantic convention support.

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger self-assigned this Feb 6, 2026
@zeitlinger zeitlinger requested a review from a team as a code owner February 6, 2026 11:20
Comment on lines +184 to +198
public static AttributeKey<String> getOldRpcMethodAttributeKey() {
if (emitStableRpcSemconv()) {
// to avoid clash when both semconv are emitted
return RPC_METHOD_OLD;
}
return RPC_METHOD;
}

public static Attributes getOldRpcMetricAttributes(Attributes attributes) {
if (emitStableRpcSemconv()) {
// need to copy attributes
return attributes.toBuilder().put(RPC_METHOD, attributes.get(RPC_METHOD_OLD)).build();
}
return attributes;
}
Copy link
Member

Choose a reason for hiding this comment

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

why are these two methods needed? doesn't look like db semconv needed them?

Copy link
Member Author

Choose a reason for hiding this comment

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

when we emit both semantic conventions we want to keep track of both method styles - so they can be added to the corresponding metrics. Spans will get new method in that case.

Copy link
Member

Choose a reason for hiding this comment

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

I'm still not following, let's just remove for now and you can add them back when you need them, then I can understand the context better and whether there's better option or not

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

@trask trask enabled auto-merge (squash) February 6, 2026 19:58
@trask trask merged commit d9e61af into open-telemetry:main Feb 6, 2026
85 checks passed
@zeitlinger zeitlinger deleted the pr/rpc-semconv-1-infrastructure branch February 9, 2026 10:38
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.

2 participants