monk-middleware-zipkin-instrumentation
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-beta.1 • Public • Published

Zipkin

Node.js CI

To add zipkin instrumentation to monk.

npm i --save monk-middleware-zipkin-instrumentation

Usage

const { Tracer, ExplicitContext, ConsoleRecorder } = require('zipkin');

const tracer = new Tracer({
  ctxImpl: new ExplicitContext(), // implicit in-process context
  recorder: new ConsoleRecorder(), // batched http recorder
  localServiceName: 'tester' // name of this application
});

db.addMiddleware(require('monk-middleware-zipkin-instrumentation')({ tracer }))

Express

This is something that I'm going to look in to

Please note that using express the context should be zipkin-context-cls or the parent is not properly assigned

Benchmark

Function calling time:

$ node ./test/benchmark.js
monk                 293 ops/sec
zipkin/monk          281 ops/sec

Test configuration:

$ uname -a
Darwin 2015-MBP 19.6.0 Darwin Kernel Version 19.6.0: <DATE> x86_64
$ node --version
v16.2.0

Package Sidebar

Install

npm i monk-middleware-zipkin-instrumentation

Weekly Downloads

0

Version

0.0.1-beta.1

License

Apache-2.0

Unpacked Size

7.44 kB

Total Files

5

Last publish

Collaborators

  • harrytwright