You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/04/16 14:52:47 UTC

[GitHub] [hadoop-ozone] elek opened a new pull request #835: HDDS-3399. Update JaegerTracing

elek opened a new pull request #835: HDDS-3399. Update JaegerTracing
URL: https://github.com/apache/hadoop-ozone/pull/835
 
 
   ## What changes were proposed in this pull request?
   
   We currently use JaegerTracing 0.34.0. The latest is 1.2.0. We are several versions behind and should update. Note this update requires the latest version fo OpenTracing and has several breaking changes.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-3399
   
   ## How was this patch tested?
   
   ```
   cd hadoop-ozone/dist/target/ozone-..../compose/ozone
   export COMPOSE_FILE=docker-compose.yaml:profiling.yaml:monitoring.yaml
   export OZONE_REPLICATION_FACTOR=3
   ./run -d
   ```
   Executed freon + s3 crete bucket commands
   
   Traces were displayed in jaeger.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] adoroszlai commented on a change in pull request #835: HDDS-3399. Update JaegerTracing

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #835: HDDS-3399. Update JaegerTracing
URL: https://github.com/apache/hadoop-ozone/pull/835#discussion_r410052684
 
 

 ##########
 File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/tracing/TracingUtil.java
 ##########
 @@ -129,8 +132,53 @@ private static SpanContext extractParent(String parent, Tracer tracer) {
   private static boolean isTracingEnabled(
       org.apache.hadoop.conf.Configuration conf) {
     return conf.getBoolean(
-          ScmConfigKeys.HDDS_TRACING_ENABLED,
-          ScmConfigKeys.HDDS_TRACING_ENABLED_DEFAULT);
+        ScmConfigKeys.HDDS_TRACING_ENABLED,
+        ScmConfigKeys.HDDS_TRACING_ENABLED_DEFAULT);
+  }
+
+  /**
+   * Execute a new function inside an activated span.
+   */
+  public static <R> R executeInsideNewSpan(String spanName,
+      SupplierWithIOException<R> supplier)
+      throws IOException {
+    Span span = GlobalTracer.get()
+        .buildSpan(spanName).start();
+    try (Scope scope = GlobalTracer.get().activateSpan(span)) {
+      return supplier.get();
+    } catch (Exception ex) {
+      span.setTag("failed", true);
+      throw ex;
+    }
   }
 
+  /**
+   * Execute a new function inside an activated span.
+   */
+  public static <R> R executeInsideNewSpan(String spanName,
+      Supplier<R> supplier) {
+    Span span = GlobalTracer.get()
+        .buildSpan(spanName).start();
+    try (Scope scope = GlobalTracer.get().activateSpan(span)) {
+      return supplier.get();
+    } catch (Exception ex) {
+      span.setTag("failed", true);
+      throw ex;
+    }
 
 Review comment:
   This one, too.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] adoroszlai commented on a change in pull request #835: HDDS-3399. Update JaegerTracing

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #835: HDDS-3399. Update JaegerTracing
URL: https://github.com/apache/hadoop-ozone/pull/835#discussion_r410386536
 
 

 ##########
 File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/tracing/TracingUtil.java
 ##########
 @@ -129,8 +132,53 @@ private static SpanContext extractParent(String parent, Tracer tracer) {
   private static boolean isTracingEnabled(
       org.apache.hadoop.conf.Configuration conf) {
     return conf.getBoolean(
-          ScmConfigKeys.HDDS_TRACING_ENABLED,
-          ScmConfigKeys.HDDS_TRACING_ENABLED_DEFAULT);
+        ScmConfigKeys.HDDS_TRACING_ENABLED,
+        ScmConfigKeys.HDDS_TRACING_ENABLED_DEFAULT);
+  }
+
+  /**
+   * Execute a new function inside an activated span.
+   */
+  public static <R> R executeInsideNewSpan(String spanName,
+      SupplierWithIOException<R> supplier)
+      throws IOException {
+    Span span = GlobalTracer.get()
+        .buildSpan(spanName).start();
+    try (Scope scope = GlobalTracer.get().activateSpan(span)) {
+      return supplier.get();
+    } catch (Exception ex) {
+      span.setTag("failed", true);
+      throw ex;
+    }
 
 Review comment:
   master: <img width="1919" alt="s3shell_master" src="https://user-images.githubusercontent.com/6454655/79599994-b8d4ab00-80e6-11ea-93e3-3bc0ff5c9474.png">
   patch: <img width="1919" alt="s3shell_patch" src="https://user-images.githubusercontent.com/6454655/79600000-bbcf9b80-80e6-11ea-9f7f-1126a09bf60c.png">
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] adoroszlai commented on a change in pull request #835: HDDS-3399. Update JaegerTracing

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #835: HDDS-3399. Update JaegerTracing
URL: https://github.com/apache/hadoop-ozone/pull/835#discussion_r410056923
 
 

 ##########
 File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/tracing/TracingUtil.java
 ##########
 @@ -129,8 +132,53 @@ private static SpanContext extractParent(String parent, Tracer tracer) {
   private static boolean isTracingEnabled(
       org.apache.hadoop.conf.Configuration conf) {
     return conf.getBoolean(
-          ScmConfigKeys.HDDS_TRACING_ENABLED,
-          ScmConfigKeys.HDDS_TRACING_ENABLED_DEFAULT);
+        ScmConfigKeys.HDDS_TRACING_ENABLED,
+        ScmConfigKeys.HDDS_TRACING_ENABLED_DEFAULT);
+  }
+
+  /**
+   * Execute a new function inside an activated span.
+   */
+  public static <R> R executeInsideNewSpan(String spanName,
 
 Review comment:
   Nit: can we simplify to `executeInNewSpan`?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] elek commented on a change in pull request #835: HDDS-3399. Update JaegerTracing

