import { Tracer, Attributes } from '@opentelemetry/api'; import { d as FlowHooks } from '../types-D8r3B8Ax.cjs'; interface CreateOtelHooksOptions { /** Tracer obtained from `trace.getTracer('your-service')`. */ tracer: Tracer; /** * Prefix for span names. Default `"kompensa"` produces names like * `kompensa.flow.` and `kompensa.step.`. */ spanPrefix?: string; /** Attributes added to every span emitted by this adapter. */ baseAttributes?: Attributes; } /** * Build a {@link FlowHooks} implementation that emits OpenTelemetry spans * mirroring the lifecycle of a kompensa flow. * * Span hierarchy: * ``` * kompensa.flow. * ├─ kompensa.step. (one per sequential step) * ├─ kompensa.step.. (one per parallel branch) * └─ kompensa.compensate. (only when compensation runs) * ``` * * Each step span carries `kompensa.step.attempts`, retries are recorded as * `retry` events on the same span, and failures call `recordException` so the * stack trace shows up on the tracing backend. */ declare function createOtelHooks(opts: CreateOtelHooksOptions): FlowHooks; export { type CreateOtelHooksOptions, createOtelHooks };