Skip to content

Commit

Permalink
database/gdb: remove duplicated SQL records in tracing events (#3659)
Browse files Browse the repository at this point in the history
  • Loading branch information
houseme authored Jun 25, 2024
1 parent e8a2629 commit f8272bc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions database/gdb/gdb_core_trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)),
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit f8272bc

Please sign in to comment.