You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "sravani-revuri (via GitHub)" <gi...@apache.org> on 2026/03/11 09:19:09 UTC

[PR] HDDS-14765. Improve Trace Hierarchy for Ozone Shell Put Key Command [ozone]

sravani-revuri opened a new pull request, #9908:
URL: https://github.com/apache/ozone/pull/9908

   ## What changes were proposed in this pull request?
   The tracing for the put key command is currently fragmented. Instead of one continuous trace with multiple spans, each function call opens a new trace as a separate root.
   
   Proposed Changes
   The goal is to ensure all actions belong to the same trace using a parent-child hierarchy.
   Modify TracingUtil to check for an existing trace context before creating a new span:
   
   - If a trace is already active, the new function call should join it as a span (child).
   - If no trace is active, it should start the initial trace (parent).
   
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-14765
   
   (Please replace this section with the link to the Apache JIRA)
   
   Tested with Jaeger UI using Docker.
   <img width="500" height="500" alt="image" src="https://github.com/user-attachments/assets/6d591ef3-5149-464f-b40a-3e6c4dad9c0a" />
   
   


-- 
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: issues-unsubscribe@ozone.apache.org

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


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


Re: [PR] HDDS-14765. Improve Trace Hierarchy for Ozone Shell Put Key Command [ozone]

Posted by "Gargi-jais11 (via GitHub)" <gi...@apache.org>.
Gargi-jais11 commented on PR #9908:
URL: https://github.com/apache/ozone/pull/9908#issuecomment-4053879721

   > @Gargi-jais11 please quote Java annotations (`@SkipTracing`) to avoid mentioning unrelated GitHub users
   
   Thanks @adoroszlai, realised it just now when I checked it.


-- 
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: issues-unsubscribe@ozone.apache.org

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


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


Re: [PR] HDDS-14765. Improve Trace Hierarchy for Ozone Shell Put Key Command [ozone]

Posted by "Gargi-jais11 (via GitHub)" <gi...@apache.org>.
Gargi-jais11 commented on PR #9908:
URL: https://github.com/apache/ozone/pull/9908#issuecomment-4043723121

   @sravani-revuri Please add some tests in either `TestTracingUtil` or `TestTraceAllMethod` for checking.
   1. Call a method annotated with @SkipTracing  and assert no span is created.
   2. Call a @SkipTracing method that throws and assert the exception is propagated unwrapped.
   3. Use createProxy with an interface that has @SkipTracing methods and assert they run correctly without creating spans.


-- 
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: issues-unsubscribe@ozone.apache.org

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


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


Re: [PR] HDDS-14765. Improve Trace Hierarchy for Ozone Shell Put Key Command [ozone]

Posted by "sarvekshayr (via GitHub)" <gi...@apache.org>.
sarvekshayr commented on PR #9908:
URL: https://github.com/apache/ozone/pull/9908#issuecomment-4098145927

   Thanks @sravani-revuri for the patch, @Gargi-jais11, @yandrey321 and @sumitagrawl for the review.


-- 
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: issues-unsubscribe@ozone.apache.org

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


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


Re: [PR] HDDS-14765. Improve Trace Hierarchy for Ozone Shell Put Key Command [ozone]

Posted by "sravani-revuri (via GitHub)" <gi...@apache.org>.
sravani-revuri commented on PR #9908:
URL: https://github.com/apache/ozone/pull/9908#issuecomment-4037720958

   @sumitagrawl , could you please review these changes.


-- 
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: issues-unsubscribe@ozone.apache.org

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


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


Re: [PR] HDDS-14765. Improve Trace Hierarchy for Ozone Shell Put Key Command [ozone]

Posted by "sarvekshayr (via GitHub)" <gi...@apache.org>.
sarvekshayr merged PR #9908:
URL: https://github.com/apache/ozone/pull/9908


-- 
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: issues-unsubscribe@ozone.apache.org

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


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


Re: [PR] HDDS-14765. Improve Trace Hierarchy for Ozone Shell Put Key Command [ozone]

Posted by "sravani-revuri (via GitHub)" <gi...@apache.org>.
sravani-revuri commented on code in PR #9908:
URL: https://github.com/apache/ozone/pull/9908#discussion_r2955002986


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/tracing/TraceAllMethod.java:
##########
@@ -86,4 +98,17 @@ private Method findDelegatedMethod(Method method) {
     }
     return null;
   }
+
+  private boolean shouldSkipTracing(Method method, Method delegateMethod) {
+    // Skip methods annotated with @SkipTracing
+    if (method.isAnnotationPresent(SkipTracing.class)) {

Review Comment:
   Modified the code with the optimized Boolean check for skiptracing , the check now applies to only implemented method.



-- 
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: issues-unsubscribe@ozone.apache.org

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


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


Re: [PR] HDDS-14765. Improve Trace Hierarchy for Ozone Shell Put Key Command [ozone]

Posted by "Gargi-jais11 (via GitHub)" <gi...@apache.org>.
Gargi-jais11 commented on code in PR #9908:
URL: https://github.com/apache/ozone/pull/9908#discussion_r2922063833


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/tracing/TracingUtil.java:
##########
@@ -179,10 +179,19 @@ public static boolean isTracingEnabled(
 
   /**
    * Execute {@code runnable} inside an activated new span.
+   * If a parent span exists in the current context, this becomes a child span.
    */
   public static <E extends Exception> void executeInNewSpan(String spanName,
       CheckedRunnable<E> runnable) throws E {
-    Span span = tracer.spanBuilder(spanName).setNoParent().startSpan();
+    Span span;
+    Context currentContext = Context.current();
+    Span parentSpan = Span.fromContext(currentContext);
+
+    if (parentSpan != null && parentSpan.getSpanContext().isValid()) {
+      span = tracer.spanBuilder(spanName).setParent(currentContext).startSpan();
+    } else {
+      span = tracer.spanBuilder(spanName).setNoParent().startSpan();
+    }

Review Comment:
   This seems to be duplicated. Let's extract this to a new method.



-- 
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: issues-unsubscribe@ozone.apache.org

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


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


Re: [PR] HDDS-14765. Improve Trace Hierarchy for Ozone Shell Put Key Command [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #9908:
URL: https://github.com/apache/ozone/pull/9908#issuecomment-4053437077

   @Gargi-jais11 please quote Java annotations (`@SkipTracing`) to avoid mentioning unrelated GitHub users


-- 
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: issues-unsubscribe@ozone.apache.org

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


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