Repository navigation
Conversation
…relation Enrich Dubbo RPC spans with application identity and normalize legacy dubbo-go ServiceKey interfaces without changing rpc.service. Preserve explicit group/version attributes for correlation metadata.
Provision a stable Prometheus datasource UID and Jaeger tracesToMetrics links using application, normalized interface and method identity. Add provider/consumer request-rate queries, five-minute time shifts, correlation documentation and the existing static contract verification script.
|
AlexStocks
left a comment
There was a problem hiding this comment.
结论:方向正确,可以合入
PR 只改 5 个文件(+419/-1),changed_files=5 与 Diff 一致,没有 Go 代码路径变化,风险集中在 Collector 配置与文档的准确性上。
已核对
otelCollector-configuration.yaml 的 transform/dubbo_application 与文档描述一致,处理顺序正确:
- 从
rpc.service复制出dubbo.metric.interface; replace_pattern(..., "^[^/]+/", "")去掉[group/]前缀;- 当
dubbo.version缺失且 interface 以:version结尾时,先取出dubbo.metric.version,再从 interface 剥掉版本; dubbo.metric.group先按^[^/]+/.+提取,再用显式的dubbo.group/dubbo.version覆盖。
这与 scripts/verify-trace-metric-collector.py 里的 11 个 fixture(含 COLON_IN_GROUP、EXPLICIT_PRECEDENCE、NO_RESOURCE_NAME)能一一对应;脚本还会断言 pipeline 顺序必须是 k8sattributes, transform/dubbo_application,这个检查很有价值。
P3 · 验证脚本没有 CI 执行路径
verify-trace-metric-collector.py 需要本机存在 otelcol-contrib 0.112.0 原生可执行文件,.github/workflows 里没有任何作业会运行它;Windows 脚本版本同理。也就是说,这份 419 行的配置改动目前只有作者本地验证。
建议后续加一个 job:用 otel/opentelemetry-collector-contrib:0.112.0 容器跑该脚本(脚本本身已支持 --collector 指定二进制)。否则 Collector 升版时这里会在无人察觉的情况下失效。
P3 · 两套脚本重复维护
Python 版(178 行)与 Windows 版维护同一份 fixture 矩阵。当前两份内容一致,但后续任何规则调整都需要改两处,容易漂移。若 Windows 版本只是为了本地验证,建议让它调用 Python 版本,或把 fixture 抽成一个 JSON 文件由两者共用。
P3 · error_mode: ignore 会掩盖配置错误
transform/dubbo_application 使用 error_mode: ignore。运行时这能避免一条坏 span 影响整批,但也会让 OTTL 语句里的拼写错误静默通过。配合上面的 CI 检查会更稳妥。
明白 |







Summary
Add Provider Request Rate and Consumer Request Rate links to Dubbo RPC spans in Jaeger. In Dubbo Admin's Grafana Trace Explore view, users can expand a span and open its Prometheus query through Grafana's native Trace-to-Metrics support, retaining the trace in Split Explore.
Correlation uses application, interface, and method and queries existing Dubbo request counters. It adds no Admin API, Vue page, spanmetrics pipeline, or RPC metric. Results are aggregate request rates for the RPC identity in the selected window, not metrics exclusive to one trace.
Motivation
Metric and Trace views currently require users to switch manually and re-enter the RPC identity and time range.
Some older dubbo-go versions also emit
rpc.serviceas[group/]interface[:version], while Prometheus uses a plaininterfacelabel. Direct mapping may return no matching metrics. This PR adds normalized correlation attributes without changing the original trace identity.Changes
1. Supply metric-correlation identity without overwriting original trace fields
k8sattributesin the existing Collector trace pipeline, restricted torpc.system=apache_dubbospans meeting the relevant field conditions.service.nameinto span attributedubbo.applicationfor mapping toapplication_name.dubbo.metric.interfacefrom nonemptyrpc.service, removing legacy ServiceKey group/version components while preserving plain Java/Go interface names.rpc.serviceand resource identity. Retain parsed group/version separately; explicitdubbo.group/dubbo.versionattributes take precedence.2. Use Grafana's native span-to-Prometheus correlation
dubbo-admin-prometheusand reference it from Jaeger'stracesToMetricsconfiguration.dubbo.applicationapplication_namedubbo.metric.interfaceinterfacerpc.methodmethodProvide two links:
$$__tagsin provisioning so Grafana's environment-variable interpolation preserves runtime$__tagsfor selected-span matchers.spanStartTimeShift="-5m"andspanEndTimeShift="5m": span start minus five minutes through span end plus five minutes. Do not use the unsupported+5minterval.span.kind.3. Add repeatable checks and deployment guidance
Verification
The static checks below were rerun on the rebased branch. Runtime/browser PASS entries are results recorded in the supplied verification draft for the earlier implementation; they were not rerun after this rebase and are not a claim of fresh end-to-end acceptance of the rebased branch.
git diff --check upstream/develop HEADpwsh -File scripts/verify-trace-metric-servicekey.ps1Earlier human proof used Grafana 12.1.0, Jaeger 1.70, and real Dubbo Java 3.2.16 to verify native span links, RPC-label queries, and Split Explore inside the Admin iframe. This does not establish support for every SDK/version combination.
Review Focus
service.namematches metricapplication_namein target deployments.$__tagsand the intended span-relative time range at runtime.Compatibility / Impact
Impact:
Scope
Included
Not Included
Related Issue
Fixes #1606.
Relates to #1524.
Dependency
Built on the Collector infrastructure merged in #1584. Rebased onto upstream
developatf1c3f3a; this PR contains only its own two commits and does not depend on #1587 or #1591.