Skip to content

[#noissue] Support Release Candidate rpc semconv keys in the OTLP tra…#14053

Merged
jaehong-kim merged 1 commit into
pinpoint-apm:masterfrom
jaehong-kim:feat/otlptrace-rpc-semconv-rc
Jul 23, 2026
Merged

[#noissue] Support Release Candidate rpc semconv keys in the OTLP tra…#14053
jaehong-kim merged 1 commit into
pinpoint-apm:masterfrom
jaehong-kim:feat/otlptrace-rpc-semconv-rc

Conversation

@jaehong-kim

Copy link
Copy Markdown
Contributor

…ce collector

The RPC semantic conventions reached Release Candidate with renames the collector only knew by their deprecated 1.x spellings:

  • rpc.system -> rpc.system.name: resolved via a shared key-precedence helper (RC key before deprecated), consistent with the existing http.request.method/http.method handling. Only the consumed variant is filtered from the raw attributes.
  • rpc.system value "apache_dubbo" -> "dubbo": both spellings resolve to APACHE_DUBBO_PROVIDER/CONSUMER in the server/client type resolvers.
  • rpc.grpc.status_code (int 0-16) -> rpc.response.status_code (string status NAME, e.g. "OK"): promoted to the grpc.status annotation. The RC key is shared by all rpc systems, so it is only interpreted when rpc.system(.name) is grpc — a jsonrpc error code like "-32602" must not render as a gRPC status. Numeric strings under the RC key are defensively translated to the name representation.

rpc.service (deprecated, folded into the fully-qualified rpc.method) is kept as an endPoint fallback for 1.x SDKs; no behavior change there.

…ce collector

The RPC semantic conventions reached Release Candidate with renames the
collector only knew by their deprecated 1.x spellings:

- rpc.system -> rpc.system.name: resolved via a shared key-precedence
  helper (RC key before deprecated), consistent with the existing
  http.request.method/http.method handling. Only the consumed variant
  is filtered from the raw attributes.
- rpc.system value "apache_dubbo" -> "dubbo": both spellings resolve to
  APACHE_DUBBO_PROVIDER/CONSUMER in the server/client type resolvers.
- rpc.grpc.status_code (int 0-16) -> rpc.response.status_code (string
  status NAME, e.g. "OK"): promoted to the grpc.status annotation. The
  RC key is shared by all rpc systems, so it is only interpreted when
  rpc.system(.name) is grpc — a jsonrpc error code like "-32602" must
  not render as a gRPC status. Numeric strings under the RC key are
  defensively translated to the name representation.

rpc.service (deprecated, folded into the fully-qualified rpc.method) is
kept as an endPoint fallback for 1.x SDKs; no behavior change there.
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the OTLP trace collector’s RPC attribute handling to support OpenTelemetry RPC semantic convention Release Candidate (RC) key/value changes, while maintaining compatibility with deprecated 1.x spellings. It extends service-type dispatch and gRPC status promotion logic to recognize the RC keys and adds/updates tests to validate the behavior.

Changes:

  • Add rpc.system.name precedence over deprecated rpc.system for ServiceType dispatch, shared between root spans and span events.
  • Support RC Dubbo spelling (dubbo) alongside deprecated apache_dubbo in client/server type resolvers.
  • Promote RC rpc.response.status_code to the existing grpc.status annotation only when the RPC system is gRPC, with numeric-string defensive translation; add corresponding test coverage.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
otlptrace/otlptrace-collector/src/test/java/com/navercorp/pinpoint/otlp/trace/collector/mapper/OtlpTraceSpanMapperTest.java Adds root-span tests for RC rpc.system.name precedence and rpc.response.status_code gRPC-status promotion gating.
otlptrace/otlptrace-collector/src/test/java/com/navercorp/pinpoint/otlp/trace/collector/mapper/OtlpTraceSpanEventMapperTest.java Adds span-event tests for RC rpc.system.name dispatch and RC gRPC status promotion.
otlptrace/otlptrace-collector/src/test/java/com/navercorp/pinpoint/otlp/trace/collector/mapper/OtlpServerTypeResolverTest.java Adds test ensuring dubbo resolves to the same server ServiceType as apache_dubbo.
otlptrace/otlptrace-collector/src/test/java/com/navercorp/pinpoint/otlp/trace/collector/mapper/OtlpClientTypeResolverTest.java Adds test ensuring dubbo resolves to the same client ServiceType as apache_dubbo.
otlptrace/otlptrace-collector/src/main/java/com/navercorp/pinpoint/otlp/trace/collector/mapper/OtlpTraceSpanMapper.java Refactors server-side RPC system extraction into a shared RC-aware helper (getRpcSystem).
otlptrace/otlptrace-collector/src/main/java/com/navercorp/pinpoint/otlp/trace/collector/mapper/OtlpTraceSpanEventMapper.java Switches client span-event RPC system dispatch to use the shared RC-aware helper.
otlptrace/otlptrace-collector/src/main/java/com/navercorp/pinpoint/otlp/trace/collector/mapper/OtlpTraceConstants.java Adds RC constants (rpc.system.name, rpc.response.status_code, dubbo) and key-precedence lists.
otlptrace/otlptrace-collector/src/main/java/com/navercorp/pinpoint/otlp/trace/collector/mapper/OtlpServerTypeResolver.java Maps dubbo to the existing Dubbo provider ServiceType name.
otlptrace/otlptrace-collector/src/main/java/com/navercorp/pinpoint/otlp/trace/collector/mapper/OtlpGrpcStatusResolver.java Adds RC rpc.response.status_code handling gated by RPC system == gRPC, with numeric-string normalization.
otlptrace/otlptrace-collector/src/main/java/com/navercorp/pinpoint/otlp/trace/collector/mapper/OtlpClientTypeResolver.java Maps dubbo to the existing Dubbo consumer ServiceType name.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +500 to 510
static @Nullable String getRpcSystem(Map<String, AttributeValue> attributes, Set<String> consumedKeys) {
for (String key : OtlpTraceConstants.RPC_SYSTEM_KEYS) {
final String system = AttributeUtils.getAttributeStringValue(attributes, key, null);
if (system != null) {
consumedKeys.add(key);
return system;
}
}
return null;
}
}
Comment on lines 81 to +90
public static GrpcStatus resolve(Map<String, AttributeValue> attributes) {
// RC generic key first — gated on the rpc system actually being grpc (peek only; the
// status key itself is what the caller consumes via sourceKey()).
if (isGrpcSystem(attributes)) {
final String status = AttributeUtils.getAttributeStringValue(
attributes, OtlpTraceConstants.ATTRIBUTE_KEY_RPC_RESPONSE_STATUS_CODE, null);
if (status != null && !status.isEmpty()) {
return new GrpcStatus(normalizeStatus(status),
OtlpTraceConstants.ATTRIBUTE_KEY_RPC_RESPONSE_STATUS_CODE);
}
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 34.65%. Comparing base (1f6d5a8) to head (1fb8235).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
...trace/collector/mapper/OtlpGrpcStatusResolver.java 92.30% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #14053      +/-   ##
============================================
- Coverage     34.71%   34.65%   -0.07%     
- Complexity    12289    12306      +17     
============================================
  Files          4192     4203      +11     
  Lines         99558    99864     +306     
  Branches      10654    10697      +43     
============================================
+ Hits          34565    34606      +41     
- Misses        62053    62315     +262     
- Partials       2940     2943       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jaehong-kim
jaehong-kim merged commit 6af8423 into pinpoint-apm:master Jul 23, 2026
6 of 7 checks passed
@jaehong-kim
jaehong-kim deleted the feat/otlptrace-rpc-semconv-rc branch July 23, 2026 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants