diff --git a/save.go b/save.go index c0053ad..0f2dea2 100644 --- a/save.go +++ b/save.go @@ -13,6 +13,7 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" + semconv "go.opentelemetry.io/otel/semconv/v1.12.0" "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*/) span.SetAttributes( - attribute.String("table", tableName), - attribute.String("sql", sqlSmt), - //semconv.DBSQLTableKey.String(tableName), - //semconv.DBStatementKey.String(sqlSmt), + semconv.DBSystemKey.String("mysql"), + semconv.DBSQLTableKey.String(tableName), + semconv.DBStatementKey.String(sqlSmt), + semconv.DBOperationKey.String("INSERT"), ) updateBuilder := db.UpdateBySQL(sqlSmt, params...)