/spandex_ecto

Tools for integrating Ecto with Spandex

Primary LanguageElixirMIT LicenseMIT

SpandexEcto

CircleCI Inline docs Coverage Status Hex pm Ebert

Tools for integrating Ecto with Spandex

Limitations

Due to some recent changes in Ecto, we can no longer effectively trace the execution of parallel preloads. All other queries work fine, but until we figure something out that leverages either telemetry or until the task feature listed here is added to the language, we won't be able to support tracing parallel preloads.

Installation

Add spandex_ecto to your list of dependencies in mix.exs:

def deps do
  [
    {:spandex_ecto, "~> 0.5.0"}
  ]
end

Configuration

config :spandex_ecto, SpandexEcto.EctoLogger,
  service: :ecto, # Optional
  tracer: MyApp.Tracer, # Required

# Be aware that this is a *compile* time configuration. As such, if you change this you
# may need to `mix compile --force` and/or `mix deps.compile --force ecto`
config :my_app, MyApp.Repo,
  loggers: [{Ecto.LogEntry, :log, [:info]}, {SpandexEcto.EctoLogger, :trace, ["database_name"]}]