egg-simple-zipkin
v1.0.2
Published
just another zipkin plugin for EggJS
Downloads
6
Maintainers
Readme
egg-simple-zipkin
This plugin will apply a global middleware just behind bodyParser
and extend context with a global zipkin tracer
You could get the Tracer by ctx.zipkinTracer
and share traceId among the request context
Install
$ npm i egg-simple-zipkin --save
# or
$ yarn add egg-simple-zipkin
Usage
// {app_root}/config/plugin.js
exports.simpleZipkin = {
enable: true,
package: 'egg-simple-zipkin'
}
Configuration
// {app_root}/config/config.default.js
exports.simpleZipkin = {
ignorePaths: [], // the middleware will ignore path in this array
tracer: Tracer // you could pass in your CustomTracerInstance, and thus config below will be ignored
recorder: 'console', // accept value ['console','batch']
// if you choose consoleRecorder config below will be ignored
httpRecorderOptions: {
jsonEncoderVersion: 'V2', // accept value ['V1','V2']
endpoint: 'localhost:1314/api/v2/spans', // zipkin endpoint
httpInterval: 1000 // how often to sync spans. optional, defaults to 1000
}
}
see config/config.default.js for more detail.
Example
Questions & Suggestions
Please open an issue here.