PhoenixReplay.Collector.Generic (PhoenixReplay v0.6.2)

Copy Markdown View Source

Collects any telemetry event.

This is the collector behind a bare event name in :collect:

config :phoenix_replay,
  collect: [
    [:my_app, :checkout, :stop],
    {[:my_app, :search, :stop],
     metadata: [:query], keep: &(&1.results > 0), summary: &"search #{&1.query}"}
  ]

Options

  • :event — the event name (required)
  • :metadata — metadata keys to keep. Defaults to [], keeping none, because metadata often holds whole sockets and structs.
  • :keep — a function of the metadata returning whether to record the event, as in Telemetry.Metrics
  • :summary — a function of the metadata returning the line shown in the replay. Defaults to the event name.
  • :mark — true for an event that marks a moment, such as a signup or a completed checkout, as an analytics event would, or the mark's name, such as "Checkout completed"; see PhoenixReplay.Collector.Captured. Defaults to false.

Measurements are kept, with times converted to milliseconds by PhoenixReplay.Collector.milliseconds/1. An event whose name ends in :exception is recorded as an error, described by its kind and reason metadata.