Chapter 9. Distributed tracing with Spring Cloud Sleuth and Zipkin

 

This chapter covers

  • Using Spring Cloud Sleuth to inject tracing information into service calls
  • Using log aggregation to see logs for distributed transaction
  • Querying via a log aggregation tool
  • Using OpenZipkin to visually understand a user’s transaction as it flows across multiple microservice calls
  • Customizing tracing information with Spring Cloud Sleuth and Zipkin

The microservices architecture is a powerful design paradigm for breaking down complex monolithic software systems into smaller, more manageable pieces. These manageable pieces can be built and deployed independently of each other; however, this flexibility comes at a price: complexity. Because microservices are distributed by nature, trying to debug where a problem is occurring can be maddening. The distributed nature of the services means that you have to trace one or more transactions across multiple services, physical machines, and different data stores, and try to piece together what exactly is going on.

This chapter lays out several techniques and technologies for making distributed debugging possible. In this chapter, we look at the following:

  • Using correlation IDs to link together transactions across multiple services
  • Aggregating log data from multiple services into a single searchable source
  • Visualizing the flow of a user transaction across multiple services and understanding the performance characteristics of each part of the transaction

9.1. Spring Cloud Sleuth and the correlation ID

 

9.1.1. Adding Spring Cloud sleuth to licensing and organization

 
 
 
 

9.1.2. Anatomy of a Spring Cloud Sleuth trace

 
 
 

9.2. Log aggregation and Spring Cloud Sleuth

 
 
 
 

9.2.1. A Spring Cloud Sleuth/Papertrail implementation in action

 

9.2.2. Create a Papertrail account and configure a syslog connector

 
 
 

9.2.3. Redirecting Docker output to Papertrail

 

9.2.4. Searching for Spring Cloud Sleuth trace IDs in Papertrail

 

9.2.5. Adding the correlation ID to the HTTP response with Zuul

 
 
 
 

9.3. Distributed tracing with Open Zipkin

 
 
 
 

9.3.1. Setting up the Spring Cloud Sleuth and Zipkin dependencies

 
 
 

9.3.2. Configuring the services to point to Zipkin

 

9.3.3. Installing and configuring a Zipkin server

 
 

9.3.4. Setting tracing levels

 
 
 

9.3.5. Using Zipkin to trace transactions

 
 

9.3.6. Visualizing a more complex transaction

 
 

9.3.7. Capturing messaging traces

 
 
 

9.3.8. Adding custom spans

 
 

9.4. Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest