@@ -41,7 +41,7 @@ func NewDBMetrics(s database.Store, logger slog.Logger, reg prometheus.Registere
41
41
// retries = Executions - 1 (as 1 execute is expected)
42
42
"retries" ,
43
43
// Uniquely naming some transactions can help debug reoccurring errors.
44
- "id " ,
44
+ "tx_id " ,
45
45
})
46
46
reg .MustRegister (txRetries )
47
47
@@ -54,7 +54,7 @@ func NewDBMetrics(s database.Store, logger slog.Logger, reg prometheus.Registere
54
54
}, []string {
55
55
"success" , // Did the InTx function return an error?
56
56
// Uniquely naming some transactions can help debug reoccurring errors.
57
- "id " ,
57
+ "tx_id " ,
58
58
})
59
59
reg .MustRegister (txDuration )
60
60
return & metricsStore {
@@ -82,13 +82,13 @@ func (m metricsStore) InTx(f func(database.Store) error, options *database.TxOpt
82
82
// So IDs should be used sparingly to prevent too much bloat.
83
83
m .txDuration .With (prometheus.Labels {
84
84
"success" : strconv .FormatBool (err == nil ),
85
- "id" : options .TxIdentifier , // Can be empty string for unlabeled
85
+ "tx_id" : options .TxIdentifier , // Can be empty string for unlabeled
86
86
}).Observe (dur .Seconds ())
87
87
88
88
m .txRetries .With (prometheus.Labels {
89
89
"success" : strconv .FormatBool (err == nil ),
90
90
"retries" : strconv .FormatInt (int64 (options .ExecutionCount ()- 1 ), 10 ),
91
- "id" : options .TxIdentifier , // Can be empty string for unlabeled
91
+ "tx_id" : options .TxIdentifier , // Can be empty string for unlabeled
92
92
}).Inc ()
93
93
94
94
// Log all serializable transactions that are retried.
@@ -109,7 +109,7 @@ func (m metricsStore) InTx(f func(database.Store) error, options *database.TxOpt
109
109
// since the first error was a serialization error.
110
110
slog .Error (err ), // Might be nil, that is ok!
111
111
slog .F ("executions" , options .ExecutionCount ()),
112
- slog .F ("id " , options .TxIdentifier ),
112
+ slog .F ("tx_id " , options .TxIdentifier ),
113
113
slog .F ("duration" , dur ),
114
114
)
115
115
}
0 commit comments