Earlier in the week I wrote about performance tuning Java systems and I hinted that being able to monitor a system is a really useful first step in proving and diagnosing the cause of performance issues. Of course, there are times where you need a profiler, but that's a different story.
So back to monitoring and I'm still surprised by the number of mission critical systems, particularly in the financial markets sector, where the only way to monitor the system is by tailing a log file. As for management, well, that's typically non-existent.
One of the things that I now do when I'm architecting a new system is to always spend a little time on thinking about the system from an operations/support perspective, reflected by including a "Monitoring and Management View" in my architecture documents. Ultimately, you need to work out what the non-functional requirements are, and a good way to do this is to sit down with the support team to run through the following sorts of questions.
Questions like these are important to ask because you really do need to tailor the monitoring and management to the people that will be supporting the application. Of course, like all functionality, you do need to prioritise monitoring and management features because they do have an associated cost. Similarly, you also need to perform some cost-benefit analysis because it's no good building a comprehensive web-based administration system for a tactical solution that only has a 3 month lifepsan, for example.
With Java, a really effective way to monitor and manage applications is using the Java Management Extensions (JMX). As I've said before, JMX is one of those technologies that rarely gets a look in, but once you get into it, you'll become infected. Using JMX is straightforward enough, but you do need to work out what you want to monitor and manage. With this in mind, I would recommend getting those hooks in as early as you can. Finally, even if you *really* don't have the time to instrument your code, you can get a certain level of JVM monitoring for *free*, just by enabling the JMX agent. Try it, you have no excuse not to!
Simon is an independent consultant specializing in software architecture, and the author of Software Architecture for Developers (a developer-friendly guide to software architecture, technical leadership and the balance with agility). He’s also the creator of the C4 software architecture model and the founder of Structurizr, which is a collection of open source and commercial tooling to help software teams visualise, document and explore their software architecture.