-
Notifications
You must be signed in to change notification settings - Fork 847
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 pgx pool acquire tracer #2008
Conversation
Looks pretty good, but I have a few suggestions. I think that It's a little confusing at first whether This might be a separate feature, but it might also make sense to have a |
@jackc updated, but not sure how to pass the current context to the release method, so it can have the same parent trace as the acquire one. Is it ok to save it in the conn struct? |
@ngavinsir I guess the release tracer is a bit trickier than I thought. It is, perhaps, a little weird to use the context from Acquire for the Release. But I suppose context is where things like opentelemetry are stored so it is necessary. 🤔 At least it should be documented that it is the Acquire Context and/or made part of I also wonder if release tracing needs Start and End. Release should be consistently extremely fast and non-blocking. Perhaps it only needs one hook? |
🤔 And on even further reflection, maybe the release tracer doesn't need context at all. As of 6f0deff there is a custom data map available on connections. Any release tracer that needed it could simply store it there. |
@jackc I see, so for example someone can save the passed context on TraceAcquireEnd in the TraceAcquireEndData.Conn.PgConn().CustomData() and access it again inside trace release from TraceReleaseData.Conn.PgConn().CustomData() |
Thanks! |
resolves #1747