lightspeed/pipeline/telemetry

Pipeline telemetry contracts for lag/throughput/retry/dead-letter tracking.

Types

Delta update applied to a telemetry snapshot.

pub type Delta {
  Delta(
    processed_records: Int,
    lag_ms: Int,
    retry_count: Int,
    dead_letter_count: Int,
    elapsed_ms: Int,
  )
}

Constructors

  • Delta(
      processed_records: Int,
      lag_ms: Int,
      retry_count: Int,
      dead_letter_count: Int,
      elapsed_ms: Int,
    )

Aggregated telemetry snapshot for one pipeline runtime.

pub type Snapshot {
  Snapshot(
    lag_ms: Int,
    throughput_records_per_sec: Int,
    retry_count: Int,
    dead_letter_count: Int,
  )
}

Constructors

  • Snapshot(
      lag_ms: Int,
      throughput_records_per_sec: Int,
      retry_count: Int,
      dead_letter_count: Int,
    )

Values

pub fn apply(snapshot: Snapshot, delta: Delta) -> Snapshot

Apply one delta and return a new snapshot.

pub fn delta(
  processed_records: Int,
  lag_ms: Int,
  retry_count: Int,
  dead_letter_count: Int,
  elapsed_ms: Int,
) -> Delta

Build one telemetry delta.

pub fn label(snapshot: Snapshot) -> String

Stable snapshot label.

pub fn metrics(
  snapshot: Snapshot,
  pipeline_name: String,
  run_id: String,
) -> List(telemetry.Metric)

Convert one snapshot to metric points.

pub fn valid(snapshot: Snapshot) -> Bool

Snapshot invariants.

pub fn zero() -> Snapshot

Build a zeroed telemetry snapshot.

Search Document