sumitagrawl commented on code in PR #12039:
URL: https://github.com/apache/ozone/pull/12039#discussion_r4779333423


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/tracing/TracingUtil.java:
##########
@@ -64,15 +67,23 @@ public final class TracingUtil {
   private static volatile boolean isInit = false;
   private static volatile boolean tracingEnabled;
   private static volatile boolean applicationAware;
+  private static volatile boolean internalTracingEnabled;
   private static Tracer tracer = OpenTelemetry.noop().getTracer("noop");
   private static volatile SdkTracerProvider sdkTracerProvider;
   private static BatchSpanProcessor batchSpanProcessor;
   private static boolean mdcContextStorageInstalled;
   public static final String GLOBAL_TRACER_NAME = "ozone";
+  private static final IdGenerator NON_SAMPLED_ID_GENERATOR = 
IdGenerator.random();
 
   private TracingUtil() {
   }
 
+  /** OTel no-op span with a valid, non-sampled context: nested and remote 
spans inherit "not sampled". */
+  private static Span nonSampledSpan() {
+    return 
Span.wrap(SpanContext.create(NON_SAMPLED_ID_GENERATOR.generateTraceId(),

Review Comment:
   We can use io.opentelemetry.api.trace.Span#getInvalid() to get no-ops span



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to