[ 
https://issues.apache.org/jira/browse/CAMEL-19951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17772840#comment-17772840
 ] 

Raymond commented on CAMEL-19951:
---------------------------------

Thanks, the backlog tracer sounds interesting. 

As I understand, there is:

1. Legacy tracer

      a. set on context level
      b. set on route level (not documented)
2. Backlog tracer
       a. set on context level
       b. Cannot or doesn't need to set on route level?

I have looked at the backlogtracer before but it was unclear to me how to use 
it.

The documentation says only something about enabling:

{{camelContext.setBacklogTracing(true);}}

{{1. It's not clear how to set the options and operations.}}
{{2. It's not clear how to read out the backlog queue. (internal queue)}}

{{More info in the documetation and an example at 
[https://github.com/apache/camel-examples] would really be helpful.}}

Maybe it would be good to also show the backlog tracer in traditional way (log 
to console/file). When the backlog tracer can do everything the legacy tracer 
can do then I would be better to note that the backlog tracer is the preferred 
way for tracing. Now it's all a bit confusing. {{}}

> Enhance the tracer
> ------------------
>
>                 Key: CAMEL-19951
>                 URL: https://issues.apache.org/jira/browse/CAMEL-19951
>             Project: Camel
>          Issue Type: Wish
>    Affects Versions: 3.20.7
>            Reporter: Raymond
>            Priority: Major
>
> I really like the tracer:
> [https://camel.apache.org/manual/tracer.html]
> I wish it could be enhanced, so it becomes more flexible to use for more 
> uses. 
> Some ideas:
> 1. Enable tracing on route level
> Currently, tracing can only be enabled on the CamelContext. When there are 
> hundreds of routes, this quickly becomes cluttered. This could be enabled 
> like as follows:
> {code:java}
> Tracer tracer = context.getTracer();
> tracer.setByRouteId("routeid");{code}
> or
> {code:java}
> Route route = context.getRoute("routeid");
> route.setTracer(true);{code}
> or
> {code:java}
> <route id="someroute" tracer="true">
>     <from uri="direct:someroute"/>
>     <to uri="log:justsomeroute"/>
> </route>{code}
> 2. Event Notifier
> Instead of writing it to the log I would rather use it in the EventNotifier:
> {code:java}
> Tracer tracer = context.getTracer();
> tracer.sendToEventNotifier(true);
> tracer.sendToLog(false);{code}
> The EventNotifier could receive a "TraceEvent" (or MessageEvent?). There 
> could also be sub TraceEvents (similar to ExchangeEvent that has a subevent 
> ExchangeCreatedEvent):
> TraceEvent
>      TraceRouteEvent
>              TraceRouteInputEvent
>              TraceRouteOutputEvent
>      TraceNodeEvent
> 3. Trace Event object
> The Trace Event object that is used by the event notifier could contain:
> Timestamp
> BreadcrumpId (MessageId)
> RouteId (or Route object)
> Direction (input or output)
> Type: (Route or Node)
> Name: (name of route or node)
> Node (id / number of node)
> Exchange
> It would also be nice if the object can be serialized to a json.
> {code:java}
> CamelEvent.TracerEvent tracerEvent = (CamelEvent.TracerEvent) event;
> traceEvent.toJson();{code}
>  
> 4. Filters
> Sometimes you only want to trace a part of the exchange
> {code:java}
> Tracer tracer = context.getTracer();
> tracer.includeProperties(false);
> tracer.includeHeaders(true);
> tracer.includeBody(false);
> tracer.includeBodyType(true);{code}
>  
> Hopefully these wishes/feedback about the tracer are useful.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to