Closed realglebivanov closed 5 months ago
The pool ID should be the name of the Ecto repo, no? My biggest concern is that those costs will be paid by everyone in every operation, regardless of the sampling or need. So I think we should try polling first and fallback to telemetry only if that doesn’t work. Or put the telemetry in this PR behind some periodic action.
@josevalim Hey, thanks for the review! I fixed the issue you had found but the tests are a little bit ugly. Hopefully, we'll find the correct solution.
Thank you, this looks great! I think we just need to move it to the DBConnection
module now, which is the public API. But perhaps, to do so, we need a callback in the pool and implement it in the ownership pool too? 🤔
Fair enough but this will introduce a breaking change into the API. Every custom pool there is will have to implement the new callback. Also, it would probably be better to move this to DBConnection.Pool as it seems to be a part of the API as well
Actually, it isn't a part of the public API but I guess it should be a part of both DBConnection.Pool and DBConnection.
Yes, the pool API is private, so we are fine (but it would be fine to add new callbacks to behaviours nonetheless).
@josevalim I've managed to come up with a sketch of what the public API might look like. Please, take a look!
Thanks, José! I'd rather leave it as it is if you don't mind. I just wanted the end user to decide in which way it would be convenient to aggregate the metrics.
:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart:
:heart: i'm a contributor now :rofl:
And not an easy feature to add, well done!
Hello!
Since these two PRs seem to be abandoned
https://github.com/elixir-ecto/db_connection/pull/306 https://github.com/elixir-ecto/db_connection/pull/292,
I've decided to open another one that will hopefully be merged.