Skip to content

Commit d31ec24

Browse files
krajoramaamberpixels
authored andcommitted
Use a trivial solution to prometheus#1605
Signed-off-by: György Krajcsovits <[email protected]> Signed-off-by: Eugene <[email protected]>
1 parent 3c46f65 commit d31ec24

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: prometheus/histogram.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1682,13 +1682,13 @@ func makeNativeExemplars(ttl time.Duration, maxCount int) nativeExemplars {
16821682
}
16831683

16841684
func (n *nativeExemplars) addExemplar(e *dto.Exemplar) {
1685+
n.Lock()
1686+
defer n.Unlock()
1687+
16851688
if cap(n.exemplars) == 0 {
16861689
return
16871690
}
16881691

1689-
n.Lock()
1690-
defer n.Unlock()
1691-
16921692
// The index where to insert the new exemplar.
16931693
var nIdx int = -1
16941694

0 commit comments

Comments
 (0)