import * as otel from '@opentelemetry/api';
tp.use(openTelemetryExporter(otel)); // spans created when the tree finishes
tp.use(openTelemetryExporter(otel, { live: true })); // spans active while the call runs
Default mode creates spans when the top-level call finishes, with the
real start/end times, parented to the OpenTelemetry context that was
active when the call started. Live mode opens each span when the call
starts and makes it the active context, so other instrumentation's spans
become its children.
Export tracked calls as OpenTelemetry spans.
import * as otel from '@opentelemetry/api'; tp.use(openTelemetryExporter(otel)); // spans created when the tree finishes tp.use(openTelemetryExporter(otel, { live: true })); // spans active while the call runs
Default mode creates spans when the top-level call finishes, with the real start/end times, parented to the OpenTelemetry context that was active when the call started. Live mode opens each span when the call starts and makes it the active context, so other instrumentation's spans become its children.