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


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/tracing/SuppressedSpan.java:
##########
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hdds.tracing;
+
+import io.opentelemetry.api.common.AttributeKey;
+import io.opentelemetry.api.common.Attributes;
+import io.opentelemetry.api.trace.Span;
+import io.opentelemetry.api.trace.SpanContext;
+import io.opentelemetry.api.trace.StatusCode;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Non-recording span marking that tracing is suppressed for timer-driven 
internal work
+ * whose root was not started. Spans requested under it are not created, and 
the suppression
+ * is propagated to remote peers by {@link TracingUtil#exportCurrentSpan()}.
+ */
+final class SuppressedSpan implements Span {

Review Comment:
   why do we need this suppressed Span. In general,  Open Telemetry No op 
should taken care if you don't need to export.
   
   Next thing if we use the Annotation approach . the SkipTracing Should help 
with this functionality .



##########
hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/tracing/TestSpanCollector.java:
##########
@@ -53,14 +53,19 @@ private TestSpanCollector() {
 
   /** Registers a collecting SDK as the global OpenTelemetry and initializes 
Ozone tracing with it. */
   public static TestSpanCollector install(String serviceName) {
+    OzoneConfiguration conf = new OzoneConfiguration();
+    conf.setBoolean("ozone.tracing.enabled", true);
+    return install(serviceName, conf);
+  }
+
+  /** Same as {@link #install(String)} with an explicit configuration (e.g. 
internal tracing keys). */
+  public static TestSpanCollector install(String serviceName, 
OzoneConfiguration conf) {

Review Comment:
   why are we adding this new method . i don't see any test unit test 
modifcation.
   



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/KeyDeletingService.java:
##########


Review Comment:
   In Ozone, KeyDeletingService (BackgroundService) is the actual background 
job that handles scheduling, getTasks() submission, and thread lifecycle—while 
KeyDeletingTask is just the unit of work executed by it. Adding span in a sub 
methods will leave missing e2e span coverage.
   
   I'd recommend using a proxy approach for KeyDeletingTask (and other 
background tasks) so we can cover KeyDeletingService end-to-end—from task 
submission to scheduler execution, as well as interruption and resumption 
scenarios. For cases where we specifically need visibility into an internal 
method, we can always add an explicit span there.



##########
hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/tracing/TestSpanCollector.java:
##########
@@ -53,14 +53,19 @@ private TestSpanCollector() {
 
   /** Registers a collecting SDK as the global OpenTelemetry and initializes 
Ozone tracing with it. */
   public static TestSpanCollector install(String serviceName) {
+    OzoneConfiguration conf = new OzoneConfiguration();
+    conf.setBoolean("ozone.tracing.enabled", true);
+    return install(serviceName, conf);
+  }
+
+  /** Same as {@link #install(String)} with an explicit configuration (e.g. 
internal tracing keys). */
+  public static TestSpanCollector install(String serviceName, 
OzoneConfiguration conf) {

Review Comment:
   i don't think we need this change. it looks similar to me as previous.



-- 
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