DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Good Data, Bad Metric: A Mutation Testing Pattern for Analytics Engineering
  • Evaluating SOC Effectiveness Using Detection Coverage and Response Metrics
  • Building an Image Classification Pipeline With Apache Camel and Deep Java Library (DJL)
  • Governing Identity Under Uncertainty: Experimentation and Incrementality in Modern Programmatic Advertising

Trending

  • Is the Data Warehouse Dead? 3 Patterns From Enterprise Architecture That Answer This Question
  • Migrate a Hardcoded LangGraph Agent to LaunchDarkly AI Configs in 20 Minutes
  • Stop Debugging Glue Jobs Manually: Building an Agentic Observability Layer for Data Pipelines
  • When One MVP Is Really Four Systems: A Better Way to Plan Multi-Role Apps
  1. DZone
  2. Coding
  3. Frameworks
  4. More Metrics in Apache Camel 2.14

More Metrics in Apache Camel 2.14

By 
Claus Ibsen user avatar
Claus Ibsen
·
Sep. 15, 14 · Interview
Likes (0)
Comment
Save
Tweet
Share
9.5K Views

Join the DZone community and get the full member experience.

Join For Free

Apache Camel 2.14 is being released later this month. There is a slight holdup due some Apache infrastructure issue which is being worked on.

This blog post is to talk about one of the new functions we have added to this release. Thanks to Lauri Kimmel who donated a camel-metrics component, we integrated with the excellent codehale metrics library.

So I took this component one step further and integrated it with the Camel routes so we have additional metrics about the route performances using codehale metrics. This allows end users to seamless feed Camel routing information together with existing data they are gathering using codehale metrics.

Also take note we have a lot of existing metrics from camel-core which of course is still around.

What codehale brings to the table is that they have additional statistical data which we do not have in camel-core.

To use the codehale metics all you need to do is:

  1. add camel-metrics component
  2. enable route metrics in XML or Java code
To enable in XML you declare a as shown below:
  &;t;bean id="metricsRoutePolicyFactory"
        class="org.apache.camel.component.metrics.
               routepolicy.MetricsRoutePolicyFactory"/>
And doing so in Java code is easy as well by calling this method on your CamelContext.
  context.addRoutePolicyFactory(new MetricsRoutePolicyFactory());
Now performance metrics is only useable if you have a way of displaying them, and for that you can use hawtio. Notice you can use any kind of monitoring tooling which can integrate with JMX, as the metrics is available over JMX. The actual data is 100% codehale json format, where a piece of the data is shown in the figure below.

Sample of the route metrics JSON data
The next release of hawtio supports Camel 2.14 and automatic detects if you have enabled route metrics and if so, then shows a sub, where the information can be seen in real time in a graphical charts.
hawtio have detected that we have route metrics enabled, and shows a sub tab where we can see the data in real time

The screenshot above is from the new camel-example-servlet-rest-tomcat which we ship out of the box. This example demonstrates another new functionality in Camel 2.14 which is the Rest DSL (I will do a blog about that later). This example enables the route metrics out of the box, so what I did was to deploy this example together with hawtio (the hawtio-default WAR) in Apache Tomcat 8.

With hawtio you can also build custom dashboards, so here at the end I have put together a dashboard with various screens from hawtio to have a custom view of a Camel application.

hawtio dashboard with Camel route and metrics as well control panel to control the route(s), and the logs in the bottom.

Metric (unit) Apache Camel

Published at DZone with permission of Claus Ibsen. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Good Data, Bad Metric: A Mutation Testing Pattern for Analytics Engineering
  • Evaluating SOC Effectiveness Using Detection Coverage and Response Metrics
  • Building an Image Classification Pipeline With Apache Camel and Deep Java Library (DJL)
  • Governing Identity Under Uncertainty: Experimentation and Incrementality in Modern Programmatic Advertising

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook