13 lines
311 B
TypeScript
13 lines
311 B
TypeScript
import type { ITracer, ISpan, SpanOpts } from "./tracer.interface";
|
|
|
|
const NOOP_SPAN: ISpan = {
|
|
setAttribute: () => {},
|
|
setStatus: () => {},
|
|
};
|
|
|
|
export class NoopTracer implements ITracer {
|
|
async startSpan<T>(_opts: SpanOpts, fn: (span: ISpan) => Promise<T>): Promise<T> {
|
|
return fn(NOOP_SPAN);
|
|
}
|
|
}
|