Java Performance Monitoring: 5 Open Source Tools You Should Know
Stagemonitor, Pinpoint, MoSKito, Glowroot, and Kamon are all promising open source Java monitoring tools. See where they can be best put to use.
Join the DZone community and get the full member experience.Join For Free
one of the most important things for any application is performance. we want to make sure the users are getting the best experience they can, and to know that our app is up and running. that’s why most of us use at least one monitoring tool.
if you’re looking for something a little different in the performance monitoring market, one option you can choose is going for an open sourced tool. in the following post we’ve gathered some open source apm tools that are available today as an alternative to the paid tools, so you’ll be able to see if it’s the right choice for you.
going open source
the apm market is a crowded one. you have big and well-known names such as new relic, appdynamics (check out this post for an overview about them), along with dynatrace (who we compared in previous posts ), along with some smaller or lesser known tools. since there are so many players in the game, and they all know the value of monitoring your application , they keep their code for themselves.
however, there’s an alternative in the market: open source tools. these tools present a good option if you’re interested in an easy way to gain visibility for your application in production, and if you want to know how your code is actually being monitored.
there are a few key apm tools in the open source community as well, each with its own offerings and possibilities. if you’re intrigued and want to know exactly what open source apm has in store for you, we’ve covered the top 5 tools available for you:
stagemonitor offers a java monitoring agent, that was built with clustered application stacks in mind. meaning that it aims to monitor applications that are running on a number of servers. the tool integrates with time series databases (tsdb). this tool is optimized for handling time series data, along with arrays of numbers that are indexed by time. these databases include elasticsearch, graphite, and influxdb.
how does it work?
stagemonitor includes an agent that sits in your java application, sending metrics and request traces to the central database. the tool only requires one instance to monitor all applications, instances, and hosts and can be deployed inside your own data center.
on the monitoring side, you can view historical or live data from the cluster, or directly from the developer server, create custom alerts and define thresholds for each metric.
stagemonitor includes a dashboard, so you can visualize and analyze the different metrics and requests you’re interested in. you can create custom dashboards, write your custom plugins or even use 3rd party plugins. it offers an in-browser widget with no backend required that is automatically injected to the monitored web page. you can view the live demo in the following link.
in the official documentation, stagemonitor states that it offers support for non-servlet-based applications as well.
stagemonitor’s widget metrics
bottom line: if you’re already familiar with the elk stack, it’s definitely worth checking out for a quick test run.
pinpoint is an apm tool made for large scale distributed systems. it’s modeled after dapper, a distributed systems tracing infrastructure built by google, providing its developers more information about the behavior of complex distributed systems.
how does it work?
the tool helps analyze the overall structure of the system and how components within them are interconnected, by tracing transactions across distributed applications. meaning that it aims to explain how every transaction gets executed, trace the flows between the components and (bad joke ahead) pinpoints problematic areas and potential bottlenecks.
the dashboard helps visualize how the components are connected and lets you monitor active threads inside the applications in real time. pinpoint also lets you see the request count and response patterns so you’ll be able to identify potential problems. you can view critical details that include cpu usage, memory/garbage collection, and jvm arguments.
pinpoint works with an agent that’s installed without any code changes, and you can run a sample instance in your own machine by running four simple scripts for each of the components: collector, web, sample testapp, and hbase .
bottom line: if you’ve heard of dapper, or would like to monitor and analyze your complex distributed systems, you should definitely check this tool out.
moskito offers three tools in one:
- moskito-essential : the basic standalone project. it’s the core of moskito functionality that lets you monitor your application.
- moskito-central : centralized storage server for keeping the performance data.
- moskito-control : a tool for monitoring performance of multi-node web applications.
how does it work?
to get started, all you need to do is drop the .jar file into the web-inf/lib folder or by including a small new section in the web.xml file. once the tool is up and running, it collects performance data, analyzing it in real time as well as storing it for historical analysis.
the tool collects all of your performance metrics, such as threads, memory, caches, storage, services, registrations, payments, conversion, sql, load distribution and so on. it doesn’t require code change, supports all of the major app servers (tomcat, jetty, jboss, weblogic) and keeps the data locally.
you also get a notification system to know when a threshold was met, and the recordings of user’s actions you want to monitor. along with the web-based dashboards, the tool also offers a mobile app to monitor your application on the go.
bottom line: moskito first launched at 2007, and by now it’s a well known and stable tool, that’s supported by the team and by the community, including paid support options. that’s also a huge plus for any open source tool.
glowroot prides itself on being a fast, clean and simple apm tool. it will allow tracing capture for slow requests and errors, and you’ll be able to log time trace for each user action, as well as sql capture and aggregation. the tool also presents a historical roll-up of all data with configurable retention.
it provides charts to visualize response time breakdown and response time percentiles, and its responsive ui will allow you to monitor your application from your mobile devices as well as your desktop.
how does it work?
to get started with glowroot, you need to download and unzip the main installation file and add -javaagent:path/to/glowroot.jar to your application’s jvm arguments. after you start your application, all that’s left is pointing the browser to http://localhost:4000.
once the tool is up and running, you’ll get continuous profiling (with filtering options), along with being able to set up alerts for response time percentiles and mbean attributes. glowroot offers full support for async requests that span multiple threads, and it supports tomcat, tomee, jboss eap, wildfly, jetty, and glassfish.
bottom line: if clean and simple is what you’re looking for, no doubt you’d want to check out glowroot over the other tools here.
kamon is a reactive-friendly toolkit that is built for applications that run on top of the jvm. more specifically, it’s made for applications that are built with the typesafe reactive platform (using scala, akka, spray and/or play!), but still offers support for any other jvm platforms and languages.
how does it work?
kamon is distributed as a core module with all the metric recording and trace manipulation apis and optional modules that provide bytecode instrumentation and/or reporting capabilities to your application. or in other words, it offers a simple api for recording metrics and trace information for jvm applications.
all of kamon’s modules are available through maven central, and you will need to add them as a compile dependency to your project. once you’ve included the modules you’re interested in, simply start up kamon, and all of the available modules will be automatically started, you don’t need to explicitly activate/start them.
the tracing modules will allow recording data about functionality executed in your application, and the metrics module will allow you to control the registration of entities being tracked either by user code or by instrumentation provided with other kamon modules. it also has other abilities such as filtering, configuring instrument factories and dispatching metrics subscriptions.
bottom line: if you’re using a number of jvm languages, or mostly scala / akka, and would like “one tool to monitor them all”, kamon might be the friendliest choice to go for.
now that you’ve got your haystack…
apm tools are great at giving you the information about whether your application is up and running, or if there’s something that’s holding it back. the only problem is that once you get that haystack in which the problem was found, you have to start digging around looking for the actual needle that caused it.
these are some good alternatives to the paid tools in the apm space. but… some might think that going for the open source option is mostly a way to save a few bucks. it’s also important to remember that while you won’t need to issue an invoice for the use of the tool, it doesn’t necessarily mean it’s cheaper.
open source tools come with a price: installation, troubleshooting and of course maintenance, which will all be done in-house, by your very own engineers or even you. and not to mention the time you might end up wasting seeking support for a specific issue only you’ve encountered, and the community never heard of.
our 2 cents is that open source can be great, but you should also keep the other costs in mind and only then reach a decision.
any other open source apm tools you think we should check out? tell us about them in the comments below!
Published at DZone with permission of Henn Idan, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.