elixir-ecto / db_connection

Database connection behaviour

Home Page:http://hexdocs.pm/db_connection/DBConnection.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Telemetry event for capturing DBConnection.ConnectionError

polvalente opened this issue · comments

Is there any way to measure through telemetry if the database keeps dropping connections with DBConnection.ConnectionError?

I noticed that the drop private function in deps/db_connection/lib/db_connection/connection_pool.ex does print a custom inspect whenever the connection is dropped due to timeout. Maybe that could be a place to add the event? Or is there a better place in :ecto or :ecto_sql to do so?

I could work on the PR myself given the right direction!

Thanks in advance

We can definitely add a telemetry event for that. And likely one for when connections are established too.

@josevalim Cool! Can I help in any way?

@josevalim I was reading #228 and maybe adding another message for timeouts could also be a way to handle this. What do you think?

That also sounds good to me! PRs are welcome!

That also sounds good to me! PRs are welcome!

Ok then! I'll try to come up with something

Resolved in #236