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

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

                Author: ASF GitHub Bot
            Created on: 22/Mar/22 12:15
            Start Date: 22/Mar/22 12:15
    Worklog Time Spent: 10m 
      Work Description: kiran-maturi commented on a change in pull request 
#3445:
URL: https://github.com/apache/hadoop/pull/3445#discussion_r832102387



##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/Span.java
##########
@@ -17,28 +17,54 @@
  */
 package org.apache.hadoop.tracing;
 
+import io.opentelemetry.context.Scope;
+
 import java.io.Closeable;
 
 public class Span implements Closeable {
-
+  private 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() {
+    if(span != null){
+      return  new SpanContext(span.getSpanContext());
+    }
     return null;
   }
 
   public void finish() {
+    close();
   }
 
   public void close() {
+    if(span != null){
+      span.end();

Review comment:
       > would span need to be nullified here. or is it ok to invoke it after 
being ended?
   
   I think we need not nullify span after it has ended. In general we call 
span.end in a finally block so no further operation takes place. If we end the 
span before that and try adding events or call end it won't have any impact. 




-- 
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: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

    Worklog Id:     (was: 745775)
    Time Spent: 10h 20m  (was: 10h 10m)

> 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-WIP.1.patch, 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: 10h 20m
>  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.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to