TimeWarp.Telemetry (TimeWarp v0.1.0)

Copy Markdown View Source

Telemetry-from-birth (Mitigation 2, spec §10). Every rollback, anti-message, and GVT cycle emits an event from Phase 0 — because rollback-rate is the diagnostic you need while debugging the engine itself, not a Phase 1 luxury.

Emission is via :telemetry.execute/3 when the :telemetry library is present, and a no-op otherwise, so the engine carries no hard dependency. The thrash circuit breaker does not rely on this hook — it reads authoritative counters straight from LP stats during each GVT poll.

Event names (all prefixed [:time_warp, ...]):

  • [:time_warp, :rollback] — measurements: %{depth: n, antimsgs: n}
  • [:time_warp, :antimsg] — measurements: %{count: 1}
  • [:time_warp, :event] — measurements: %{count: 1} (event processed)
  • [:time_warp, :gvt] — measurements: %{value: gvt, lag: max_lvt - gvt}

Summary

Functions

emit(event, measurements, metadata)

@spec emit([atom()], map(), map()) :: :ok