Change span attributes for func SaveRow.
This commit is contained in:
parent
a84251e20d
commit
5801184782
9
save.go
9
save.go
|
@ -13,6 +13,7 @@ import (
|
||||||
"go.opentelemetry.io/otel"
|
"go.opentelemetry.io/otel"
|
||||||
"go.opentelemetry.io/otel/attribute"
|
"go.opentelemetry.io/otel/attribute"
|
||||||
"go.opentelemetry.io/otel/codes"
|
"go.opentelemetry.io/otel/codes"
|
||||||
|
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
|
||||||
"go.opentelemetry.io/otel/trace"
|
"go.opentelemetry.io/otel/trace"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -89,10 +90,10 @@ func SaveRow(ctx context.Context, db *db.DBC, dataItem meta.IMetaStruct) error {
|
||||||
sqlSmt := createInsertSQLForFields(ctx, tableName, fields, 1 /*one_row*/)
|
sqlSmt := createInsertSQLForFields(ctx, tableName, fields, 1 /*one_row*/)
|
||||||
|
|
||||||
span.SetAttributes(
|
span.SetAttributes(
|
||||||
attribute.String("table", tableName),
|
semconv.DBSystemKey.String("mysql"),
|
||||||
attribute.String("sql", sqlSmt),
|
semconv.DBSQLTableKey.String(tableName),
|
||||||
//semconv.DBSQLTableKey.String(tableName),
|
semconv.DBStatementKey.String(sqlSmt),
|
||||||
//semconv.DBStatementKey.String(sqlSmt),
|
semconv.DBOperationKey.String("INSERT"),
|
||||||
)
|
)
|
||||||
|
|
||||||
updateBuilder := db.UpdateBySQL(sqlSmt, params...)
|
updateBuilder := db.UpdateBySQL(sqlSmt, params...)
|
||||||
|
|
Loading…
Reference in New Issue