You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "fsteccanella (via GitHub)" <gi...@apache.org> on 2023/04/18 09:41:22 UTC

[GitHub] [camel-quarkus] fsteccanella opened a new issue, #4796: @WithSpan context missing

fsteccanella opened a new issue, #4796:
URL: https://github.com/apache/camel-quarkus/issues/4796

   It seems that the trace context is being kept only if the trace is being initiated by an http request.
   
   Given the following bean:
   ```java
   @ApplicationScoped
   @Named("telemetryBean")
   public class TelemetryBean {
   
       @WithSpan
       public String span(String source) {
           System.out.println(source);
           return source;
       }
   }
   ```
   
   And the following route builder:
   ```java
   @Override
       public void configure() throws Exception {
           from("platform-http:/test")
                   .bean("telemetryBean","span('http')");
   
           from("timer:timer?period=5000")
                   .bean("telemetryBean","span('test')");
       }
   ```
   
   This are the collected traces:
   ![image](https://user-images.githubusercontent.com/5019896/232737389-6407ae7b-2c2c-40d0-ba17-18e2bcd8ab39.png)
   
   The first one contains 2 spans correctly related:
   ![image](https://user-images.githubusercontent.com/5019896/232737619-c91397a0-3bb5-44da-b195-86692bac8b2f.png)
   
   While the second and the third traces contains two unrelated spans that should be instead related each other
   


-- 
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: commits-unsubscribe@camel.apache.org.apache.org

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


[GitHub] [camel-quarkus] jamesnetherton commented on issue #4796: [camel-quarkus-opentelemetry] @WithSpan context missing

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on issue #4796:
URL: https://github.com/apache/camel-quarkus/issues/4796#issuecomment-1512828818

   It's likely semi-related to this: https://issues.apache.org/jira/browse/CAMEL-18661.
   
   In Camel Quarkus 2.16.0 and later, you might be able to use this workaround:
   
   ```java
   from("timer:foo?repeatCount=1")
       .to("bean:telemetryBean?method=span&parameters.source=test");
   ```


-- 
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: commits-unsubscribe@camel.apache.org

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


[GitHub] [camel-quarkus] fsteccanella commented on issue #4796: [camel-quarkus-opentelemetry] @WithSpan context missing

Posted by "fsteccanella (via GitHub)" <gi...@apache.org>.
fsteccanella commented on issue #4796:
URL: https://github.com/apache/camel-quarkus/issues/4796#issuecomment-1513068290

   Hi @jamesnetherton 
   thanks for the suggestion.
   
   Indeed the "to" component seems to be managed better and allows to trace the bean execution both in 2.13 and in 2.16.
   
   I have performed some additional tests and these are my findings (if they can be useful to someone):
   
   ```java
           from("platform-http:/test")
                   .bean("telemetryBean","span('http')");
           
           from("timer:timer?period=5000")
               .to("bean:telemetryBean?method=span('test')"); //parameters.source was not working for me
   ```
   
   ```java
   @ApplicationScoped
   @Named("telemetryBean")
   public class TelemetryBean {
   
       
       @WithSpan("manualspan")
       public String span(String source) {
           internalMethod();
           System.out.println(source);
           return source;
       }
   
       @WithSpan("internalSpan")
       private void internalMethod(){
           try {
               Thread.sleep(500);
           } catch (InterruptedException e) {
               e.printStackTrace();
           }
       }
   }
   ```
   
   Quarkus 2.16
   No orphan span
   ![image](https://user-images.githubusercontent.com/5019896/232780911-65cbb4ed-8f3c-4603-bf4c-d586a5c84497.png)
   Direct WithSpan method invocation fine, but missing internalMethod details
   ![image](https://user-images.githubusercontent.com/5019896/232780811-e6c8e614-cad2-478e-9be2-93d54208bcd5.png)
   
   Quarkus 2.13
   Orphan span present and missing WithSpan method invocation
   ![image](https://user-images.githubusercontent.com/5019896/232781581-b032e5ec-16f6-4bb9-8b8f-d8c772cc3fd4.png)
   internalMethod details still missing
   ![image](https://user-images.githubusercontent.com/5019896/232781730-cf2dd2b5-d98e-496d-9c19-f72dded52c00.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.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

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


[GitHub] [camel-quarkus] jamesnetherton commented on issue #4796: camel-quarkus-opentelemetry @WithSpan context missing

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on issue #4796:
URL: https://github.com/apache/camel-quarkus/issues/4796#issuecomment-1600267066

   Related to #4981.


-- 
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: commits-unsubscribe@camel.apache.org

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