diff --git a/collection.go b/collection.go index 3384633..8d0e51c 100644 --- a/collection.go +++ b/collection.go @@ -92,7 +92,7 @@ func (coll *DataCollection) saveByMask(ctx context.Context) error { tableName := coll.GetTableName() span.SetAttributes( - attribute.String("db.sql.table", tableName), + attribute.String("table", tableName), ) for _, item := range coll.Items { @@ -125,7 +125,10 @@ func (coll *DataCollection) saveByMask(ctx context.Context) error { log_len = 200 } - return errors.Errorf("%s (%s)", err.Error(), sqlSmt[0:log_len]) + resultErr := errors.Errorf("%s (%s)", err.Error(), sqlSmt[0:log_len]) + span.RecordError(resultErr) + span.SetStatus(codes.Error, resultErr.Error()) + return resultErr } } return nil