From fcd10e8774d3c75d74b076208370c892bfe0b3bf Mon Sep 17 00:00:00 2001 From: Danijel Martinek Date: Wed, 6 May 2026 23:40:35 +0200 Subject: [PATCH] feat(core-shared): add ITracer/ISpan interfaces --- .../src/instrumentation/tracer.interface.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 packages/core-shared/src/instrumentation/tracer.interface.ts diff --git a/packages/core-shared/src/instrumentation/tracer.interface.ts b/packages/core-shared/src/instrumentation/tracer.interface.ts new file mode 100644 index 0000000..a086ca8 --- /dev/null +++ b/packages/core-shared/src/instrumentation/tracer.interface.ts @@ -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; +}; + +export interface ISpan { + setAttribute(key: string, value: AttributeValue): void; + setStatus(status: "ok" | "error", message?: string): void; +} + +export interface ITracer { + startSpan(opts: SpanOpts, fn: (span: ISpan) => Promise): Promise; +}