File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 1+ Report OpenTracing spans for database activity.
Original file line number Diff line number Diff line change @@ -541,6 +541,7 @@ def new_transaction(
541541 },
542542 ):
543543 r = func (cursor , * args , ** kwargs )
544+ opentracing .log_kv ({"message" : "commit" })
544545 conn .commit ()
545546 return r
546547 except self .engine .module .OperationalError as e :
@@ -556,7 +557,8 @@ def new_transaction(
556557 if i < N :
557558 i += 1
558559 try :
559- conn .rollback ()
560+ with opentracing .start_active_span ("db.rollback" ):
561+ conn .rollback ()
560562 except self .engine .module .Error as e1 :
561563 transaction_logger .warning ("[TXN EROLL] {%s} %s" , name , e1 )
562564 continue
@@ -569,7 +571,8 @@ def new_transaction(
569571 if i < N :
570572 i += 1
571573 try :
572- conn .rollback ()
574+ with opentracing .start_active_span ("db.rollback" ):
575+ conn .rollback ()
573576 except self .engine .module .Error as e1 :
574577 transaction_logger .warning (
575578 "[TXN EROLL] {%s} %s" ,
You can’t perform that action at this time.
0 commit comments