Distributed tracing in Node.js

Distributed tracing is like tracing a particular service request that spans across all of the services that are involved in serving that request. These services construct a graph like they form a tree rooted at the client that starts the initial request. Zipkin provides an instrumentation layer to generate IDs for a service request, based on which we can trace data from all applications by using that ID. In this section, we will look at how to use Zipkin. You can find the complete source at Chapter 9/Zipkin:

  1. Spin up our first microservice or any single microservice project from Chapter 4, Beginning Your Microservices Journey. We will add the zipkin dependencies to it:
npm install zipkin zipkin-context-cls ...

Get TypeScript Microservices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.