Finciero JS Zipkin
finciero-zipkin-js is an abstraction of zipkin-js
This library let us start a new zipkin tracer
or continue a child trace
.
Config zipkin and kafka.
To use this library you need setup KAFKA_SERVICE_URL
in your environment variables.
Also, you can use this to run kafka and zipkin with docker.
Usage
The basic usage is as follow:
const TracerJS = const tracer = tracer
then you can start a new trace with:
tracerstart
Or you can pass and object with an old tracer:
const oldTracerData = traceId: 'some-trace-id' parentId: 'some-parent-id' spanId: 'some-span-id' sampled: truetracerstartoldTracerData
And this will continue the trace given in the method parameters.
To finish a trace record, just use:
tracer
This will stop the current trace record. If an error happen in your program, you can pass as argument the error and the finish
method will trace the error, this push the error data to kafka and zipkin.
const err = 'awesome error'tracer