plugins/tracer/README.md
tracer plugin for egg.
npm i @eggjs/tracer
Enable tracer plugin:
// config/plugin.ts
import tracerPlugin from '@eggjs/tracer';
export default {
...tracerPlugin(),
};
// ./path/to/my_tracer.ts
import { Tracer } from '@eggjs/tracer';
const counter = 0;
export class MyTracer extends Tracer {
get traceId() {
return `${counter++}-${Date.now()}-${process.pid}`;
}
}
Change the config to use MyTracer:
// config/config.default.ts
import { defineConfig } from 'egg';
import { MyTracer } from './path/to/my_tracer.ts';
export default defineConfig({
tracer: {
Class: MyTracer,
},
});
Please open an issue here.
Made with contributors-img.