Skip to content

Commit d978a8f

Browse files
authored
Merge pull request #509 from SiaFoundation/nate/fix-prometheus
Fix panic in Prometheus wallet response
2 parents d0a0432 + d433c37 commit d978a8f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

api/prometheus.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package api
22

33
import (
4-
"strings"
54
"time"
65

76
rhp2 "go.sia.tech/core/rhp/v2"
@@ -430,7 +429,7 @@ func (w WalletTransactionsResp) PrometheusMetric() (metrics []prometheus.Metric)
430429
metrics = append(metrics, prometheus.Metric{
431430
Name: metricName,
432431
Labels: map[string]any{
433-
"txid": strings.Split(txn.ID.String(), ":")[1],
432+
"txid": txn.ID.String(),
434433
"type": txn.Type,
435434
},
436435
Value: value,
@@ -454,7 +453,7 @@ func (w WalletPendingResp) PrometheusMetric() (metrics []prometheus.Metric) {
454453
metrics = append(metrics, prometheus.Metric{
455454
Name: metricName,
456455
Labels: map[string]any{
457-
"txid": strings.Split(txn.ID.String(), ":")[1],
456+
"txid": txn.ID.String(),
458457
"type": txn.Type,
459458
},
460459
Value: value,

0 commit comments

Comments
 (0)