Add logs for method DataCollection.saveByMask.
This commit is contained in:
parent
a4e2984934
commit
5af4d90edb
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue