Initial commit
This commit is contained in:
12
packages/core-shared/src/instrumentation/noop-tracer.ts
Normal file
12
packages/core-shared/src/instrumentation/noop-tracer.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user