mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +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:
@ -33,7 +33,7 @@ func ReadModifyUpdate(db Store, f func(tx Store) error,
|
||||
) error {
|
||||
var err error
|
||||
for retries := 0; retries < maxRetries; retries++ {
|
||||
err = db.InTx(f, &sql.TxOptions{
|
||||
err = db.InTx(f, &TxOptions{
|
||||
Isolation: sql.LevelRepeatableRead,
|
||||
})
|
||||
var pqe *pq.Error
|
||||
|
Reference in New Issue
Block a user