mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
chore: add tx metrics and logs for serialization errors (#15215)
Before db_metrics were all or nothing. Now `InTx` metrics are always recorded, and query metrics are opt in. Adds instrumentation & logging around serialization failures in the database.
This commit is contained in:
@ -104,8 +104,9 @@ func (c *committer) CommitQuota(
|
||||
permit = true
|
||||
consumed = newConsumed
|
||||
return nil
|
||||
}, &sql.TxOptions{
|
||||
Isolation: sql.LevelSerializable,
|
||||
}, &database.TxOptions{
|
||||
Isolation: sql.LevelSerializable,
|
||||
TxIdentifier: "commit_quota",
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user