Crosswake.Offline.SafeObservation (crosswake v0.2.3)

View Source

Closed, transport-independent observation vocabulary for scoped replay.

This is deliberately not a redactor. Replay and authority values cannot be passed here: callers construct the small observation from declared values.

Summary

Types

projection()

@type projection() :: %{required(atom()) => atom() | non_neg_integer() | String.t()}

t()

@type t() :: %Crosswake.Offline.SafeObservation{
  adapter_readiness: term(),
  configuration: term(),
  denial: term(),
  lifecycle: term(),
  measurements: term(),
  outcome: term(),
  route_id: term(),
  runtime: term()
}

Functions

new(attrs)

@spec new(map()) :: {:ok, t()} | {:error, Crosswake.Offline.SafeObservation.Error.t()}

to_doctor(observation)

@spec to_doctor(t()) ::
  {:ok, %{configuration: atom(), adapter_readiness: atom()}}
  | {:error, Crosswake.Offline.SafeObservation.Error.t()}

to_logger(observation)

@spec to_logger(t()) ::
  {:ok, projection()} | {:error, Crosswake.Offline.SafeObservation.Error.t()}

to_telemetry(observation)

@spec to_telemetry(t()) ::
  {:ok, projection()} | {:error, Crosswake.Offline.SafeObservation.Error.t()}

validate(observation)

@spec validate(t()) ::
  {:ok, t()} | {:error, Crosswake.Offline.SafeObservation.Error.t()}