Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbez committed Nov 27, 2023
1 parent 934e038 commit 72acad6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions store/metrics/metrics.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package metrics

import (
"fmt"
"time"

"github.com/hashicorp/go-metrics"
Expand All @@ -26,6 +27,10 @@ func NewMetrics(labels [][]string) Metrics {
if numGlobalLabels := len(labels); numGlobalLabels > 0 {
parsedGlobalLabels := make([]metrics.Label, numGlobalLabels)
for i, label := range labels {
if len(label) != 2 {
panic(fmt.Errorf("invalid global label length; expected 2, got %d", len(label)))
}

parsedGlobalLabels[i] = metrics.Label{Name: label[0], Value: label[1]}
}

Expand Down

0 comments on commit 72acad6

Please sign in to comment.