Skip to content

HDDS-17581. Add TracingUtil span helpers and span-kind aware tracing proxies - #11852

Draft
rajeshkumarchandolu wants to merge 5 commits into
apache:masterfrom
rajeshkumarchandolu:tracing-common-span-helpers
Draft

rajeshkumarchandolu wants to merge 5 commits into
apache:masterfrom
rajeshkumarchandolu:tracing-common-span-helpers

Conversation

@rajeshkumarchandolu

@rajeshkumarchandolu rajeshkumarchandolu commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

  • Tracing proxies:
    • TraceAllMethod takes a SpanKind, and @InternalSpanKind can also be put on a delegate class.
    • New createProxy(delegate, itf, spanKind) names spans <delegate class>.<method>, for example KeyManagerImpl.listStatus. It works without a current span, so it can wrap components created at startup.
    • createProxy(delegate, itf, conf) now creates INTERNAL spans. New createClientProxy creates CLIENT spans. Existing RPC client proxies (SCM clients in HAUtils/HddsServerUtil, the OM client in RpcClient) switch to it, so their spans stay CLIENT.
  • Error recording: proxy spans, executeInSpan and OzoneProtocolMessageDispatcher record the exception and set the ERROR status with its message.
  • Span helpers: createSpan, recordException, addAttributesToCurrentSpan and addEventToCurrentSpan do nothing when the current span isn't recording. New SpanAttributeKeys holds shared attribute keys.
  • Tests: new TestSpanCollector for asserting on finished spans. Test tracer providers get a span processor, because with OpenTelemetry 1.67 a provider without one returns no-op spans.

These changes are needed for the OM, SCM and datanode tracing work (HDDS-17586, HDDS-17593, HDDS-17594). That work will create internal service components as tracing proxies, so that every call to them gets its own span, and will add attributes and errors to spans from inside request handling. The current utilities can't do this: proxies can't wrap components created at startup, proxy spans are always CLIENT and named after the interface, and exceptions aren't recorded on spans. This PR adds only the common building blocks; it doesn't add new spans to any service.

There are no proto, RPC, configuration or storage changes. With tracing disabled and application-aware mode off, behaviour is unchanged.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-17581

How was this patch tested?

@rajeshkumarchandolu
rajeshkumarchandolu force-pushed the tracing-common-span-helpers branch 2 times, most recently from 047a651 to 0cea7a6 Compare October 30, 2026 02:07
@priyeshkaratha

Copy link
Copy Markdown
Member

Hi @rajeshkumarchandolu Please raise PR with proper Jira and follow the guidline

@priyeshkaratha
priyeshkaratha marked this pull request as draft October 30, 2026 05:04
@rajeshkumarchandolu rajeshkumarchandolu changed the title Tracing common span helpers HDDS-17581 Add TracingUtil span helpers and span-kind aware tracing proxies Oct 30, 2026
@rajeshkumarchandolu rajeshkumarchandolu changed the title HDDS-17581 Add TracingUtil span helpers and span-kind aware tracing proxies HDDS-17581. Add TracingUtil span helpers and span-kind aware tracing proxies Oct 30, 2026
@rajeshkumarchandolu
rajeshkumarchandolu force-pushed the tracing-common-span-helpers branch from 0cea7a6 to 7b4dd1d Compare October 30, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants