[ 
https://issues.apache.org/jira/browse/HADOOP-15566?focusedWorklogId=581236&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-581236
 ]

ASF GitHub Bot logged work on HADOOP-15566:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/Apr/21 18:38
            Start Date: 12/Apr/21 18:38
    Worklog Time Spent: 10m 
      Work Description: steveloughran commented on a change in pull request 
#2816:
URL: https://github.com/apache/hadoop/pull/2816#discussion_r601307384



##########
File path: hadoop-common-project/hadoop-common/pom.xml
##########
@@ -371,6 +371,31 @@
       <artifactId>lz4-java</artifactId>
       <scope>provided</scope>
     </dependency>
+    <dependency>
+      <groupId>io.opentelemetry</groupId>
+      <artifactId>opentelemetry-api</artifactId>
+      <version>1.0.0</version>

Review comment:
       all these imports 
   1. need to be declared in hadoop-project/pom.xml
   2. and if the api and sdk are to be kept in sync, with the version defined 
in a property
   3. The hadoop-common import should declare as <provided> all those only 
needed for build and test.

##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/Span.java
##########
@@ -17,28 +17,51 @@
  */
 package org.apache.hadoop.tracing;
 
+import io.opentelemetry.context.Scope;
+
 import java.io.Closeable;
 
 public class Span implements Closeable {
-
+  io.opentelemetry.api.trace.Span span = null;
   public Span() {
   }
 
+  public Span(io.opentelemetry.api.trace.Span span){
+    this.span = span;
+  }
+
   public Span addKVAnnotation(String key, String value) {
+    if(span != null){
+      span.setAttribute(key, value);
+    }
     return this;
   }
 
   public Span addTimelineAnnotation(String msg) {
+    if(span != null){
+      span.addEvent(msg);
+    }
     return this;
   }
 
   public SpanContext getContext() {
-    return null;
+    return  new SpanContext(span.getSpanContext());
   }
 
   public void finish() {
+    close();
   }
 
   public void close() {
+    if(span != null){
+      span.end();

Review comment:
       set span to null, presumably

##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/Span.java
##########
@@ -17,28 +17,51 @@
  */
 package org.apache.hadoop.tracing;
 
+import io.opentelemetry.context.Scope;
+
 import java.io.Closeable;
 
 public class Span implements Closeable {
-
+  io.opentelemetry.api.trace.Span span = null;
   public Span() {
   }
 
+  public Span(io.opentelemetry.api.trace.Span span){
+    this.span = span;
+  }
+
   public Span addKVAnnotation(String key, String value) {
+    if(span != null){
+      span.setAttribute(key, value);
+    }
     return this;
   }
 
   public Span addTimelineAnnotation(String msg) {
+    if(span != null){
+      span.addEvent(msg);
+    }
     return this;
   }
 
   public SpanContext getContext() {
-    return null;
+    return  new SpanContext(span.getSpanContext());

Review comment:
       what if span == null

##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/Span.java
##########
@@ -17,28 +17,51 @@
  */
 package org.apache.hadoop.tracing;
 
+import io.opentelemetry.context.Scope;
+
 import java.io.Closeable;
 
 public class Span implements Closeable {
-
+  io.opentelemetry.api.trace.Span span = null;

Review comment:
       private




-- 
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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 581236)
    Time Spent: 1h  (was: 50m)

> Support OpenTelemetry
> ---------------------
>
>                 Key: HADOOP-15566
>                 URL: https://issues.apache.org/jira/browse/HADOOP-15566
>             Project: Hadoop Common
>          Issue Type: New Feature
>          Components: metrics, tracing
>    Affects Versions: 3.1.0
>            Reporter: Todd Lipcon
>            Assignee: Siyao Meng
>            Priority: Major
>              Labels: pull-request-available, security
>         Attachments: HADOOP-15566.000.WIP.patch, OpenTelemetry Support Scope 
> Doc v2.pdf, OpenTracing Support Scope Doc.pdf, Screen Shot 2018-06-29 at 
> 11.59.16 AM.png, ss-trace-s3a.png
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> The HTrace incubator project has voted to retire itself and won't be making 
> further releases. The Hadoop project currently has various hooks with HTrace. 
> It seems in some cases (eg HDFS-13702) these hooks have had measurable 
> performance overhead. Given these two factors, I think we should consider 
> removing the HTrace integration. If there is someone willing to do the work, 
> replacing it with OpenTracing might be a better choice since there is an 
> active community.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to