tracked Operation
inline suspend fun <T> trackedOperation(operationName: String, attributes: Map<String, String> = emptyMap(), crossinline onSuccess: (T, String, Long) -> Unit = { _, _, _ -> }, crossinline onFailure: (Throwable, String, Long) -> Unit = { _, _, _ -> }, crossinline block: suspend () -> T): T
Execute a suspending operation with correlation, automatically recording success/failure to an optional callback.
Return
The operation result (throws on failure)
Since
0.4.0
Parameters
operation Name
Human-readable operation name
attributes
Additional attributes for context
on Success
Called on successful completion with result and timing
on Failure
Called on exception with error and timing
block
The suspending operation to execute