constructor()构造函数,创建一个 Trace 实例。
constructor(options?: TraceOptions)| 属性 | 类型 | 描述 | 默认值 |
|---|---|---|---|
traceName | string | trace 标识 | nocobase-trace |
version | string | NocoBase 当前版本号 | |
processorName | string | string[] | 想启用的已注册的 SpanProcessor 的标识 |
init()初始化 NodeTracerProvider.
init(): voidregisterProcessor()注册 SpanProcessor
registerProcessor(name: string, processor: GetSpanProcessor)| 参数 | 类型 | 描述 |
|---|---|---|
name | string | SpanProcessor 唯一标识 |
processor | () => SpanProcessor | 获取 SpanProcessor 的方法 |
getTracer()获取 Tracer.
getTracer(name?: string, version?: string)| 参数 | 类型 | 描述 | 默认值 |
|---|---|---|---|
name | string | trace 标识 | nocobase-trace |
version | string | NocoBase 当前版本号 |
start()启动 SpanProcessor.
start(): voidshutdown()停止 SpanProcessor.
shutdown(): Promise<void>