Zipkin JS Investigation (Part 2)
July 20, 2016 #javascript #api #monitoring
The continuing story from my Zipkin JS Investigation
My zipkin-js issue was fixed a couple days ago when zipkin-js/packages/zipkin-transport-http landed, so I decided to revisit my test project and see how it works.
I updated my app.js
to use BatchRecorder
and HttpLogger
.
const {Tracer, ExplicitContext, BatchRecorder} = require('zipkin');
const {HttpLogger} = require('zipkin-transport-http');
const ctxImpl = new ExplicitContext();
const recorder = new BatchRecorder({
logger: new HttpLogger({
endpoint: 'http://localhost:9411/api/v1/spans'
})
});
const tracer = new Tracer({ctxImpl, recorder});
Then using instructions from Quickstart · OpenZipkin, I ran a docker command to get started, …
$ docker run -d -p 9411:9411 openzipkin/zipkin
… ran my recursive service code, …
… and looked in zipkin to see the result: