taklwu commented on code in PR #1428:
URL: https://github.com/apache/ratis/pull/1428#discussion_r3423615030


##########
ratis-common/src/main/java/org/apache/ratis/trace/TraceConfigKeys.java:
##########
@@ -30,8 +31,20 @@ public interface TraceConfigKeys {
   String ENABLED_KEY = PREFIX + ".enabled";
   boolean ENABLED_DEFAULT = false;
 
+  /**
+   * Whether Ratis should emit OpenTelemetry spans. When the key is absent from
+   * {@link RaftProperties}, the JVM system property {@value #ENABLED_KEY} is 
consulted so
+   * {@code -Draft.otel.tracing.enabled=true} works with empty example configs.
+   */
   static boolean enabled(RaftProperties properties, Consumer<String> logger) {
-    return getBoolean(properties::getBoolean, ENABLED_KEY, ENABLED_DEFAULT, 
logger);
+    if (properties.getRaw(ENABLED_KEY) != null) {
+      return getBoolean(properties::getBoolean, ENABLED_KEY, ENABLED_DEFAULT, 
logger);
+    }
+    final String fromSystem = System.getProperty(ENABLED_KEY);

Review Comment:
   sorry for coming back on this. 
   
   it's fine to remove JVM or system properties.
   
   When we want to use this tracing with Ozone, does it mean we need to create 
a special keys in Ozone e.g. `hdds.ratis.client.*` or `hdds.ratis.server.*` 
such that the open telemetry could be enabled? 



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

Reply via email to