Skip to content

Latest commit

 

History

History
 
 

zipkin-instrumentation-restify

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

zipkin-instrumentation-restify

npm

A Restify plugin that adds Zipkin tracing to the application.

Usage

const restify = require('restify');
const {Tracer, ExplicitContext, ConsoleRecorder} = require('zipkin');
const zipkinMiddleware = require('zipkin-instrumentation-restify').restifyMiddleware;

const ctxImpl = new ExplicitContext();
const recorder = new ConsoleRecorder();
const localServiceName = 'service-a'; // name of this application
const tracer = new Tracer({ctxImpl, recorder, localServiceName});

const app = restify.createServer();

// Add the Zipkin middleware
app.use(zipkinMiddleware({tracer}));