Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add connection pool DEBUG logs & tracing. #508

Open
tomchristie opened this issue Feb 10, 2022 Discussed in #505 · 2 comments · May be fixed by #702
Open

Add connection pool DEBUG logs & tracing. #508

tomchristie opened this issue Feb 10, 2022 Discussed in #505 · 2 comments · May be fixed by #702
Labels
enhancement New feature or request

Comments

@tomchristie
Copy link
Member

Escalated from discussion #505

Originally posted by inikolaev February 7, 2022
Hello!

Can you advise some way to monitor connection pool, specifically for the AsyncClient?

What I would like to know is the following:

  • How many request are awaiting a connection
  • How many connections are being used right now (in-flight requests)
  • Some statistics on connection open/close

I could potentially get some numbers using existing request and response hook, what I don't know is when request hook is fired - does it fire before connection is acquired or after - it's not very clear to me from the documentation. But this should be easy to check.

Perhaps there could be added hooks into the connection pool or maybe someone from the community does this in a different way somehow already?

Currently the "trace" extension doesn't provide any visibility around the connection pooling.

It would be neat if we had events around this. I'm not sure exactly what set of events we'd want, but essentially we'd like to be able to track information around when connections are added or removed from the pool, and when connections become active or idle.

The first step here would be to determine what set of events we'd want to see, sketch out how the documentation ought to look once we've added those. Once that's done we can tackle the implementation.

@tomchristie tomchristie added the enhancement New feature or request label Feb 10, 2022
@inikolaev
Copy link

Regarding the events I was thinking about these:

  • pool.connection.wait - waiting for a connection from the pool, but maybe here we need several events, since want might fail due to timeout - similar to what Trace does already
    • pool.connection.wait.started
    • pool.connection.wait.complete
    • pool.connection.wait.failed
  • pool.connection.created - a new connection added to the pool
  • pool.connection.acquired - connection retrieved from the pool
  • pool.connection.released - connection returned into the pool
  • pool.connection.closed - connection closed and removed from the pool

Do you think these make sense? It would at least cover my needs, but maybe there are some metrics I'm not thinking about.

@stale
Copy link

stale bot commented Mar 13, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Mar 13, 2022
@stale stale bot closed this as completed Mar 25, 2022
@karpetrosyan karpetrosyan reopened this May 29, 2023
@stale stale bot removed the wontfix This will not be worked on label May 29, 2023
@karpetrosyan karpetrosyan linked a pull request May 29, 2023 that will close this issue
@tomchristie tomchristie changed the title Add connection pool information to 'trace' extension. Add connection pool DEBUG logs & tracing. Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants