Gargi-jais11 commented on code in PR #9957:
URL: https://github.com/apache/ozone/pull/9957#discussion_r2972952914


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/tracing/TracingUtil.java:
##########
@@ -93,16 +95,39 @@ private static void initialize(String serviceName) {
       // ignore and use the default value.
     }
 
+    String spanSamplingConfig = OTEL_TRACES_SAMPLER_CONFIG_DEFAULT;
+    try {
+      String spanStrConfig = System.getenv(OTEL_SPAN_SAMPLING);
+      if (spanStrConfig != null && !spanStrConfig.isEmpty()) {
+        spanSamplingConfig = spanStrConfig;
+      }
+    } catch (Exception ex) {
+      // ignore and use the default value.
+    }
+    // Pass the config to parseSpanSamplingConfig to get spans to eb sampled.

Review Comment:
   ```suggestion
       // Pass the config to parseSpanSamplingConfig to get spans to be sampled.
   ```



##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/tracing/TracingUtil.java:
##########
@@ -52,6 +52,8 @@ public final class TracingUtil {
   private static final String OTEL_EXPORTER_OTLP_ENDPOINT_DEFAULT = 
"http://localhost:4317";;
   private static final String OTEL_TRACES_SAMPLER_ARG = 
"OTEL_TRACES_SAMPLER_ARG";
   private static final double OTEL_TRACES_SAMPLER_RATIO_DEFAULT = 1.0;
+  private static final String OTEL_SPAN_SAMPLING = "OTEL_SPAN_SAMPLING";

Review Comment:
   Is it it default value for span sampling.?If yes consider renamingit as 
`OTEL_SPAN_SAMPLING_DEFAULT`



##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/tracing/TracingUtil.java:
##########
@@ -69,15 +71,15 @@ public static void initTracing(
     }
 
     try {
-      initialize(serviceName);
+      initialize(serviceName, conf);

Review Comment:
   Why are we adding conf here? It doesn't seem to be used anywhere.



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