Add "func WithPoolName(name string) Option" to jackc/pgx.v5 allowing separate traces and metrics for multiple database pools #4678
marstid
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Package Name
jackc/pgx.v5
Package Version(s)
No response
Describe the feature you'd like
When running a micro service with multiple connection pools I need a way to separate the traces and metrics by
adding
with something like:
pool, err := pgxtrace.NewPool(ctx, connString,
pgxtrace.WithService("service-api"),
pgxtrace.WithPoolName("read-replica"),
pgxtrace.WithPoolStats(),
)
Is your feature request related to a problem?
Applications commonly use multiple pgx pools within the same service
(e.g. read/write, primary/replica, tenant-specific pools). Existing
service tags are not enough to distinguish those
pools in traces and pool metrics.
Describe alternatives you've considered
I have my own fork with this implemented, but then I need to keep that in sync with your upstream.
Would also assume others would benefit as well from this tiny feature.
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions