import { StringScalarType } from './common'; /** * Emits a distributed trace span to the configured telemetry sink * (e.g., OpenTelemetry). The span is linked to the workflow's trace * context (`traceId`, `spanId`) for end-to-end observability across * workflow executions, activities, and child workflows. * * By default (`config.once = true`), the trace is emitted exactly once * per workflow execution — it will not re-fire on replay. * * ## Examples * * ```typescript * import { Durable } from '@hotmeshio/hotmesh'; * * // Emit trace spans at key workflow milestones * export async function orderWorkflow(orderId: string): Promise { * await Durable.workflow.trace({ * 'order.id': orderId, * 'order.stage': 'started', * }); * * const { processPayment } = Durable.workflow.proxyActivities(); * await processPayment(orderId); * * await Durable.workflow.trace({ * 'order.id': orderId, * 'order.stage': 'payment_completed', * }); * } * ``` * * ```typescript * // Trace on every re-execution (for debugging replay behavior) * await Durable.workflow.trace( * { 'debug.counter': counter, 'debug.phase': 'retry' }, * { once: false }, * ); * ``` * * @param {StringScalarType} attributes - Key-value attributes to attach to the trace span. * @param {{ once: boolean }} [config={ once: true }] - If `true`, trace fires only once (idempotent). * @returns {Promise} `true` if tracing succeeded. */ export declare function trace(attributes: StringScalarType, config?: { once: boolean; }): Promise;