DrainResult

sealed interface DrainResult

The result of a WarpOtlpBridge.drain call.

A drain is best-effort and per-signal: each of OtlpSignal.SPANS, OtlpSignal.LOGS and OtlpSignal.METRICS is drained independently, and a signal with nothing buffered is not attempted at all. The result is classified by which attempted signal operations succeeded or failed, never by how many records moved — an up-to-date signal sends zero records and still succeeded:

  • Success — no attempted signal failed (including when nothing was attempted).

  • Partial — at least one attempted signal succeeded and at least one failed.

  • Failure — every attempted signal failed.

A failed signal leaves local data intact: its CRDT is unchanged, and the next drain retries the same delta.

Inheritors

Types

Link copied to clipboard
data class Failure(val failures: List<SignalFailure>) : DrainResult

Every attempted signal failed — typically the edge is unreachable, which is this bridge's routine offline state.

Link copied to clipboard
data class Partial(val spansSent: Int, val logsSent: Int, val metricPointsSent: Int, val failures: List<SignalFailure>) : DrainResult

At least one attempted signal drained and at least one failed.

Link copied to clipboard
data class Success(val spansSent: Int, val logsSent: Int = 0, val metricPointsSent: Int = 0) : DrainResult

Every attempted signal drained, or nothing was buffered to attempt.