# zipkin-instrumentation-request

> Instrumentation for request with Zipkin.js

Latest version **0.22.0** (published 2020-06-04) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install zipkin-instrumentation-request
pnpm add zipkin-instrumentation-request
yarn add zipkin-instrumentation-request
bun add zipkin-instrumentation-request
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.22.0 |
| Published | 2020-06-04 |
| First published | 2017-03-30 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 16.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 567 |
| Author | OpenZipkin |
| Maintainers | openzipkin |

## Links

- npm: https://www.npmjs.com/package/zipkin-instrumentation-request
- Repository: https://github.com/openzipkin/zipkin-js
- Homepage: https://github.com/openzipkin/zipkin-js#readme
- Issues: https://github.com/openzipkin/zipkin-js/issues
- npm.io page: https://npm.io/package/zipkin-instrumentation-request

## Dependencies (1)

- [zipkin](https://npm.io/package/zipkin.md) ^0.22.0

## Recent versions

- 0.22.0 (latest) — 2020-06-04
- 0.22.1-alpha.6 (canary) — 2021-03-01
- 0.22.1-alpha.3 — 2020-11-03
- 0.21.0 — 2020-04-16
- 0.20.0 — 2020-03-25
- 0.19.2 — 2020-02-06
- 0.19.2-alpha.6 — 2020-02-06
- 0.19.2-alpha.3 — 2020-01-30
- 0.19.2-alpha.1 — 2019-10-25
- 0.19.1 — 2019-10-16
- 0.20.0-alpha.1 — 2019-08-09
- 0.20.0-alpha.0 — 2019-08-09
- 0.19.0 — 2019-08-07
- 0.18.6 — 2019-07-24
- 0.18.5 — 2019-07-12
- … 28 more at https://npm.io/package/zipkin-instrumentation-request/versions

## README

# zipkin-instrumentation-request

![npm](https://img.shields.io/npm/dm/zipkin-instrumentation-request.svg)

Adds Zipkin tracing to the [request](https://www.npmjs.com/package/request) library.

## Usage

```javascript
const express = require('express');
const {Tracer, ExplicitContext, ConsoleRecorder} = require('zipkin');
const wrapRequest = require('zipkin-instrumentation-request');
const request = require('request');

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';
const zipkinRequest = wrapRequest(request, {tracer, remoteServiceName});

zipkinRequest({
    url: 'http://api.weather.com',
    method: 'GET',
  }, function(error, response, body) {
    console.log('error:', error);
    console.log('statusCode:', response && response.statusCode);
    console.log('body:', body);
  });
```

---
_Source: https://npm.io/package/zipkin-instrumentation-request · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
