jamesnetherton commented on issue #7813:
URL: https://github.com/apache/camel-quarkus/issues/7813#issuecomment-3377920226

   Another similar scenario that previously worked with `camel-opentelemetry` 
is JAX-RS services:
   
   This:
   
   ```java
   @Path("/trace")
   @GET
   @Produces(MediaType.TEXT_PLAIN)
   public String traceRoute() {
       return template.requestBodyAndHeaders("direct:start", null, headers, 
String.class);
   }
   ```
   
   Would create a span hierarchy like:
   
   ```
   |--- JAX-RS service
   |------- direct:start
   ```
   
   With `camel-opentelemetry2`, the spans are disconnected. To make it work you 
have to hack the traceparent header:
   
   ```java
   @Path("/trace")
   @GET
   @Produces(MediaType.TEXT_PLAIN)
   public String traceRoute() {
       Map<String, Object> headers = new HashMap<>();
       headers.put("traceparent", Span.current().getSpanContext().getSpanId());
       return template.requestBodyAndHeaders("direct:start", null, headers, 
String.class);
   }
   ```
   


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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to