-
Notifications
You must be signed in to change notification settings - Fork 298
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
adding nrpgx5 instrumentation tracer for github.com/jackc/pgx/v5 #592
adding nrpgx5 instrumentation tracer for github.com/jackc/pgx/v5 #592
Conversation
Hi @egon12, thanks for contributing. Could you please include a simple example of how to use this library in a directory named |
I am not sure at which point in this extension we should be incorporating the go-agent |
Just for info, this is related for this issues #386. |
Hello are there any update on this? |
Looks good to me, thanks for submitting this. Once you address the comment I left, you have my approval! UPDATE: I went ahead and patched this up, since we are planning a release tomorrow. Thanks for submitting this, it should be live in the v3.20.1 release by EOD tomorrow :) |
7b254a5
to
164c417
Compare
There's any equivalent implementation for v4? |
This PR are adding instrumentation for nrpgx/v5 (https://github.com/jackc/pgx)
Links
The discussion about new tracing in pgx jackc/pgx#1061.
Open Telemetry Implementation for this tracing feature https://github.com/exaring/otelpgx/blob/main/tracer.go
Details
The pgx library has new tracing support in v5. Before pgx only support for logging that only provide us with duration of the operation. With this new tracing feature, we can create new Segment at
QueryStart
and End the Segment withQueryEnd
For passing the segment between
QueryStart
andQueryEnd
we usecontext.Context
. This folllow the implementation from open telemetry.And for the
Host
,Port
andDatabase Name
, I try to followdatabase/sql
implementation innrpq
andnrpgx
by using BaseSegment.To use the library you can use this code