zipkin-instrumentation-fetch
    DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/zipkin-instrumentation-fetch package

    0.22.0 • Public • Published

    zipkin-instrumentation-fetch

    npm

    This library will wrap the fetch API. You need to provide your own fetch implementation; it could for example come from window.fetch (in the browser), or node-fetch on Node.js.

    Usage

    const {Tracer} = require('zipkin');
    const wrapFetch = require('zipkin-instrumentation-fetch');
     
    const localServiceName = 'service-a'; // name of this application
    const tracer = new Tracer({ctxImpl, recorder, localServiceName});
     
    const remoteServiceName = 'youtube';
    const zipkinFetch = wrapFetch(fetch, {tracer, remoteServiceName});
     
    // Your application code here
    zipkinFetch('http://www.youtube.com/').then(res => res.json()).then(data => ...);

    Keywords

    none

    Install

    npm i zipkin-instrumentation-fetch

    DownloadsWeekly Downloads

    6,277

    Version

    0.22.0

    License

    Apache-2.0

    Unpacked Size

    15.4 kB

    Total Files

    10

    Last publish

    Collaborators

    • openzipkin