Monitoring is a major element in a great DevOps workflow. Without monitoring, teams cannot quickly react to and correct issues with their services. This limits the ability of teams to continuously integrate (CI) and/or continuously deploy (CD). CI/CD is a major component of DevOps. Thus having great monitoring is essential to having a smooth and productive DevOps workflow. In this post, we will discuss 3 important ways to monitor your microservices to have an effective DevOps workflow.
Internal Microservice Monitoring
Internal monitoring refers to monitors that are themselves microservices within your environments. These monitors run tests frequently against other microservices to verify they are running as expected. This type of monitoring normally has more in-depth testing than external monitoring which we will discuss later.
With internal monitoring, you can run anything from a simple up/down ping
test all the way to complex integration-like tests on a frequent basis. This type of monitor is normally set up to run anywhere from 1-minute intervals and longer. This allows for quick detection of any issues after changes to an environment or dependent services that have issues. These monitors alerting in a timely fashion allows for quick recovery times for self-induced issues. It can also alert for dependent service issues.
There is a downside to internal monitors inside the same environment that your other microservices are running in. They are listed below.
Lack of Insight If Environment Is Completely Unreachable
If the connection to the service completely goes down, there isn’t any monitoring able to alert you of any issues. That’s a major issue especially if you are providing a critical service for others or your business. If you are not notified swiftly when services are non-operational in the middle of the night when others are dependent on them, bad things can happen. Thus quick notification of any outages is a must.
More Effort to Create and Maintain
Internal monitors normally require custom coding of essentially another microservice whose sole purpose is to monitor other microservices. This entails quite a bit more effort to create as well as the ongoing effort to maintain code changes and security & compliance. However, with more in-depth tests, it will save a lot of time by giving detailed error messages which reduce debugging time.
External Microservice Monitoring
External monitoring is another way of monitoring your microservices. This entails using a third-party service such as DataDog, New Relic, AWS CloudWatch, Dynatrace, Sentry, or similar platforms.
What external monitoring allows you to do is to maintain visibility into the status of your microservices. You can still be alerted in a timely fashion even if the whole environment is unavailable.
External monitors are normally not as extensive or run as frequently as internal monitors as it costs a good amount of money to run a lot of nontrivial tests on these platforms. This is why it is best to have a good combination of the two to cover all of your alerting needs. Create more in-depth and complex monitors that will run more frequently to detect issues with any aspect of the service itself when it is running and available, and utilize external monitors to run less complex tests at a more infrequent interval to detect the more major issues that may hinder your services.
Application Performance Monitoring
The last major component of a great monitoring solution is Application Performance Monitoring (APM). This entails installing a component onto your server, container, or mobile app to track how the application is behaving while it is running. This will allow tracking of patterns that may need attention and/or fixes implemented. Some examples may include seeing consistent issues with certain browsers, desktop or mobile OS types and versions, higher than expected memory usage or memory leaks, and other similar types of issues.
Some examples of APM integrations include New Relic, DataDog, Firebase Crashlytics, Sentry, and more. Jadd the APM component to your platform running your app or service and let it report the details to the platform of choice. You can then set up alerts on the chosen platform to alert your team in whichever way you deem best that is an option provided.
Conclusion
Being able to thoroughly monitor your microservices is an essential part of a comprehensive DevOps workflow. Without great monitoring, great DevOps practices are nonexistent. You must be able to know that your services are doing what they are expected to do and do them efficiently. Otherwise, you will constantly be trying to debug issues well after your customers are experiencing them which is never a good thing.
Now, go out there and set up these 3 important ways to monitor your microservices! Happy monitoring!