You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Rakesh Sharma <ra...@hotmail.com> on 2013/02/18 10:18:04 UTC
Instrumenting routes and processors
I would like to collect the time taken by an exchange in a route and all
processes in the pipeline of that route. Can it be done in a generic way by
configuring container wide interceptor?
Thanks,
Rakesh
--
View this message in context: http://camel.465427.n5.nabble.com/Instrumenting-routes-and-processors-tp5727719.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Instrumenting routes and processors
Posted by Rakesh Sharma <ra...@hotmail.com>.
It is amazing to get so many responses so quickly. I think I failed to
mention the problem clearly. Every exchange passing through multiple routes
will have a custom header property to trace it end-to-end. Every time a
route and its sub-steps (process, beans, splitter etc) are executed, I need
to create a record for each of the following steps:
1. Route end-point received the message: Log custom header property value,
route ID, and timestamp
2. Before invoking next process in the pipeline: Log custom header property
value, route ID, process ID, and timestamp.
3. After process (2) is done: Log custom header property value, route ID,
process ID, and timestamp, time taken in completing the execution of the
process.
4. Repeat (2) - (3) for all process in the pipeline of the route.
5. At the end when route is done: Log Log custom header property value,
route ID, process ID, timestamp, and time taken to execute the route from
start to end.
I will be storing log records in DB (most likely couchbase) and have a UI to
query these log record using header property value as key. I was thinking of
making use of custom InterceptStrategy at container level which returns a
wrapped DelegateAsyncProcessor instance with a asynch callback. I am not
sure if it is the right way or I should use trace with custom
TraceEventHandler. Any guidance will be highly appreciated.
Thanks,
Rakesh
--
View this message in context: http://camel.465427.n5.nabble.com/Instrumenting-routes-and-processors-tp5727719p5727751.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Instrumenting routes and processors
Posted by Claus Ibsen <cl...@gmail.com>.
There is also the event notifier
http://camel.apache.org/eventnotifier-to-log-details-about-all-sent-exchanges.html
On Mon, Feb 18, 2013 at 1:48 PM, Stéphane Deraco <st...@deraco.fr> wrote:
> You can also use Interceptors in Camel (see [1]), including the Tracer
> interceptor ([2]). Using Tracer and JMX notifications you can see the flow
> in live in JConsole for example.
>
>
> [1] http://camel.apache.org/intercept.html
> [2] http://camel.apache.org/tracer.html
>
> Regards,
> Stéphane
>
>
> 2013/2/18 Raul Kripalani <ra...@evosent.com>
>
>> You need to do nothing special, as the out-of-the-box configuration already
>> collects performance stats for all processors and routes, and exposes the
>> stats via JMX. Use any standard JMX client to connect to the Camel
>> instrumentation. More info here: [1].
>>
>> One tip: make sure you assign explicit IDs to the processors and routes you
>> wish to monitor. Otherwise, they will show up as "route1", "to5", etc. and
>> you won't know what they correspond to.
>>
>> The level of granularity of stats can be configured as indicated towards
>> the end of [1]. By default we are verbose.
>>
>> [1] http://camel.apache.org/camel-jmx.html
>>
>> Regards,
>>
>> *Raúl Kripalani*
>> Apache Camel Committer
>> Enterprise Architect, Program Manager, Open Source Integration specialist
>> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
>> http://blog.raulkr.net | twitter: @raulvk <http://twitter.com/raulvk>
>>
>> On Mon, Feb 18, 2013 at 9:18 AM, Rakesh Sharma
>> <ra...@hotmail.com>wrote:
>>
>> > I would like to collect the time taken by an exchange in a route and all
>> > processes in the pipeline of that route. Can it be done in a generic way
>> by
>> > configuring container wide interceptor?
>> >
>> > Thanks,
>> > Rakesh
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> >
>> http://camel.465427.n5.nabble.com/Instrumenting-routes-and-processors-tp5727719.html
>> > Sent from the Camel - Users mailing list archive at Nabble.com.
>> >
>>
--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Re: Instrumenting routes and processors
Posted by Stéphane Deraco <st...@deraco.fr>.
You can also use Interceptors in Camel (see [1]), including the Tracer
interceptor ([2]). Using Tracer and JMX notifications you can see the flow
in live in JConsole for example.
[1] http://camel.apache.org/intercept.html
[2] http://camel.apache.org/tracer.html
Regards,
Stéphane
2013/2/18 Raul Kripalani <ra...@evosent.com>
> You need to do nothing special, as the out-of-the-box configuration already
> collects performance stats for all processors and routes, and exposes the
> stats via JMX. Use any standard JMX client to connect to the Camel
> instrumentation. More info here: [1].
>
> One tip: make sure you assign explicit IDs to the processors and routes you
> wish to monitor. Otherwise, they will show up as "route1", "to5", etc. and
> you won't know what they correspond to.
>
> The level of granularity of stats can be configured as indicated towards
> the end of [1]. By default we are verbose.
>
> [1] http://camel.apache.org/camel-jmx.html
>
> Regards,
>
> *Raúl Kripalani*
> Apache Camel Committer
> Enterprise Architect, Program Manager, Open Source Integration specialist
> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> http://blog.raulkr.net | twitter: @raulvk <http://twitter.com/raulvk>
>
> On Mon, Feb 18, 2013 at 9:18 AM, Rakesh Sharma
> <ra...@hotmail.com>wrote:
>
> > I would like to collect the time taken by an exchange in a route and all
> > processes in the pipeline of that route. Can it be done in a generic way
> by
> > configuring container wide interceptor?
> >
> > Thanks,
> > Rakesh
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/Instrumenting-routes-and-processors-tp5727719.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
Re: Instrumenting routes and processors
Posted by Raul Kripalani <ra...@evosent.com>.
You need to do nothing special, as the out-of-the-box configuration already
collects performance stats for all processors and routes, and exposes the
stats via JMX. Use any standard JMX client to connect to the Camel
instrumentation. More info here: [1].
One tip: make sure you assign explicit IDs to the processors and routes you
wish to monitor. Otherwise, they will show up as "route1", "to5", etc. and
you won't know what they correspond to.
The level of granularity of stats can be configured as indicated towards
the end of [1]. By default we are verbose.
[1] http://camel.apache.org/camel-jmx.html
Regards,
*Raúl Kripalani*
Apache Camel Committer
Enterprise Architect, Program Manager, Open Source Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk <http://twitter.com/raulvk>
On Mon, Feb 18, 2013 at 9:18 AM, Rakesh Sharma
<ra...@hotmail.com>wrote:
> I would like to collect the time taken by an exchange in a route and all
> processes in the pipeline of that route. Can it be done in a generic way by
> configuring container wide interceptor?
>
> Thanks,
> Rakesh
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Instrumenting-routes-and-processors-tp5727719.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>