Posted by GitBox <gi...@apache.org>.
elek commented on a change in pull request #835: HDDS-3399. Update JaegerTracing
URL: https://github.com/apache/hadoop-ozone/pull/835#discussion_r410160098
 
 

 ##########
 File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/tracing/TracingUtil.java
 ##########
 @@ -129,8 +132,53 @@ private static SpanContext extractParent(String parent, Tracer tracer) {
   private static boolean isTracingEnabled(
       org.apache.hadoop.conf.Configuration conf) {
     return conf.getBoolean(
-          ScmConfigKeys.HDDS_TRACING_ENABLED,
-          ScmConfigKeys.HDDS_TRACING_ENABLED_DEFAULT);
+        ScmConfigKeys.HDDS_TRACING_ENABLED,
+        ScmConfigKeys.HDDS_TRACING_ENABLED_DEFAULT);
+  }
+
+  /**
+   * Execute a new function inside an activated span.
+   */
+  public static <R> R executeInsideNewSpan(String spanName,
+      SupplierWithIOException<R> supplier)
+      throws IOException {
+    Span span = GlobalTracer.get()
+        .buildSpan(spanName).start();
+    try (Scope scope = GlobalTracer.get().activateSpan(span)) {
+      return supplier.get();
+    } catch (Exception ex) {
+      span.setTag("failed", true);
+      throw ex;
+    }
 
 Review comment:
   Thanks to test it @adoroszlai . I didn't notice any problem with the spans when I tested, but yes, it seems to be missing. Added them.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] adoroszlai commented on a change in pull request #835: HDDS-3399. Update JaegerTracing

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #835: HDDS-3399. Update JaegerTracing
URL: https://github.com/apache/hadoop-ozone/pull/835#discussion_r410051973
 
 

 ##########
 File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/tracing/TracingUtil.java
 ##########
 @@ -129,8 +132,53 @@ private static SpanContext extractParent(String parent, Tracer tracer) {
   private static boolean isTracingEnabled(
       org.apache.hadoop.conf.Configuration conf) {
     return conf.getBoolean(
-          ScmConfigKeys.HDDS_TRACING_ENABLED,
-          ScmConfigKeys.HDDS_TRACING_ENABLED_DEFAULT);
+        ScmConfigKeys.HDDS_TRACING_ENABLED,
+        ScmConfigKeys.HDDS_TRACING_ENABLED_DEFAULT);
+  }
+
+  /**
+   * Execute a new function inside an activated span.
+   */
+  public static <R> R executeInsideNewSpan(String spanName,
+      SupplierWithIOException<R> supplier)
+      throws IOException {
+    Span span = GlobalTracer.get()
+        .buildSpan(spanName).start();
+    try (Scope scope = GlobalTracer.get().activateSpan(span)) {
+      return supplier.get();
+    } catch (Exception ex) {
+      span.setTag("failed", true);
+      throw ex;
+    }
 
 Review comment:
   Span should be finished.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] adoroszlai commented on a change in pull request #835: HDDS-3399. Update JaegerTracing

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #835: HDDS-3399. Update JaegerTracing
URL: https://github.com/apache/hadoop-ozone/pull/835#discussion_r410386536
 
 

 ##########
 File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/tracing/TracingUtil.java
 ##########
 @@ -129,8 +132,53 @@ private static SpanContext extractParent(String parent, Tracer tracer) {
   private static boolean isTracingEnabled(
       org.apache.hadoop.conf.Configuration conf) {
     return conf.getBoolean(
-          ScmConfigKeys.HDDS_TRACING_ENABLED,
-          ScmConfigKeys.HDDS_TRACING_ENABLED_DEFAULT);
+        ScmConfigKeys.HDDS_TRACING_ENABLED,
+        ScmConfigKeys.HDDS_TRACING_ENABLED_DEFAULT);
+  }
+
+  /**
+   * Execute a new function inside an activated span.
+   */
+  public static <R> R executeInsideNewSpan(String spanName,
+      SupplierWithIOException<R> supplier)
+      throws IOException {
+    Span span = GlobalTracer.get()
+        .buildSpan(spanName).start();
+    try (Scope scope = GlobalTracer.get().activateSpan(span)) {
+      return supplier.get();
+    } catch (Exception ex) {
+      span.setTag("failed", true);
+      throw ex;
+    }
 
 Review comment:
   `$ ozone s3 path asdf`
   
   master: <img width="1919" alt="s3shell_master" src="https://user-images.githubusercontent.com/6454655/79599994-b8d4ab00-80e6-11ea-93e3-3bc0ff5c9474.png">
   patch: <img width="1919" alt="s3shell_patch" src="https://user-images.githubusercontent.com/6454655/79600000-bbcf9b80-80e6-11ea-9f7f-1126a09bf60c.png">
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org