Skip to content
This repository has been archived by the owner on Mar 19, 2022. It is now read-only.

Latest commit

 

History

History
 
 

zipkin-transport-kafka

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Zipkin-transport-kafka

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

Usage:

npm install zipkin-transport-kafka --save

const {Tracer, BatchRecorder} = require('zipkin');
const {KafkaLogger} = require('zipkin-transport-kafka');

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

const tracer = new Tracer({
  recorder: kafkaRecorder,
  ctxImpl // this would typically be a CLSContext or ExplicitContext
});

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

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

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