mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 08:53:46 +01:00
More database opentracing (#10136)
Add a couple of extra logs/spans, to give a bit of a better idea.
This commit is contained in:
parent
b2557cbf42
commit
0acb5010ec
2 changed files with 6 additions and 2 deletions
1
changelog.d/10136.feature
Normal file
1
changelog.d/10136.feature
Normal file
|
@ -0,0 +1 @@
|
|||
Report OpenTracing spans for database activity.
|
|
@ -541,6 +541,7 @@ class DatabasePool:
|
|||
},
|
||||
):
|
||||
r = func(cursor, *args, **kwargs)
|
||||
opentracing.log_kv({"message": "commit"})
|
||||
conn.commit()
|
||||
return r
|
||||
except self.engine.module.OperationalError as e:
|
||||
|
@ -556,6 +557,7 @@ class DatabasePool:
|
|||
if i < N:
|
||||
i += 1
|
||||
try:
|
||||
with opentracing.start_active_span("db.rollback"):
|
||||
conn.rollback()
|
||||
except self.engine.module.Error as e1:
|
||||
transaction_logger.warning("[TXN EROLL] {%s} %s", name, e1)
|
||||
|
@ -569,6 +571,7 @@ class DatabasePool:
|
|||
if i < N:
|
||||
i += 1
|
||||
try:
|
||||
with opentracing.start_active_span("db.rollback"):
|
||||
conn.rollback()
|
||||
except self.engine.module.Error as e1:
|
||||
transaction_logger.warning(
|
||||
|
|
Loading…
Reference in a new issue