feat(core-shared): add ITracer/ISpan interfaces

This commit is contained in:
2026-05-06 23:40:35 +02:00
parent 2c402d6b90
commit fcd10e8774

View File

@@ -0,0 +1,16 @@
export type AttributeValue = string | number | boolean | null;
export type SpanOpts = {
name: string;
op?: "use-case" | "controller" | "repository" | "service" | string;
attributes?: Record<string, AttributeValue>;
};
export interface ISpan {
setAttribute(key: string, value: AttributeValue): void;
setStatus(status: "ok" | "error", message?: string): void;
}
export interface ITracer {
startSpan<T>(opts: SpanOpts, fn: (span: ISpan) => Promise<T>): Promise<T>;
}