ITracer

cart · /core·interface

Minimal tracing interface accepted by the middleware and optionally supplied on . Mirrors the OTel Tracer shape without a direct dependency so hosts can bridge any tracing backend.

Properties

startSpan
unknown

Example

const tracer: ITracer = {
  startSpan: async (name, attrs, fn) => {
    const span = openTelemetry.tracer.startSpan(name, { attributes: attrs });
    return fn({ recordException: (e) => span.recordException(e as Error), setAttribute: (k, v) => span.setAttribute(k, String(v)) });
  },
};

RunCartAdapterContractOpts runCartAdapterContract CartCapabilityUnsupportedError CartError CartNotFoundError CartProviderError CartUserError CartAdapter

Sourcetypes.ts:336Edit the JSDoc directly

On this page