beamtrace/types

Types

pub type Boundary {
  Boundary(event_id: String, kind: EdgeKind, reason: String)
}

Constructors

  • Boundary(event_id: String, kind: EdgeKind, reason: String)
pub type CaptureSpec {
  CaptureSpec(
    nodes: List(String),
    trigger: Mfa,
    where_aql: option.Option(String),
    privacy: Privacy,
    budget: TraceBudget,
    preset: Preset,
  )
}

Constructors

pub type CausalEdge {
  CausalEdge(
    from: String,
    to: String,
    kind: EdgeKind,
    evidence: Evidence,
  )
}

Constructors

pub type Completeness {
  Complete
  Truncated(reason: String)
  Gapped(dropped_events: Int)
  PartialNode(missing_nodes: List(String))
  InferredCapture(reason: String)
}

Constructors

  • Complete
  • Truncated(reason: String)
  • Gapped(dropped_events: Int)
  • PartialNode(missing_nodes: List(String))
  • InferredCapture(reason: String)
pub type EdgeKind {
  SequentialMessage(serial: Int)
  ProcessOrder
  Spawned
  LinkRelationship
  InferredRelation(reason: String)
  ExternalBoundary
  UnobservedState
}

Constructors

  • SequentialMessage(serial: Int)
  • ProcessOrder
  • Spawned
  • LinkRelationship
  • InferredRelation(reason: String)
  • ExternalBoundary
  • UnobservedState

Every observation and inference in BeamTrace carries its epistemic status.

pub type Evidence {
  Exact
  Inferred(reason: String, confidence: Float)
}

Constructors

  • Exact
  • Inferred(reason: String, confidence: Float)
pub type IdentityEvidence {
  RegisteredName(name: String)
  ProcessLabel(label: String)
  InitialCall(mfa: Mfa)
  Ancestor(name: String)
  SupervisorChildId(id: String)
  RestartProximity(milliseconds: Int)
}

Constructors

  • RegisteredName(name: String)
  • ProcessLabel(label: String)
  • InitialCall(mfa: Mfa)
  • Ancestor(name: String)
  • SupervisorChildId(id: String)
  • RestartProximity(milliseconds: Int)
pub type LogicalActor {
  LogicalActor(id: String, label: String)
}

Constructors

  • LogicalActor(id: String, label: String)
pub type Mfa {
  Mfa(module_: String, function_: String, arity: Int)
}

Constructors

  • Mfa(module_: String, function_: String, arity: Int)
pub type Preset {
  Generic
  GleamActor
  WispMist
  GenServer
  Phoenix
  ErlangSupervisor
}

Constructors

  • Generic
  • GleamActor
  • WispMist
  • GenServer
  • Phoenix
  • ErlangSupervisor
pub type Privacy {
  Metadata
  Raw(policy: RawPolicy)
}

Constructors

pub type ProcessIdentity {
  ProcessIdentity(
    physical: ProcessRef,
    logical: option.Option(LogicalActor),
    evidence: List(IdentityEvidence),
  )
}

Constructors

pub type ProcessMetadata {
  ProcessMetadata(
    registered_name: option.Option(String),
    process_label: option.Option(String),
    initial_call: option.Option(Mfa),
    ancestors: List(String),
    supervisor_child_id: option.Option(String),
  )
}

Constructors

pub type ProcessRef {
  ProcessRef(node: String, pid: String)
}

Constructors

  • ProcessRef(node: String, pid: String)
pub type RawPolicy {
  RawPolicy(
    redact_keys: List(String),
    max_depth: Int,
    max_binary_bytes: Int,
  )
}

Constructors

  • RawPolicy(
      redact_keys: List(String),
      max_depth: Int,
      max_binary_bytes: Int,
    )

A deliberately finite representation of arbitrary BEAM terms.

pub type RawTerm {
  RawAtom(name: String)
  RawInt(value: Int)
  RawFloat(value: Float)
  RawString(value: String)
  RawBinary(value: String, bytes: Int)
  RawTuple(items: List(RawTerm))
  RawConstructor(name: String, fields: List(RawTerm))
  RawList(items: List(RawTerm))
  RawMap(entries: List(#(RawTerm, RawTerm)))
  RawHidden
}

Constructors

  • RawAtom(name: String)
  • RawInt(value: Int)
  • RawFloat(value: Float)
  • RawString(value: String)
  • RawBinary(value: String, bytes: Int)
  • RawTuple(items: List(RawTerm))
  • RawConstructor(name: String, fields: List(RawTerm))
  • RawList(items: List(RawTerm))
  • RawMap(entries: List(#(RawTerm, RawTerm)))
  • RawHidden

The only term representation that may cross the relay boundary.

pub type TermView {
  Hidden
  Atom(name: String)
  Tag(name: String)
  Tuple(items: List(TermView))
  Constructor(name: String, fields: List(TermView))
  ListView(length: Int, items: List(TermView))
  MapView(size: Int, entries: List(#(TermView, TermView)))
  BinaryMetadata(
    bytes: Int,
    display: option.Option(String),
    fingerprint: option.Option(String),
  )
  Scalar(
    kind: String,
    display: option.Option(String),
    fingerprint: option.Option(String),
  )
  Redacted(reason: String)
}

Constructors

pub type TraceBudget {
  TraceBudget(
    max_events: Int,
    max_bytes: Int,
    max_duration_ms: Int,
    max_agent_mailbox: Int,
    max_roots: Int,
  )
}

Constructors

  • TraceBudget(
      max_events: Int,
      max_bytes: Int,
      max_duration_ms: Int,
      max_agent_mailbox: Int,
      max_roots: Int,
    )
pub type TraceEvent {
  TraceEvent(
    id: String,
    root_id: String,
    node: String,
    process: ProcessIdentity,
    local_timestamp_ns: Int,
    kind: TraceEventKind,
    evidence: Evidence,
  )
}

Constructors

pub type TraceEventKind {
  Root(trigger: Mfa, arguments: List(TermView))
  Send(to: ProcessRef, message: TermView, serial: Int)
  Received(from: ProcessRef, message: TermView, serial: Int)
  Spawn(child: ProcessRef, initial_call: Mfa)
  Exit(reason: TermView)
  Register(name: String)
  Link(peer: ProcessRef)
  Metric(name: String, value: Float)
  SystemSignal(name: String, value: Int)
  Gap(dropped_events: Int, reason: String)
  Stop(reason: String)
}

Constructors

  • Root(trigger: Mfa, arguments: List(TermView))
  • Send(to: ProcessRef, message: TermView, serial: Int)
  • Received(from: ProcessRef, message: TermView, serial: Int)
  • Spawn(child: ProcessRef, initial_call: Mfa)
  • Exit(reason: TermView)
  • Register(name: String)
  • Link(peer: ProcessRef)
  • Metric(name: String, value: Float)
  • SystemSignal(name: String, value: Int)
  • Gap(dropped_events: Int, reason: String)
  • Stop(reason: String)

Values

pub fn default_budget() -> TraceBudget
pub fn default_capture_spec(trigger: Mfa) -> CaptureSpec
pub fn inferred(reason: String, confidence: Float) -> Evidence

Construct inferred evidence while preserving the public 0..1 invariant.

pub fn is_complete(value: Completeness) -> Bool
Search Document