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


##########
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:
   For Ozone, we may add a prefix to set any Ratis conf; see 
https://github.com/apache/ozone/blob/master/hadoop-hdds/docs/content/feature/multi-raft-support.md#advanced-ratis-configuration



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