As co-maintainer of Spandex, and specifically spandex_ecto, I’m also keenly interested in what the story is around Ecto and Telemetry in v3.0. I just spent about an hour looking through the ecto, ecto_sql, and postgrex source code to figure out what the story was, and what I’ve found so far is:
The loggers option seems to no longer be there on the Ecto.Repo config (commit that removed it)
The changelog and release announcement don’t list this as a breaking change, but rather a deprecation in favor of using Telemetry instead. I haven’t confirmed yet what happens if you specify the loggers option like before. Maybe it still works?
The Ecto.Repo docs recommend that adapters send [:my_app, :repo, :query] Telemetry events, containing at least the data that Ecto.LogEntry used to send to loggers, but I’m not sure where to find the actual list of events that get sent and what the metadata will be. I am guessing that it’s currently only this, which is the same thing that you used to get from the loggers call-backs. Maybe I missed something or the docs just need some clarification on where to go to find more details?
I am wondering, how it will work when I have multiple repos in single application? Will all be logged into the same event_name? Also how to listen on all events of repo at once? Is there any solution for listening to multiple events at once? Like using prefix instead of full name?
The event name is based on the module name. So if you have MyApp.AnotherRepo, it will be [:my_app, :another_repo, :query]. You can also configure the prefix in the repo.