Andrey Pechkurov
1 min readAug 25, 2019

--

The short answer is “yes, you can”.

And here is the long answer. In order to trace requests that happen across your services you’ll have to do the following:

  • Use cls-rtracer in each of your services. Note that configuration options called `useHeader` and `headerName` can help you with that by reading request id from HTTP request headers (if it’s there, of course).
  • Send request id (`rTracer.id()`) as a HTTP header in all requests that are sent to downstream services.
  • Configure your services to stream their logs into a log collector service, like Logstash.

Once everything above is done, you’ll have shared request id as a part of collected logs.

--

--

Andrey Pechkurov
Andrey Pechkurov

Written by Andrey Pechkurov

Core database engineer at QuestDB. Distributed systems gazer. Node.js contributor. Occasional tech blogger and speaker.

No responses yet