The single sink for bloccs telemetry. Attaches Bloccs.Web.Telemetry.Handler
to the [:bloccs, …] stream and folds it into two per-network views:
- metrics —
Bloccs.Web.Telemetry.Metricsrolling windows (Metrics panel) - flow —
Bloccs.Web.Telemetry.Flow, recent edge traversals + per-second throughput buckets (Messages panel)
On a 1-second tick it broadcasts a snapshot of each over Phoenix.PubSub
(topic/1 for metrics, flow_topic/1 for flow). Panels subscribe for live
updates and call snapshot/1 / flow_snapshot/1 on mount for first paint.
A plain
GenServeris the right tool here: this is a stateful telemetry sink with a periodic tick, not a dataflow stage. The "no raw GenServers" rule governs thebloccslibrary core (where Broadway/GenStage apply), not this observability process.
Summary
Functions
Returns a specification to start this module under a supervisor.
First-paint flow snapshot for a network.
PubSub topic carrying a network's flow frames.
Cast a normalized metrics event in (called by the telemetry handler).
Cast a flow event in (called by the telemetry handler).
First-paint metrics snapshot for a network (empty frame if unseen).
PubSub topic carrying a network's metric frames.
Types
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec flow_snapshot(atom()) :: %{ events: list(), series: list(), rate: non_neg_integer() }
First-paint flow snapshot for a network.
PubSub topic carrying a network's flow frames.
@spec record(pid() | atom(), atom(), Bloccs.Web.Telemetry.Metrics.event()) :: :ok
Cast a normalized metrics event in (called by the telemetry handler).
@spec record_flow(pid() | atom(), atom(), Bloccs.Web.Telemetry.Flow.event()) :: :ok
Cast a flow event in (called by the telemetry handler).
First-paint metrics snapshot for a network (empty frame if unseen).
PubSub topic carrying a network's metric frames.