Adding Logging and Tracing to Services
In this chapter, you will learn about logging and tracing tools. We will use Spring Micrometer, Brave, the Elasticsearch, Logstash, and Kibana (ELK) stack, and Zipkin. ELK and Zipkin will be used to implement the distributed logging and tracing of the request/response of API calls. Spring Micrometer with Actuator will be used to inject tracing information into API calls. You will learn how to publish and analyze the logging and tracing of different requests and logs related to responses.
These aggregated logs will help you to troubleshoot web services. You will call one service (such as the gRPC client), which will then call another service (such as the gRPC server), and link them with a trace identifier. Then, using this trace identifier, you can search the centralized logs and debug the request flows. In this chapter, we will use this sample flow. However, the same tracing can be used when service calls require more internal calls. You will...