Intelligent monitoring for MSA, what are the design choices?

By Sofya Donskaya (sadonskaya@edu.hse.ru)

Nowadays, a micro service architecture (MSA) became one of the most popular type of the IT product’s architecture and consists of independently deployable services, which together bring value to the business’s needs. Each of the service provides a unique business capability and exchange data with other services by different means, which need to be well-defined and lightweight. [1]

More and more IT projects start relying on this approach. That is why, it is highly important not only to develop micro service but also to track them regarding the main characteristics in order to save and improve their usage. The main characteristics can be as the following: availability, functionality, performance. Such characteristics can be an interest and responsibility of the different departments with different resources. [2] It leads to the need to design a monitoring system of the MSA based on some explicit principles. Such monitoring systems can provide a whole view of the on-going process of deployment and how new versions are being implemented. Moreover, it can decrease new updates' impact on the current states of the micro services and increase effectiveness of testing and validating in test environments with help of continuous traffic provision. [2]

The monitoring systems have to be based on the best practices and principles. The first principle of monitoring micro services is about to monitor containers and what is inside them. To have a decent level of the micro services’ deployment you need to have a system for automated and dynamic monitoring for containerized infrastructure. This solution has to provide logical visualization and topologies that fix and represent the model of how the software is deployed with metrics aggregation and analysis for intelligent monitoring. The second principle is about to alert on service performance, not container performance. Here comes an orchestration system, which IT projects use to define micro services and understand the service’s state in deployment. Container-native solutions use orchestration data for containers and application data aggregation and monitoring metrics per-service calculation. [2] The third principle is to monitor services that are elastic and multi-located. The design of the monitoring system for MSA has to consider the constant changes and to be ready to grow accordingly without manual effort. The forth principle is about to organize and manage organizational units taking into consideration the architecture’s approach. In addition, the final principle is to monitor APIs. Since APIs are used by micro services to communicate, it is essential to monitor them. Firstly, it helps to understand clearly the user experience. Secondly, it allows tracking and measuring such metrics as the time accuracy of the responses, frequency of calls, etc. [3]

The idea of monitoring systems is highly in used when the MSA is being implemented. It relies on metrics that are time series data, which solves a challenge of SLO-based alerting and root cause analysis, and uses different methods as for design choices. For example, distributed tracing allows following the course of a request of transaction as it goes throughout the monitored micro services. This process pinpoints bottlenecks and serious issues that can have a big impact on their services’ performance. It begins when a user interacts with an application and send an initial HTTP request with a unique trace identifier (ID). While the request is being in motion through the host system, each operation worked on it, also called “span”, is being tagged with the first request’s trace ID, its own unique ID and the ID of the operation that created the request (“parent span”). [4] Every span is considered being a single step and contains valuable data relating to the micro service’s process that is performing the operations, such as the service’s name, a process handling the request’s address, logs and events, tags, detailed stack traces and error messages. A good example of this approach’s implementation would be Elastic as one of the most popular stacks with Logstash aggregating log files, ElasticSearch indexing and searching data and Kibana visualizing data. [4]

The other design approach to monitoring would be the RED method as a monitoring methodology created by Tom Wilkie based on best practices of Google. This method is about three metrics such as a rate (the number service’s requests processing by it per a second), an error (the number of requests failed per second) and duration (time for each request to be processed). [5] These three metrics provide a broaden understanding of the micro services’ performance. The R evaluates the traffic, the E gives you information if the service is functioning within your SLO and the D represents the overall user experience of the IT product. [5]

Taking everything into consideration, it could be concluded that a good design of the monitoring system for micro service architecture is based on monitoring metrics, monitoring practices and monitoring tools. As for the first, there should be well-defined monitoring metrics that numerically represent data coming from resource usage and system behavior. Monitoring practices can be concluded to log management, exception tracking, health check, API monitoring, log deployment audit logging and distributed tracking. [6] All of these monitoring processes have to be logically structured and used for monitoring micro service’s performance information. Monitoring tools such as libraries and platforms need to be evaluated and adapted to the state of the micro services functioning and capabilities of monitoring. Libraries bring their value during the development process due to the application data collection, and platforms provides an opportunity to gather, analyze and visualize data retrieving from various sources. [6] All of these give an opportunity to move from monolithic approach to the micro service architecture, to maintain the micro services’ performance, to allocate resources in the best way and to develop an IT product itself.

  1. Chris Richardson - Microservice Architecture (url: https://microservices.io/)
  2. Apurva Dave and Loris Degioanni - The Five Principles of Monitoring Microservices (url: https://thenewstack.io/five-principles-monitoring-microservices/)
  3. Tim Yocum - The RED method: A new strategy for monitoring microservices (url: https://www.infoworld.com/article/3638693/the-red-method-a-new-strategy-for-monitoring-microservices.html)
  4. Muhammad Waseem, Peng Liang, Mojtaba Shahin, Amleto Di Salle, Gast´on M´arquez - Design, Monitoring, and Testing of Microservices Systems: The Practitioners’ Perspective - School of Computer Science, Wuhan University, 430072 Wuhan, China