Skip to content

Commit

Permalink
Merge pull request #509 from SiaFoundation/nate/fix-prometheus
Browse files Browse the repository at this point in the history
Fix panic in Prometheus wallet response
  • Loading branch information
n8maninger authored Nov 20, 2024
2 parents d0a0432 + d433c37 commit d978a8f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions api/prometheus.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package api

import (
"strings"
"time"

rhp2 "go.sia.tech/core/rhp/v2"
Expand Down Expand Up @@ -430,7 +429,7 @@ func (w WalletTransactionsResp) PrometheusMetric() (metrics []prometheus.Metric)
metrics = append(metrics, prometheus.Metric{
Name: metricName,
Labels: map[string]any{
"txid": strings.Split(txn.ID.String(), ":")[1],
"txid": txn.ID.String(),
"type": txn.Type,
},
Value: value,
Expand All @@ -454,7 +453,7 @@ func (w WalletPendingResp) PrometheusMetric() (metrics []prometheus.Metric) {
metrics = append(metrics, prometheus.Metric{
Name: metricName,
Labels: map[string]any{
"txid": strings.Split(txn.ID.String(), ":")[1],
"txid": txn.ID.String(),
"type": txn.Type,
},
Value: value,
Expand Down

0 comments on commit d978a8f

Please sign in to comment.