zipkin-instrumentation-request-promise
Adds Zipkin tracing to the request and request-promise libraries.
Usage
The library provides two ways to instrument your request. You have the wrapRequest
function which provides an interface similar to zipkin-instrumentation-request and Request
class which follow the OOP patterns. Keep in mind wrapRequest
is just a wrapper around Request
class, so there is no difference between the two.
Using the wrapRequest function
const Tracer ExplicitContext ConsoleRecorder = ;const wrapRequest = ; const ctxImpl = ;const recorder = ;const localServiceName = 'service-a'; // name of this applicationconst tracer = ctxImpl recorder localServiceName; const remoteServiceName = 'weather-api';const request = ; ;
Using the Request class
const Tracer ExplicitContext ConsoleRecorder = ;const ZipkinRequest = default; const ctxImpl = ;const recorder = ;const localServiceName = 'service-a'; // name of this applicationconst tracer = ctxImpl recorder localServiceName; const remoteServiceName = 'weather-api';const request = tracer remoteServiceName; request ;