@@ -4,11 +4,12 @@ import (
4
4
"bytes"
5
5
"errors"
6
6
"fmt"
7
- "github.com/golang/protobuf/proto"
8
7
"math"
9
8
"strings"
10
9
"sync"
11
10
11
+ "github.com/gogo/protobuf/proto"
12
+
12
13
"github.com/go-kit/log/level"
13
14
"github.com/prometheus/client_golang/prometheus"
14
15
dto "github.com/prometheus/client_model/go"
@@ -564,8 +565,8 @@ type UserRegistry struct {
564
565
// UserRegistries holds Prometheus registries for multiple users, guaranteeing
565
566
// multi-thread safety and stable ordering.
566
567
type UserRegistries struct {
567
- regsMu sync.Mutex
568
- regs []UserRegistry
568
+ regsMu sync.Mutex
569
+ regs []UserRegistry
569
570
removedMetrics MetricFamilyMap
570
571
}
571
572
@@ -714,7 +715,7 @@ func (r *UserRegistries) BuildMetricFamiliesPerUser() MetricFamiliesPerUser {
714
715
}
715
716
}
716
717
data = append (data , struct {
717
- user string
718
+ user string
718
719
metrics MetricFamilyMap
719
720
}{
720
721
user : "" , metrics : r .removedMetrics })
@@ -821,8 +822,8 @@ type CollectorVec interface {
821
822
}
822
823
823
824
type MergedMetricFamily struct {
824
- metricFamily * dto.MetricFamily
825
- metricMap MetricMap
825
+ metricFamily * dto.MetricFamily
826
+ metricMap MetricMap
826
827
}
827
828
828
829
func (m * MergedMetricFamily ) CreateMetricFamily () * dto.MetricFamily {
@@ -877,7 +878,7 @@ func getMergeFunc(metricType dto.MetricType) (func(existing *dto.Metric, new *dt
877
878
case dto .MetricType_HISTOGRAM :
878
879
return mergeHistogram , nil
879
880
default :
880
- return nil , errors . New ( fmt .Sprintf ("unknown metric type: %v" , metricType ) )
881
+ return nil , fmt .Errorf ("unknown metric type: %v" , metricType )
881
882
}
882
883
}
883
884
@@ -919,12 +920,12 @@ func mergeSummary(mf1 *dto.Metric, mf2 *dto.Metric) {
919
920
920
921
type MetricMap struct {
921
922
metrics map [string ][]* Metric
922
- lock sync.Mutex
923
+ lock sync.Mutex
923
924
}
924
925
925
926
type Metric struct {
926
- metric dto.Metric
927
- lock sync.Mutex
927
+ metric dto.Metric
928
+ lock sync.Mutex
928
929
}
929
930
930
931
func NewMetricMap () MetricMap {
0 commit comments