zipkin-instrumentation-superagent

0.22.0 • Public • Published

zipkin-instrumentation-superagent

npm

Adds Zipkin tracing to the SuperAgent library.

Usage

The library is a SuperAgent plugin and should be used as:

const request = require('superagent');
const {Tracer, ExplicitContext, ConsoleRecorder} = require('zipkin');
const zipkinPlugin = require('zipkin-instrumentation-superagent');

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

const remoteServiceName = 'weather-api';
 
request
  .get('http://api.weather.com')
  .use(zipkinPlugin({tracer, remoteServiceName}))
  .end((err, res) => {
    // Do something
  });

Readme

Keywords

none

Package Sidebar

Install

npm i zipkin-instrumentation-superagent

Weekly Downloads

2,400

Version

0.22.0

License

Apache-2.0

Unpacked Size

19.5 kB

Total Files

10

Last publish

Collaborators

  • openzipkin