Rulvar API reference / @rulvar/cli / toOtel
Function: toOtel()
ts
function toOtel(
run,
tracer,
options?): Promise<number>;Defined in: packages/cli/src/otel.ts:183
Exports one run's event stream onto a tracer. The run's events are consumed in seq order; span openers start spans, the matching closers end them, and payload-only events attach as span events on the innermost open span. Returns the number of spans created. Every terminal path exports, the unsettled ones included (RV1106): a rejecting result never fails an export the stream already completed, it only marks any leftover span with the refusal.
Parameters
| Parameter | Type |
|---|---|
run | { events: AsyncIterable<WorkflowEvent>; result: Promise<RunOutcome<unknown>>; runId: string; } |
run.events | AsyncIterable<WorkflowEvent> |
run.result | Promise<RunOutcome<unknown>> |
run.runId | string |
tracer | TracerLike |
options | ToOtelOptions |
Returns
Promise<number>