mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
Update prometheus/common to v0.10.0 (#7258)
Enable HTTP/2. Fixes #5938 Fixes #7237 Add support for "0" duration. Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
parent
5bb7f00d00
commit
000ba35277
2
go.mod
2
go.mod
|
@ -53,7 +53,7 @@ require (
|
||||||
github.com/prometheus/alertmanager v0.20.0
|
github.com/prometheus/alertmanager v0.20.0
|
||||||
github.com/prometheus/client_golang v1.6.0
|
github.com/prometheus/client_golang v1.6.0
|
||||||
github.com/prometheus/client_model v0.2.0
|
github.com/prometheus/client_model v0.2.0
|
||||||
github.com/prometheus/common v0.9.1
|
github.com/prometheus/common v0.10.0
|
||||||
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da
|
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da
|
||||||
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749
|
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749
|
||||||
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd
|
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd
|
||||||
|
|
2
go.sum
2
go.sum
|
@ -670,6 +670,8 @@ github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLy
|
||||||
github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA=
|
github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA=
|
||||||
github.com/prometheus/common v0.9.1 h1:KOMtN28tlbam3/7ZKEYKHhKoJZYYj3gMH4uc62x7X7U=
|
github.com/prometheus/common v0.9.1 h1:KOMtN28tlbam3/7ZKEYKHhKoJZYYj3gMH4uc62x7X7U=
|
||||||
github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
|
github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
|
||||||
|
github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc=
|
||||||
|
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
|
||||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||||
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||||
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||||
|
|
6
vendor/github.com/prometheus/common/config/http_config.go
generated
vendored
6
vendor/github.com/prometheus/common/config/http_config.go
generated
vendored
|
@ -29,6 +29,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/mwitkow/go-conntrack"
|
"github.com/mwitkow/go-conntrack"
|
||||||
|
"golang.org/x/net/http2"
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -153,6 +154,11 @@ func NewRoundTripperFromConfig(cfg HTTPClientConfig, name string, disableKeepAli
|
||||||
conntrack.DialWithName(name),
|
conntrack.DialWithName(name),
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
// TODO: use ForceAttemptHTTP2 when we move to Go 1.13+.
|
||||||
|
err := http2.ConfigureTransport(rt.(*http.Transport))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
// If a bearer token is provided, create a round tripper that will set the
|
// If a bearer token is provided, create a round tripper that will set the
|
||||||
// Authorization header correctly on each request.
|
// Authorization header correctly on each request.
|
||||||
|
|
4
vendor/github.com/prometheus/common/model/time.go
generated
vendored
4
vendor/github.com/prometheus/common/model/time.go
generated
vendored
|
@ -186,6 +186,10 @@ var durationRE = regexp.MustCompile("^([0-9]+)(y|w|d|h|m|s|ms)$")
|
||||||
// ParseDuration parses a string into a time.Duration, assuming that a year
|
// ParseDuration parses a string into a time.Duration, assuming that a year
|
||||||
// always has 365d, a week always has 7d, and a day always has 24h.
|
// always has 365d, a week always has 7d, and a day always has 24h.
|
||||||
func ParseDuration(durationStr string) (Duration, error) {
|
func ParseDuration(durationStr string) (Duration, error) {
|
||||||
|
// Allow 0 without a unit.
|
||||||
|
if durationStr == "0" {
|
||||||
|
return 0, nil
|
||||||
|
}
|
||||||
matches := durationRE.FindStringSubmatch(durationStr)
|
matches := durationRE.FindStringSubmatch(durationStr)
|
||||||
if len(matches) != 3 {
|
if len(matches) != 3 {
|
||||||
return 0, fmt.Errorf("not a valid duration string: %q", durationStr)
|
return 0, fmt.Errorf("not a valid duration string: %q", durationStr)
|
||||||
|
|
10
vendor/github.com/prometheus/common/promlog/log.go
generated
vendored
10
vendor/github.com/prometheus/common/promlog/log.go
generated
vendored
|
@ -94,13 +94,15 @@ type Config struct {
|
||||||
// with a timestamp. The output always goes to stderr.
|
// with a timestamp. The output always goes to stderr.
|
||||||
func New(config *Config) log.Logger {
|
func New(config *Config) log.Logger {
|
||||||
var l log.Logger
|
var l log.Logger
|
||||||
if config.Format.s == "logfmt" {
|
if config.Format != nil && config.Format.s == "json" {
|
||||||
l = log.NewLogfmtLogger(log.NewSyncWriter(os.Stderr))
|
|
||||||
} else {
|
|
||||||
l = log.NewJSONLogger(log.NewSyncWriter(os.Stderr))
|
l = log.NewJSONLogger(log.NewSyncWriter(os.Stderr))
|
||||||
|
} else {
|
||||||
|
l = log.NewLogfmtLogger(log.NewSyncWriter(os.Stderr))
|
||||||
}
|
}
|
||||||
|
|
||||||
l = level.NewFilter(l, config.Level.o)
|
if config.Level != nil {
|
||||||
|
l = level.NewFilter(l, config.Level.o)
|
||||||
|
}
|
||||||
l = log.With(l, "ts", timestampFormat, "caller", log.DefaultCaller)
|
l = log.With(l, "ts", timestampFormat, "caller", log.DefaultCaller)
|
||||||
return l
|
return l
|
||||||
}
|
}
|
||||||
|
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
|
@ -286,7 +286,7 @@ github.com/prometheus/client_golang/prometheus/testutil
|
||||||
github.com/prometheus/client_golang/prometheus/testutil/promlint
|
github.com/prometheus/client_golang/prometheus/testutil/promlint
|
||||||
# github.com/prometheus/client_model v0.2.0
|
# github.com/prometheus/client_model v0.2.0
|
||||||
github.com/prometheus/client_model/go
|
github.com/prometheus/client_model/go
|
||||||
# github.com/prometheus/common v0.9.1
|
# github.com/prometheus/common v0.10.0
|
||||||
github.com/prometheus/common/config
|
github.com/prometheus/common/config
|
||||||
github.com/prometheus/common/expfmt
|
github.com/prometheus/common/expfmt
|
||||||
github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg
|
github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg
|
||||||
|
|
Loading…
Reference in a new issue