fuelen / ecto_dev_logger

An alternative logger for Ecto queries
Apache License 2.0
147 stars 14 forks source link

Noisy with Oban #6

Closed dougw-bc closed 2 years ago

dougw-bc commented 2 years ago

Hi @fuelen, Thanks for this package, great idea, and nice simple implementation!

Am seeing a lot of this in the logs:

[debug] [module=Ecto.DevLogger function=telemetry_handler/4 line=63 ] QUERY OK db=0.4ms
begin
[debug] [module=Ecto.DevLogger function=telemetry_handler/4 line=63 ] QUERY OK db=0.2ms
commit
[debug] [module=Ecto.DevLogger function=telemetry_handler/4 line=63 ] QUERY OK db=0.4ms
begin
[debug] [module=Ecto.DevLogger function=telemetry_handler/4 line=63 ] QUERY OK db=0.2ms
commit
[debug] [module=Ecto.DevLogger function=telemetry_handler/4 line=63 ] QUERY OK db=0.3ms
begin
[debug] [module=Ecto.DevLogger function=telemetry_handler/4 line=63 ] QUERY OK db=0.3ms
commit

Think it is coming from Oban, but it seems this does not appear to catch it.

Any ideas?

fuelen commented 2 years ago

Hi @dougw-bc

Here is a related issue https://github.com/sorentwo/oban/issues/628, where :oban_conf telemetry option was introduced. Please ensure you use the latest Oban version.

Just a couple of hours ago, a new Oban version has been released, so maybe even this bug https://github.com/sorentwo/oban/issues/628#issuecomment-1057355457 related to Oban Pro is fixed as well . Try to upgrade and check if logs are still printed. If yes, then that's simply a bug in Oban.

dougw-bc commented 2 years ago

Thanks for the info! Even with the newest oban, it still seems to be happening. In the meantime i have done this - which is not ideal but works OK.

https://github.com/dougw-bc/ecto_dev_logger/blob/quiet_oban/lib/ecto/dev_logger.ex#L63-L71

leandrocp commented 2 years ago

FWIW it seems okay on my env after updating ecto, oban, oban_pro 👍🏻

Ecto 3.8.1 Oban 2.12.0 Oban Pro 0.11.0

jaimeiniesta commented 2 years ago

Hi, thanks for looking into this - I still see noise from Oban with the above versions.

begin
[debug] QUERY OK db=0.2ms
commit
[debug] QUERY OK db=0.3ms
begin
[debug] QUERY OK db=0.3ms
commit
[debug] QUERY OK db=0.5ms
begin
[debug] QUERY OK db=0.2ms
commit
[debug] QUERY OK db=0.5ms
begin
[debug] QUERY OK db=0.3ms
commit

I also checked that I'm on Telemetry 1.1.0

fuelen commented 2 years ago

Hi @jaimeiniesta

Please open the issue in Oban repo

jaimeiniesta commented 2 years ago

Thanks, I've checked and it's now fixed in Oban main branch so that should be available in Oban > 2.12.0