Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 712 Bytes

File metadata and controls

23 lines (17 loc) · 712 Bytes

zipkin-instrumentation-cujojs-rest

This library will let you add interceptors to the rest client library.

Usage

const {Tracer} = require('zipkin');
const rest = require('rest');
const {restInterceptor} = require('zipkin-instrumentation-cujojs-rest');

const tracer = new Tracer({ctxImpl, recorder}); // configure your tracer properly here

const nameOfRemoteService = 'youtube';
const client = rest.wrap(restInterceptor, {tracer, remoteServiceName: nameOfRemoteService});

// Your application code here
client('http://www.youtube.com/').then(success => {
  console.log('got result from YouTube');
}, error => {
  console.error('Error', error);
});