17 lines
479 B
TypeScript
17 lines
479 B
TypeScript
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>;
|
|
}
|