midway-component-jaeger
Jaeger opentracing client component for midway.js
Install
npm i midway-component-jaeger
Usage
Update project src/configuration.ts
import * as jaeger from 'midway-component-jaeger'
@Configuration({
imports: [
jaeger,
],
importConfigs: [join(__dirname, 'config')],
})
export class ContainerConfiguration implements ILifeCycle {
}
Update project src/config/config.prod.ts
import { TracerConfig, defaultTracerConfig } from 'midway-component-jaeger'
export const tracer: TracerConfig = {
...defaultTracerConfig,
loggingOutputBody: true,
reqThrottleMsForPriority: 300,
tracingConfig: {
sampler: {
type: 'probabilistic',
param: 0.0001,
},
reporter: {
agentHost: '127.0.0.1',
},
},
}
Update project src/config/config.(local | unittest).ts
import { TracerConfig, defaultTracerConfig } from 'midway-component-jaeger'
export const tracer: TracerConfig = {
...defaultTracerConfig,
loggingOutputBody: true,
tracingConfig: {
sampler: {
type: 'probabilistic',
param: 1,
},
reporter: {
agentHost: '127.0.0.1',
},
},
}