Skip to content

Commit

Permalink
Add prepared statement name attribute if not empty
Browse files Browse the repository at this point in the history
Co-authored-by: Leo Antunes <leo@costela.net>
  • Loading branch information
lzakharov and costela committed Sep 29, 2023
1 parent 44fce26 commit 898b28d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ func (t *Tracer) TracePrepareStart(ctx context.Context, conn *pgx.Conn, data pgx
opts := []trace.SpanStartOption{
trace.WithSpanKind(trace.SpanKindClient),
trace.WithAttributes(t.attrs...),
}

if data.Name != "" {
trace.WithAttributes(PrepareStmtNameKey.String(data.Name)),
}

Expand Down

0 comments on commit 898b28d

Please sign in to comment.