Records telemetry events captured by the configured PhoenixReplay.Collectors.
Each collector is attached once, when the application starts. Its handler runs in the process that emitted the event and handles it in a fixed order:
- Finds the session of the emitting process, or of the first of its
$callersthat has one, sostart_async/3,assign_async/3andTaskwork belongs to the LiveView that started it. Events no session claims stop here, at the cost of one ETS lookup per process. - Lets the collector capture or skip the event.
- Passes captured metadata through the session's
PhoenixReplay.Sanitizer. Text such as SQL is masked later, when the recording is saved, by the session'sPhoenixReplay.Redactor. - Records a
:telemetryevent, unless the collector reached its:limitfor the session, in which case the event is counted as dropped.
:telemetry permanently detaches a handler that raises, so a collector
that raises is reported with [:phoenix_replay, :collector, :exception]
instead; see PhoenixReplay.Telemetry.
Summary
Functions
Attaches the configured collectors. Called by PhoenixReplay.Capture.Handlers.
Detaches the collectors attached with prefix.
Handles a telemetry event for a collector.
Functions
@spec attach(PhoenixReplay.Config.t(), term()) :: :ok
Attaches the configured collectors. Called by PhoenixReplay.Capture.Handlers.
Handlers are identified by {prefix, index}.
@spec callers() :: [pid()]
The $callers of the current process, which Task sets.
@spec detach(term()) :: :ok
Detaches the collectors attached with prefix.
Handles a telemetry event for a collector.