# zipkin-transport-kafka

> Transports Zipkin trace data via Kafka to the collector

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

## Install

```sh
npm install zipkin-transport-kafka
pnpm add zipkin-transport-kafka
yarn add zipkin-transport-kafka
bun add zipkin-transport-kafka
```

## 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 | 2016-05-11 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 26.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 568 |
| Author | Openzipkin |
| Maintainers | openzipkin |

## Links

- npm: https://www.npmjs.com/package/zipkin-transport-kafka
- 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-transport-kafka

## Dependencies (4)

- [zipkin](https://npm.io/package/zipkin.md) ^0.22.0
- [kafka-node](https://npm.io/package/kafka-node.md) ^2.6.1
- [@types/kafka-node](https://npm.io/package/@types/kafka-node.md) ^2.0.3
- [zipkin-encoder-thrift](https://npm.io/package/zipkin-encoder-thrift.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
- … 49 more at https://npm.io/package/zipkin-transport-kafka/versions

## README

# zipkin-transport-kafka

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

This is a module that sends Zipkin trace data from zipkin-js to Kafka.

## Usage

`npm install zipkin-transport-kafka --save`

```javascript
const {
  Tracer,
  BatchRecorder,
  jsonEncoder: {JSON_V2}
} = require('zipkin');
const {KafkaLogger} = require('zipkin-transport-kafka');
const noop = require('noop-logger');

const kafkaRecorder = new BatchRecorder({
  logger: new KafkaLogger({
    clientOpts: {
      connectionString: 'localhost:2181'
    },
    encoder: JSON_V2, // optional (defaults to THRIFT)
    log: noop // optional (defaults to console)
  })
});

const tracer = new Tracer({
  recorder,
  ctxImpl, // this would typically be a CLSContext or ExplicitContext
  localServiceName: 'service-a' // name of this application
});
```

If you do not use zookeeper to store offsets, use `clientOpts.kafkaHost` instead of `clientOpts.connectionString`.

```js
const {BatchRecorder} = require('zipkin');
const {KafkaLogger} = require('zipkin-transport-kafka');

const kafkaRecorder = new BatchRecorder({
  logger: new KafkaLogger({
    clientOpts: {
      kafkaHost: 'localhost:2181'
    }
  })
});
```

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