PhoenixReplay.Collector.Ecto (PhoenixReplay v0.6.2)

Copy Markdown View Source

Collects Ecto queries.

config :phoenix_replay,
  collect: [{PhoenixReplay.Collector.Ecto, repo: MyApp.Repo, slower_than: 2}]

Ecto emits its query event in the process that runs the query, so queries from a LiveView and from its start_async/3 and assign_async/3 tasks are recorded in its session. Each query records its SQL as the summary, its source, and its total, query, queue and decode times in milliseconds. A query that returned an error is recorded as an error.

Options

  • :repo — the repo whose queries to collect (required). Add one entry per repo. Its :telemetry_prefix is read from Ecto.Repo.config/0.
  • :slower_than — milliseconds below which queries are skipped
  • :params — whether to record query parameters, which may hold personal data. Defaults to false.