Update vendor/
Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
parent
a582b3335a
commit
cdb9e7d2b8
527 changed files with 113006 additions and 150362 deletions
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"
|
||||
|
||||
"github.com/mwitkow/go-conntrack"
|
||||
"golang.org/x/net/http2"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
|
|
@ -153,6 +154,11 @@ func NewRoundTripperFromConfig(cfg HTTPClientConfig, name string, disableKeepAli
|
|||
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
|
||||
// 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
|
||||
// always has 365d, a week always has 7d, and a day always has 24h.
|
||||
func ParseDuration(durationStr string) (Duration, error) {
|
||||
// Allow 0 without a unit.
|
||||
if durationStr == "0" {
|
||||
return 0, nil
|
||||
}
|
||||
matches := durationRE.FindStringSubmatch(durationStr)
|
||||
if len(matches) != 3 {
|
||||
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.
|
||||
func New(config *Config) log.Logger {
|
||||
var l log.Logger
|
||||
if config.Format.s == "logfmt" {
|
||||
l = log.NewLogfmtLogger(log.NewSyncWriter(os.Stderr))
|
||||
} else {
|
||||
if config.Format != nil && config.Format.s == "json" {
|
||||
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)
|
||||
return l
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue