database/gdb: remove duplicated SQL records in tracing events (#3659)

This commit is contained in:
houseme 2024-06-25 21:11:36 +08:00 committed by GitHub
parent e8a2629b19
commit f8272bc5f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 3 deletions

View File

@ -29,7 +29,6 @@ const (
traceAttrDbLink = "db.link"
traceAttrDbGroup = "db.group"
traceEventDbExecution = "db.execution"
traceEventDbExecutionSql = "db.execution.sql"
traceEventDbExecutionCost = "db.execution.cost"
traceEventDbExecutionRows = "db.execution.rows"
traceEventDbExecutionTxID = "db.execution.txid"
@ -70,7 +69,6 @@ func (c *Core) traceSpanEnd(ctx context.Context, span trace.Span, sql *Sql) {
}
span.SetAttributes(labels...)
events := []attribute.KeyValue{
attribute.String(traceEventDbExecutionSql, sql.Format),
attribute.String(traceEventDbExecutionCost, fmt.Sprintf(`%d ms`, sql.End-sql.Start)),
attribute.String(traceEventDbExecutionRows, fmt.Sprintf(`%d`, sql.RowsAffected)),
}

2
go.mod
View File

@ -5,6 +5,7 @@ go 1.18
require (
github.com/BurntSushi/toml v1.3.2
github.com/clbanning/mxj/v2 v2.7.0
github.com/emirpasic/gods v1.18.1
github.com/fatih/color v1.16.0
github.com/fsnotify/fsnotify v1.7.0
github.com/gorilla/websocket v1.5.1
@ -20,7 +21,6 @@ require (
)
require (
github.com/emirpasic/gods v1.18.1 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect