Sumit Agrawal created HDDS-13803:
------------------------------------
Summary: Client aware tracing
Key: HDDS-13803
URL: https://issues.apache.org/jira/browse/HDDS-13803
Project: Apache Ozone
Issue Type: Sub-task
Reporter: Sumit Agrawal
h1. Tracing Support for Client
The Ozone client needs the flexibility to either initiate a new span or
continue an existing application-level trace by creating a child span. A
specific scenario arises when the Ozone client should only trace if it's
explicitly enabled to continue an application's existing trace.
* *Application with Active Trace:*
* The Ozone client checks for an active span from the application's context.
* If an active span is found, the Ozone client continues that trace as a child
span, using the application's existing trace context.
* *Application Without Active Trace:*
* If the application has not initiated a trace, the Ozone client will not
create a new trace independently when ozone.tracing.enabled is false.
Typically, ozone.tracing.enabled is false, indicating that no tracing should
occur by default. However, for Ozone clients, dynamically updating this
configuration based on the application's implementation is often not feasible.
To address this, the Ozone client will leverage the application's tracer to
continue tracing as a child span. This specific behavior will be controlled by
an additional flag:
* ozone.tracing.client.application-aware (default: true)
When ozone.tracing.client.application-aware is true, the Ozone client will
utilize tracers provided by the application context. This allows the Ozone
client to trace even if the ozone.tracing.enabled configuration is false,
provided the application has configured and enabled its own tracing.
*Mechanism for Client-Side Trace Continuation:*
// In a deep part of the code, get the current active span from the Context
Span currentSpan = Span.current();
// Get the tracer that created this span
Tracer tracer = currentSpan.getTracer();
// Using this tracer, a child span can be created and traced
// Example:
tracer.spanBuilder("OzoneClientOperation").setParent(currentSpan.getSpanContext()).startSpan();
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]