From 849082466d271e95f0bd6788c1bc97e9b87c19c2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 20 Sep 2024 00:39:50 +0000 Subject: [PATCH] Renovate: Update github.com/sapcc/go-bits digest to a80ea73 --- go.mod | 4 ++-- go.sum | 8 ++++---- .../prometheus/client_golang/prometheus/histogram.go | 10 ++++++---- vendor/modules.txt | 4 ++-- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 814bcd3..dea98b1 100644 --- a/go.mod +++ b/go.mod @@ -4,9 +4,9 @@ go 1.23 require ( github.com/beevik/ntp v1.4.3 - github.com/prometheus/client_golang v1.20.3 + github.com/prometheus/client_golang v1.20.4 github.com/sapcc/go-api-declarations v1.12.6 - github.com/sapcc/go-bits v0.0.0-20240912081530-0967be9f0a6b + github.com/sapcc/go-bits v0.0.0-20240919081231-a80ea73a2dce go.uber.org/automaxprocs v1.5.3 ) diff --git a/go.sum b/go.sum index 8d87a42..f56c70f 100644 --- a/go.sum +++ b/go.sum @@ -18,8 +18,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= +github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= @@ -28,8 +28,8 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/sapcc/go-api-declarations v1.12.6 h1:04sQmS3ipzPc+ENSCWW9A4FgCN7Qa5JIbNUNh7ziQJA= github.com/sapcc/go-api-declarations v1.12.6/go.mod h1:83R3hTANhuRXt/pXDby37IJetw8l7DG41s33Tp9NXxI= -github.com/sapcc/go-bits v0.0.0-20240912081530-0967be9f0a6b h1:t9u9Flob/wvaMfttFxfY4cG5iMx3Cs2I3FGSIqHTJ0U= -github.com/sapcc/go-bits v0.0.0-20240912081530-0967be9f0a6b/go.mod h1:ERkSk9u7zke3ZaV0Ug+SWg7y6KRfeRBx/1CkqovTvgA= +github.com/sapcc/go-bits v0.0.0-20240919081231-a80ea73a2dce h1:Wr/hxpBMp3DP28/k3MchR6WHvyZeIDZQ/BgrmvP9/Mc= +github.com/sapcc/go-bits v0.0.0-20240919081231-a80ea73a2dce/go.mod h1:80FgmJ7WhHF837BcfKnTiic5IxIt0XopzIZwtNJfBSs= github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= diff --git a/vendor/github.com/prometheus/client_golang/prometheus/histogram.go b/vendor/github.com/prometheus/client_golang/prometheus/histogram.go index 8a4f49a..519db34 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/histogram.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/histogram.go @@ -844,9 +844,7 @@ func (h *histogram) Write(out *dto.Metric) error { }} } - // If exemplars are not configured, the cap will be 0. - // So append is not needed in this case. - if cap(h.nativeExemplars.exemplars) > 0 { + if h.nativeExemplars.isEnabled() { h.nativeExemplars.Lock() his.Exemplars = append(his.Exemplars, h.nativeExemplars.exemplars...) h.nativeExemplars.Unlock() @@ -1665,6 +1663,10 @@ type nativeExemplars struct { exemplars []*dto.Exemplar } +func (n *nativeExemplars) isEnabled() bool { + return n.ttl != -1 +} + func makeNativeExemplars(ttl time.Duration, maxCount int) nativeExemplars { if ttl == 0 { ttl = 5 * time.Minute @@ -1686,7 +1688,7 @@ func makeNativeExemplars(ttl time.Duration, maxCount int) nativeExemplars { } func (n *nativeExemplars) addExemplar(e *dto.Exemplar) { - if n.ttl == -1 { + if !n.isEnabled() { return } diff --git a/vendor/modules.txt b/vendor/modules.txt index cff5c9c..1f3074f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -19,7 +19,7 @@ github.com/klauspost/compress/zstd/internal/xxhash # github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 ## explicit github.com/munnerz/goautoneg -# github.com/prometheus/client_golang v1.20.3 +# github.com/prometheus/client_golang v1.20.4 ## explicit; go 1.20 github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header @@ -41,7 +41,7 @@ github.com/prometheus/procfs/internal/util # github.com/sapcc/go-api-declarations v1.12.6 ## explicit; go 1.21 github.com/sapcc/go-api-declarations/bininfo -# github.com/sapcc/go-bits v0.0.0-20240912081530-0967be9f0a6b +# github.com/sapcc/go-bits v0.0.0-20240919081231-a80ea73a2dce ## explicit; go 1.23 github.com/sapcc/go-bits/httpext github.com/sapcc/go-bits/logg