In microservice architecture, it is possible to get lost with logs, errors, monitors, etc... Having a common logging place is good practice to make the service logs query-able sequentially. In the microservice world each service is responsible for its own exceptions and logs. Consider pipelined microservices which make calls to other microservices inside/outside the universe. If one call in the chain fails, we can expect that previous calls in the chain might raise errors as well, but how you can trace which request caused this error in the chain? Demonstration The quick solution is; if the request does not have a ‘ ’ information, then put a ‘ ’ or ‘ ’ information from the beginning of the request and pass the same ‘request ID’ through services. If you are using HTTP to make connection between microservices, you can put the ‘request ID’ as a HTTP header. request ID request ID transaction ID When you start logging the chain of requests, you will have which will be and analyse which one caused the error. the same ‘request ID’ easy to query Lastly, if you are interested in completely traceable systems, also checkout specs. opentracing Happy monitoring!
Share Your Thoughts