kevinhakanson.com

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, …

browser screenshot

… and looked in zipkin to see the result:

Zipkin trace


Kevin Hakanson

Multi-Cloud Certified Architect | DevSecOps | AppSec | Web Platform | Speaker | Learner | Builder
Twitter | LinkedIn | GitHub | Stack Overflow | Credly

© 2024 Kevin Hakanson (built with Gatsby)