aws / aws-xray-sdk-go

AWS X-Ray SDK for the Go programming language.
Apache License 2.0
278 stars 118 forks source link

how to wrap pgxpool for tracing #282

Closed ghost closed 2 years ago

ghost commented 3 years ago

Hi everyone, We are using pgxpool with postgres for our database.

Can someone please guide me how can we use tracing here?

I think one way is to create subSegment manually and close them but it will require code changes on a lot of places and need to keep in mind everytime we write a query.

Is there any better option? This is how my db connection happens

    readDBPool, err = pgxpool.Connect(context.Background(), connStr)
    writeDBPool, err = pgxpool.Connect(context.Background(), connStr)

Thanks

stale[bot] commented 2 years ago

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