Add logs for method DataCollection.saveByMask.

This commit is contained in:
Владислав Весельский 2024-03-13 15:31:17 +03:00
parent a4e2984934
commit 5af4d90edb
1 changed files with 5 additions and 2 deletions

View File

@ -92,7 +92,7 @@ func (coll *DataCollection) saveByMask(ctx context.Context) error {
tableName := coll.GetTableName() tableName := coll.GetTableName()
span.SetAttributes( span.SetAttributes(
attribute.String("db.sql.table", tableName), attribute.String("table", tableName),
) )
for _, item := range coll.Items { for _, item := range coll.Items {
@ -125,7 +125,10 @@ func (coll *DataCollection) saveByMask(ctx context.Context) error {
log_len = 200 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 return nil