Hyperlinkv0.8.0-beta.28

Tracer

Tracer.SpanStatustypeeffect/Tracer.ts:90
SpanStatus

Lifecycle state of a span, where Started records the start time and Ended records the start time, end time, and exit value with which the span completed.

Example (Creating span statuses)

import { Exit } from "effect"
import type { Tracer } from "effect"

const startTime = 1_000_000_000n
const endTime = 1_500_000_000n

const startedStatus: Tracer.SpanStatus = {
  _tag: "Started",
  startTime
}

const endedStatus: Tracer.SpanStatus = {
  _tag: "Ended",
  startTime,
  endTime,
  exit: Exit.succeed("result")
}

console.log(startedStatus._tag) // "Started"
console.log(endedStatus.endTime - endedStatus.startTime) // 500000000n
models
Source effect/Tracer.ts:909 lines
export type SpanStatus = {
  _tag: "Started"
  startTime: bigint
} | {
  _tag: "Ended"
  startTime: bigint
  endTime: bigint
  exit: Exit.Exit<unknown, unknown>
}
Referenced by 4 symbols