upgrade github.com/prometheus/client_golang to v1.13.1
This commit is contained in:
5
vendor/github.com/prometheus/client_golang/prometheus/counter.go
generated
vendored
5
vendor/github.com/prometheus/client_golang/prometheus/counter.go
generated
vendored
@@ -140,12 +140,13 @@ func (c *counter) get() float64 {
|
||||
}
|
||||
|
||||
func (c *counter) Write(out *dto.Metric) error {
|
||||
val := c.get()
|
||||
|
||||
// Read the Exemplar first and the value second. This is to avoid a race condition
|
||||
// where users see an exemplar for a not-yet-existing observation.
|
||||
var exemplar *dto.Exemplar
|
||||
if e := c.exemplar.Load(); e != nil {
|
||||
exemplar = e.(*dto.Exemplar)
|
||||
}
|
||||
val := c.get()
|
||||
|
||||
return populateMetric(CounterValue, val, c.labelPairs, exemplar, out)
|
||||
}
|
||||
|
2
vendor/github.com/prometheus/client_golang/prometheus/histogram.go
generated
vendored
2
vendor/github.com/prometheus/client_golang/prometheus/histogram.go
generated
vendored
@@ -613,7 +613,7 @@ func (h *constHistogram) Write(out *dto.Metric) error {
|
||||
// to send it to Prometheus in the Collect method.
|
||||
//
|
||||
// buckets is a map of upper bounds to cumulative counts, excluding the +Inf
|
||||
// bucket.
|
||||
// bucket. The +Inf bucket is implicit, and its value is equal to the provided count.
|
||||
//
|
||||
// NewConstHistogram returns an error if the length of labelValues is not
|
||||
// consistent with the variable labels in Desc or if Desc is invalid.
|
||||
|
2
vendor/github.com/prometheus/client_golang/prometheus/metric.go
generated
vendored
2
vendor/github.com/prometheus/client_golang/prometheus/metric.go
generated
vendored
@@ -187,7 +187,7 @@ func (m *withExemplarsMetric) Write(pb *dto.Metric) error {
|
||||
} else {
|
||||
// The +Inf bucket should be explicitly added if there is an exemplar for it, similar to non-const histogram logic in https://github.com/prometheus/client_golang/blob/main/prometheus/histogram.go#L357-L365.
|
||||
b := &dto.Bucket{
|
||||
CumulativeCount: proto.Uint64(pb.Histogram.Bucket[len(pb.Histogram.GetBucket())-1].GetCumulativeCount()),
|
||||
CumulativeCount: proto.Uint64(pb.Histogram.GetSampleCount()),
|
||||
UpperBound: proto.Float64(math.Inf(1)),
|
||||
Exemplar: e,
|
||||
}
|
||||
|
1
vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_client.go
generated
vendored
1
vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_client.go
generated
vendored
@@ -78,7 +78,6 @@ func InstrumentRoundTripperCounter(counter *prometheus.CounterVec, next http.Rou
|
||||
1,
|
||||
rtOpts.getExemplarFn(r.Context()),
|
||||
)
|
||||
counter.With(labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...)).Inc()
|
||||
}
|
||||
return resp, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user