mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore]: Bump github.com/prometheus/client_golang from 1.20.3 to 1.20.4 (#3327)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.3 to 1.20.4. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.20.3...v1.20.4) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
10
vendor/github.com/prometheus/client_golang/prometheus/histogram.go
generated
vendored
10
vendor/github.com/prometheus/client_golang/prometheus/histogram.go
generated
vendored
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user