0.0.1-beta.1 • Published 3 years ago

monk-middleware-zipkin-instrumentation v0.0.1-beta.1

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
3 years ago

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