AppSignal v1.12.1 Appsignal.Ecto View Source

Integration for logging Ecto queries

If you're using Ecto 3, attach Appsignal.Ecto to Telemetry query events in your application's start/2 function:

:telemetry.attach(
  "appsignal-ecto",
  [:my_app, :repo, :query],
  &Appsignal.Ecto.handle_event/4,
  nil
)

For versions of Telemetry < 0.3.0, you'll need to call it slightly differently:

Telemetry.attach(
  "appsignal-ecto",
  [:my_app, :repo, :query],
  Appsignal.Ecto,
  :handle_event,
  nil
)

On Ecto 2, add the Appsignal.Ecto module to your Repo's logger configuration instead. The Ecto.LogEntry logger is the default logger for Ecto and needs to be set as well to keep the original Ecto logger behavior intact.

config :my_app, MyApp.Repo,
  loggers: [Appsignal.Ecto, Ecto.LogEntry]

Link to this section Summary

Link to this section Functions

Link to this function

handle_event(event, event_data, metadata, config)

View Source