feat(otel): standardize trace span names and semantic attributes - #3551
Draft
jiaming2li wants to merge 3 commits into
Draft
feat(otel): standardize trace span names and semantic attributes#3551jiaming2li wants to merge 3 commits into
jiaming2li wants to merge 3 commits into
Conversation
Enhance OpenTelemetry tracing diagnostics (issue apache#3338, scope item 1). - Standardize span names as "dubbo.consumer <service>/<method>" and "dubbo.provider <service>/<method>" for both client and server filters. - Enrich span attributes, preferring OTel semantic conventions where they exist (rpc.system, rpc.service, rpc.method, server.address, server.port) and using a stable dubbo.* namespace for Dubbo-specific fields (dubbo.side, dubbo.protocol, dubbo.group, dubbo.version). - Extract shared buildSpanName/buildSpanAttributes helpers to remove the duplicated span-construction logic between the two filters. - Add tests asserting span name, span kind, and attributes for both sides using an in-memory span recorder. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Reformat imports in the trace filter/semconv per imports-formatter. - Update TestTripleClientOTELTraceparentIsolation to look up the consumer spans by the standardized "dubbo.consumer <service>/<method>" name, since the span is no longer named after the bare method. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Satisfy the repo's imports-formatter (make check-fmt), which requires three separate import blocks. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3551 +/- ##
==========================================
+ Coverage 55.23% 55.24% +0.01%
==========================================
Files 462 462
Lines 36005 36018 +13
==========================================
+ Hits 19886 19899 +13
Misses 14562 14562
Partials 1557 1557 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
cool work 其实还是要以实际出发 不用完全按着issue里面说的做 |
Alanxtl
reviewed
Jul 28, 2026
Comment on lines
+37
to
+43
| DubboSideKey = attribute.Key("dubbo.side") | ||
| // DubboProtocolKey records the Dubbo protocol in use, e.g. "dubbo", "tri". | ||
| DubboProtocolKey = attribute.Key("dubbo.protocol") | ||
| // DubboGroupKey records the Dubbo service group. | ||
| DubboGroupKey = attribute.Key("dubbo.group") | ||
| // DubboVersionKey records the Dubbo service version. | ||
| DubboVersionKey = attribute.Key("dubbo.version") |
Member
There was a problem hiding this comment.
dubbo.side这些常量可以移到common/const里面
Comment on lines
+46
to
+51
| const ( | ||
| // sideConsumer / sideProvider are the values used for DubboSideKey and the | ||
| // span-name prefix ("dubbo.consumer" / "dubbo.provider"). | ||
| sideConsumer = "consumer" | ||
| sideProvider = "provider" | ||
| ) |
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.



Enhance OpenTelemetry tracing diagnostics (Fixes #3338, scope item 1).
dubbo.consumer <service>/<method>(client) anddubbo.provider <service>/<method>(server).rpc.system=apache_dubbo,rpc.service,rpc.method,server.address,server.port.dubbo.*namespace:dubbo.side,dubbo.protocol,dubbo.group,dubbo.version.buildSpanName/buildSpanAttributeshelpers to remove the duplicated span-construction logic between the client and server filters.