In this session, we'll look at how to monitor the health of individual services in a microservice-architected application as well as trace the path of data and processing as it flows from service to service. Specifically, we'll look at Spring Cloud Netflix and Netflix OSS' Hystrix project to not only apply the circuit breaker pattern for failure and latency protection to microservices and monitor the health of those circuit breakers in a running application. Additionally, we'll look at Spring Cloud Sleuth and Zipkin to trace processing through a microservice-based application.
Microservice-architecture presents many benefits, not the least of which include opportunities to develop, evolve, scale, test, and deploy individual modules of an application independently from the rest of the application. But once an application is broken apart, a new set of challenges arises.
Failure is always a possibility in any application. But when an application is composed of microservices, it's important for that each service contain its failure and keep its problems to itself to avoid cascading errors to other services. Likewise, latency can be a concern that is compounded when felt across multiple microservices and it's important to avoid cascading latency issues. By applying the circuit breaker pattern in your microservices, you can ensure that if anything goes wrong in a given service, it stays in that service and doesn't have any negative impacts to other services. Moreover, metrics published by those circuit breakers can provide helpful insight into the health of an application.
When things do go wrong, it may also be helpful to trace the flow and processing of information as it passes from one microservice to another. Traditionally, tracing involves following the logs of a single application. But in a microservice-based application where many services and many instances of those services are involved, tracing is much more challenging. What's needed is a way for microservices to submit timing and tracing information to a central tracing service that coordinates that data and can present the flow of data in a single, easily digested view.
Craig Walls is a Principal Engineer, Java Champion, Alexa Champion, and the author of Spring AI in Action, Spring in Action, and Build Talking Apps. He's a zealous promoter of the Spring Framework, speaking frequently at local user groups and conferences and writing about Spring. When he's not slinging code, Craig is planning his next trip to Disney World or Disneyland and spending as much time as he can with his wife, two daughters, 1 bird and 2 dogs.
More About Craig »