You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Xavier Coulon <xc...@gmail.com> on 2011/04/28 11:15:54 UTC

Context Monitoring

Hello,

We are building a data integration solution (kinda ETL) with Camel, and we
need to monitor the whole processing. Especially, some custom metrics such
as the total number of items to process, the number of items that were
already processed with a distinction between success and errors. The first
metric is already computed by some process (in fact, we use the File
component headers), the other ones could be known by querying the number of
completed exchanges.

I know that using JConsole, it is possible to retrieve the managed beans
attributes, but as we need to store those metrics in a database/log
files/web console, I was tempted to create a camel route to retrieve the
counters, with a quartz expression to trigger the metrics retrieval.
>From the documentation, it appears that the JMX Component only supports JMX
event notifications, which is not my use case.

Until now, I tried to programmatically retrieve the route counters that are
exposed by JMX, but with no success. Is it possible ? The
exchange.getContext().getRoute("route.monitoring.metrics.phase1").getRouteContext().getManagedInterceptStrategy()
is of type org.apache.camel.management.InstrumentationInterceptStrategy but
does not provide a getter on the inner registeredCounters variable

Or should I just use JMX to connect to the local JVM ? Could this be an
extension to the JMX Component ?


Thank you in advance
Regards,
-- 
Xavier

Re: Context Monitoring

Posted by Xavier Coulon <xc...@gmail.com>.
Thanks for those answers. I'll look at the book and at the blog articles.

Best regards,
Xavier

On Thu, Apr 28, 2011 at 6:24 PM, boday <be...@initekconsulting.com>wrote:

> also, here are 2 blog posts about remote Camel/AMQ monitoring with JMX...I
> used this approach to build a JSP/JQuery based monitoring console for a
> client.
>
>
> http://benoday.blogspot.com/2010/08/managing-camel-routes-with-jmx-apis.html
>
> http://benoday.blogspot.com/2010/08/monitoring-and-managing-activemq-with.html
>
>
> Xavier Coulon wrote:
> >
> >
> > Until now, I tried to programmatically retrieve the route counters that
> > are
> > exposed by JMX, but with no success. Is it possible ? The
> >
> exchange.getContext().getRoute("route.monitoring.metrics.phase1").getRouteContext().getManagedInterceptStrategy()
> > is of type org.apache.camel.management.InstrumentationInterceptStrategy
> > but
> > does not provide a getter on the inner registeredCounters variable
> >
> > Or should I just use JMX to connect to the local JVM ? Could this be an
> > extension to the JMX Component ?
> >
>
>
> -----
> Ben O'Day
> IT Consultant -http://benoday.blogspot.com
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Context-Monitoring-tp4346067p4346985.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Xavier

Re: Context Monitoring

Posted by boday <be...@initekconsulting.com>.
also, here are 2 blog posts about remote Camel/AMQ monitoring with JMX...I
used this approach to build a JSP/JQuery based monitoring console for a
client.

http://benoday.blogspot.com/2010/08/managing-camel-routes-with-jmx-apis.html
http://benoday.blogspot.com/2010/08/monitoring-and-managing-activemq-with.html


Xavier Coulon wrote:
> 
> 
> Until now, I tried to programmatically retrieve the route counters that
> are
> exposed by JMX, but with no success. Is it possible ? The
> exchange.getContext().getRoute("route.monitoring.metrics.phase1").getRouteContext().getManagedInterceptStrategy()
> is of type org.apache.camel.management.InstrumentationInterceptStrategy
> but
> does not provide a getter on the inner registeredCounters variable
> 
> Or should I just use JMX to connect to the local JVM ? Could this be an
> extension to the JMX Component ?
> 


-----
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: http://camel.465427.n5.nabble.com/Context-Monitoring-tp4346067p4346985.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Context Monitoring

Posted by David Karlsen <da...@gmail.com>.
Could this be something:
http://www.infoq.com/news/2008/06/orbitz-opensource-erma ?
Been wondering about the same myself.



2011/4/28 Xavier Coulon <xc...@gmail.com>

> Hello,
>
> We are building a data integration solution (kinda ETL) with Camel, and we
> need to monitor the whole processing. Especially, some custom metrics such
> as the total number of items to process, the number of items that were
> already processed with a distinction between success and errors. The first
> metric is already computed by some process (in fact, we use the File
> component headers), the other ones could be known by querying the number of
> completed exchanges.
>
> I know that using JConsole, it is possible to retrieve the managed beans
> attributes, but as we need to store those metrics in a database/log
> files/web console, I was tempted to create a camel route to retrieve the
> counters, with a quartz expression to trigger the metrics retrieval.
> From the documentation, it appears that the JMX Component only supports JMX
> event notifications, which is not my use case.
>
> Until now, I tried to programmatically retrieve the route counters that are
> exposed by JMX, but with no success. Is it possible ? The
>
> exchange.getContext().getRoute("route.monitoring.metrics.phase1").getRouteContext().getManagedInterceptStrategy()
> is of type org.apache.camel.management.InstrumentationInterceptStrategy but
> does not provide a getter on the inner registeredCounters variable
>
> Or should I just use JMX to connect to the local JVM ? Could this be an
> extension to the JMX Component ?
>
>
> Thank you in advance
> Regards,
> --
> Xavier
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen

Re: Context Monitoring

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

There are many unit tests in camel-core in the
org.apache.camel.management package that shows how to grab stats using
JMX.

You can also use a custom EventNotifier to gather the stats.
http://camel.apache.org/eventnotifier-to-log-details-about-all-sent-exchanges.html

If you got the Camel book, then chapter 13 covers some of this in more details.



On Thu, Apr 28, 2011 at 11:15 AM, Xavier Coulon <xc...@gmail.com> wrote:
> Hello,
>
> We are building a data integration solution (kinda ETL) with Camel, and we
> need to monitor the whole processing. Especially, some custom metrics such
> as the total number of items to process, the number of items that were
> already processed with a distinction between success and errors. The first
> metric is already computed by some process (in fact, we use the File
> component headers), the other ones could be known by querying the number of
> completed exchanges.
>
> I know that using JConsole, it is possible to retrieve the managed beans
> attributes, but as we need to store those metrics in a database/log
> files/web console, I was tempted to create a camel route to retrieve the
> counters, with a quartz expression to trigger the metrics retrieval.
> From the documentation, it appears that the JMX Component only supports JMX
> event notifications, which is not my use case.
>
> Until now, I tried to programmatically retrieve the route counters that are
> exposed by JMX, but with no success. Is it possible ? The
> exchange.getContext().getRoute("route.monitoring.metrics.phase1").getRouteContext().getManagedInterceptStrategy()
> is of type org.apache.camel.management.InstrumentationInterceptStrategy but
> does not provide a getter on the inner registeredCounters variable
>
> Or should I just use JMX to connect to the local JVM ? Could this be an
> extension to the JMX Component ?
>
>
> Thank you in advance
> Regards,
> --
> Xavier
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
CamelOne 2011: http://fusesource.com/camelone2011/
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/