@@ -78,7 +78,7 @@ func Start(cfg *config.Config) error {
78
78
failureMetric := & ginmetrics.Metric {
79
79
// This is a Gauge because input-output-hk's is a gauge
80
80
Type : ginmetrics .Gauge ,
81
- Name : "tx_failure_count " ,
81
+ Name : "tx_submit_fail_count " ,
82
82
Description : "transactions failed" ,
83
83
Labels : nil ,
84
84
}
@@ -138,7 +138,7 @@ func handleSubmitTx(c *gin.Context) {
138
138
// Log the error, return an error to the user, and increment failed count
139
139
logger .Errorf ("invalid request body, should be application/cbor" )
140
140
c .Data (415 , "application/json" , []byte ("invalid request body, should be application/cbor" ))
141
- _ = ginmetrics .GetMonitor ().GetMetric ("tx_failure_count " ).Inc (nil )
141
+ _ = ginmetrics .GetMonitor ().GetMetric ("tx_submit_fail_count " ).Inc (nil )
142
142
return
143
143
}
144
144
// Read raw transaction bytes from the request body and store in a byte array
@@ -147,7 +147,7 @@ func handleSubmitTx(c *gin.Context) {
147
147
// Log the error, return an error to the user, and increment failed count
148
148
logger .Errorf ("failed to read request body: %s" , err )
149
149
c .Data (500 , "application/json" , []byte ("failed to read request body" ))
150
- _ = ginmetrics .GetMonitor ().GetMetric ("tx_failure_count " ).Inc (nil )
150
+ _ = ginmetrics .GetMonitor ().GetMetric ("tx_submit_fail_count " ).Inc (nil )
151
151
return
152
152
}
153
153
// Close request body after read
@@ -159,7 +159,7 @@ func handleSubmitTx(c *gin.Context) {
159
159
if err := cbor .Unmarshal (txRawBytes , & txUnwrap ); err != nil {
160
160
logger .Errorf ("failed to unwrap transaction CBOR: %s" , err )
161
161
c .Data (400 , "application/json" , []byte (fmt .Sprintf ("failed to unwrap transaction CBOR: %s" , err )))
162
- _ = ginmetrics .GetMonitor ().GetMetric ("tx_failure_count " ).Inc (nil )
162
+ _ = ginmetrics .GetMonitor ().GetMetric ("tx_submit_fail_count " ).Inc (nil )
163
163
return
164
164
}
165
165
// index 0 is the transaction body
@@ -188,21 +188,21 @@ func handleSubmitTx(c *gin.Context) {
188
188
if err != nil {
189
189
logger .Errorf ("failure creating Ouroboros connection: %s" , err )
190
190
c .Data (500 , "application/json" , []byte ("failure communicating with node" ))
191
- _ = ginmetrics .GetMonitor ().GetMetric ("tx_failure_count " ).Inc (nil )
191
+ _ = ginmetrics .GetMonitor ().GetMetric ("tx_submit_fail_count " ).Inc (nil )
192
192
return
193
193
}
194
194
if cfg .Node .Address != "" && cfg .Node .Port > 0 {
195
195
if err := oConn .Dial ("tcp" , fmt .Sprintf ("%s:%d" , cfg .Node .Address , cfg .Node .Port )); err != nil {
196
196
logger .Errorf ("failure connecting to node via TCP: %s" , err )
197
197
c .Data (500 , "application/json" , []byte ("failure communicating with node" ))
198
- _ = ginmetrics .GetMonitor ().GetMetric ("tx_failure_count " ).Inc (nil )
198
+ _ = ginmetrics .GetMonitor ().GetMetric ("tx_submit_fail_count " ).Inc (nil )
199
199
return
200
200
}
201
201
} else {
202
202
if err := oConn .Dial ("unix" , cfg .Node .SocketPath ); err != nil {
203
203
logger .Errorf ("failure connecting to node via UNIX socket: %s" , err )
204
204
c .Data (500 , "application/json" , []byte ("failure communicating with node" ))
205
- _ = ginmetrics .GetMonitor ().GetMetric ("tx_failure_count " ).Inc (nil )
205
+ _ = ginmetrics .GetMonitor ().GetMetric ("tx_submit_fail_count " ).Inc (nil )
206
206
return
207
207
}
208
208
}
@@ -212,7 +212,7 @@ func handleSubmitTx(c *gin.Context) {
212
212
if ok {
213
213
logger .Errorf ("failure communicating with node: %s" , err )
214
214
c .Data (500 , "application/json" , []byte ("failure communicating with node" ))
215
- _ = ginmetrics .GetMonitor ().GetMetric ("tx_failure_count " ).Inc (nil )
215
+ _ = ginmetrics .GetMonitor ().GetMetric ("tx_submit_fail_count " ).Inc (nil )
216
216
doneChan <- true
217
217
}
218
218
}()
@@ -235,7 +235,7 @@ func handleSubmitTx(c *gin.Context) {
235
235
}
236
236
doneChan <- true
237
237
// Increment custom metric
238
- _ = ginmetrics .GetMonitor ().GetMetric ("tx_failure_count " ).Inc (nil )
238
+ _ = ginmetrics .GetMonitor ().GetMetric ("tx_submit_fail_count " ).Inc (nil )
239
239
return nil
240
240
},
241
241
}
0 commit comments