Practical Site Reliability Engineering
上QQ阅读APP看书,第一时间看更新

Monitoring the microservices

Monitoring is always a crucial part of managing any application. When we talk about how we can monitor microservices, however, there are several unique challenges to consider. In a monolithic architecture, we have one common build or library for all the services deployed in a couple of application servers that may have had dependencies across other libraries. In this section, we'll focus on the changes required to monitor an application in production more efficiently.

We can monitor, maintain, and operate containers using Kubernetes. We need to enable application insights to see what's running inside the container. Here, we can set the alerts on the performance of the service, rather than the performance of the container. As we are using the cloud, we need to set up our infrastructure according to our project requirements. We need to monitor our APIs, although in microservices it is easy to detect and diagnose the unhealthy nodes quicker than in monolithic systems. Every microservice may interact with other services or a backend database, so we need to enable monitoring for all loose points that could lead to application failure. We need to set up monitoring that can detect problems early. If we can implement self-healing in certain common scenarios, we can improve the uptime of an application. There are a few common metrics that we need to measure, which we'll look at in the following sections.