Novices Performing Miracles

npm

Need private packages and team management tools?Check out npm Orgs. »

zipkin-instrumentation-got

0.0.1 • Public • Published

zipkin-instrumetation-got

This library will wrap the got client.

Usage

const {Tracer} = require('zipkin');
const got = require('got');
const zipkinClient = require('zipkin-instrumentation-got');
 
const tracer = new Tracer({ctxImpl, recorder}); // configure your tracer properly here
 
const zipkinGot = zipkinClient(tracer, got);
 
// Your application code here
zipkinGot('todomvc.com')
  .then(response => {
    console.log(response.body);
    //=> '<!doctype html> ...'
  })
  .catch(error => {
    console.log(error.response.body);
    //=> 'Internal server error ...'
  });
 
// Streams
zipkinGot.stream('todomvc.com').pipe(fs.createWriteStream('index.html'));
 
// For POST, PUT and PATCH methods got.stream returns a WritableStream
fs.createReadStream('index.html').pipe(zipkinGot.stream.post('todomvc.com'));

Keywords

none

install

npm i zipkin-instrumentation-got

Downloadsweekly downloads

153

version

0.0.1

license

Apache-2.0

last publish

collaborators

  • avatar
Report a vulnerability