Skip to content

Commit 0f1f464

Browse files
codesometomwilkie
authored andcommitted
Vendor update (#1510)
* Vendor update Signed-off-by: Ganesh Vernekar <[email protected]> * Fix legacy_promql Signed-off-by: Ganesh Vernekar <[email protected]> * Updated weaveworks/common fix Signed-off-by: Ganesh Vernekar <[email protected]> * Vendored API conflicts Signed-off-by: Ganesh Vernekar <[email protected]> * Fix alertmanager APIs Signed-off-by: Ganesh Vernekar <[email protected]> * AlertmanagerAPIVersionV2 in ruler Signed-off-by: Ganesh Vernekar <[email protected]> * Use remove-alertmanager branch of Prometheus Signed-off-by: Ganesh Vernekar <[email protected]> * Undo changes to alertmanager Signed-off-by: Ganesh Vernekar <[email protected]> * Modified alertmanager 0.13 Signed-off-by: Ganesh Vernekar <[email protected]>
1 parent 5ae26c4 commit 0f1f464

File tree

562 files changed

+41650
-18855
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

562 files changed

+41650
-18855
lines changed

go.mod

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,15 @@ require (
2727
github.com/gogo/status v1.0.3
2828
github.com/golang/protobuf v1.3.1
2929
github.com/golang/snappy v0.0.1
30-
github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367 // indirect
31-
github.com/googleapis/gnostic v0.2.0 // indirect
3230
github.com/gophercloud/gophercloud v0.0.0-20190307220656-fe1ba5ce12dd // indirect
3331
github.com/gorilla/mux v1.6.2
3432
github.com/gorilla/websocket v1.4.0 // indirect
3533
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4
3634
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
37-
github.com/hashicorp/consul v1.4.4
35+
github.com/hashicorp/consul/api v1.1.0
3836
github.com/hashicorp/go-cleanhttp v0.5.1
3937
github.com/jonboulle/clockwork v0.1.0
40-
github.com/json-iterator/go v1.1.5
38+
github.com/json-iterator/go v1.1.6
4139
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
4240
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 // indirect
4341
github.com/lann/builder v0.0.0-20150808151131-f22ce00fd939 // indirect
@@ -46,22 +44,19 @@ require (
4644
github.com/mattes/migrate v1.3.1
4745
github.com/mattn/go-sqlite3 v1.10.0 // indirect
4846
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
49-
github.com/mitchellh/go-homedir v1.1.0 // indirect
50-
github.com/oklog/oklog v0.2.2 // indirect
47+
github.com/oklog/oklog v0.3.2 // indirect
5148
github.com/onsi/ginkgo v1.8.0 // indirect
5249
github.com/onsi/gomega v1.5.0 // indirect
5350
github.com/opentracing-contrib/go-grpc v0.0.0-20180928155321-4b5a12d3ff02
5451
github.com/opentracing-contrib/go-stdlib v0.0.0-20170113013457-1de4cc2120e7
5552
github.com/opentracing/opentracing-go v1.1.0
56-
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
5753
github.com/philhofer/fwd v0.0.0-20160129035939-98c11a7a6ec8 // indirect
5854
github.com/pkg/errors v0.8.1
59-
github.com/prometheus/alertmanager v0.13.0
60-
github.com/prometheus/client_golang v0.9.3
55+
github.com/prometheus/alertmanager v0.12.1-0.20190731170042-6e135a0112f5
56+
github.com/prometheus/client_golang v1.0.0
6157
github.com/prometheus/common v0.4.1
62-
github.com/prometheus/procfs v0.0.1 // indirect
63-
github.com/prometheus/prometheus v0.0.0-20190417125241-3cc5f9d88062
64-
github.com/prometheus/tsdb v0.8.0
58+
github.com/prometheus/prometheus v0.0.0-20190731144842-63ed2e28f1ac
59+
github.com/prometheus/tsdb v0.9.1
6560
github.com/segmentio/fasthash v0.0.0-20180216231524-a72b379d632e
6661
github.com/sercand/kuberesolver v2.1.0+incompatible // indirect
6762
github.com/sirupsen/logrus v1.4.2 // indirect
@@ -73,14 +68,14 @@ require (
7368
github.com/uber/jaeger-client-go v2.16.0+incompatible
7469
github.com/uber/jaeger-lib v2.0.0+incompatible // indirect
7570
github.com/weaveworks/billing-client v0.0.0-20171006123215-be0d55e547b1
76-
github.com/weaveworks/common v0.0.0-20190410110702-87611edc252e
71+
github.com/weaveworks/common v0.0.0-20190714171817-ddeaa31513fd
7772
github.com/weaveworks/mesh v0.0.0-20170131170447-5015f896ab62
7873
github.com/weaveworks/promrus v1.2.0 // indirect
7974
go.etcd.io/bbolt v1.3.3
8075
go.etcd.io/etcd v0.0.0-20190709142735-eb7dd97135a5
8176
go.uber.org/zap v1.10.0 // indirect
8277
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5 // indirect
83-
golang.org/x/net v0.0.0-20190522155817-f3200d17e092
78+
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3
8479
golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed // indirect
8580
golang.org/x/text v0.3.2 // indirect
8681
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c
@@ -89,5 +84,4 @@ require (
8984
google.golang.org/grpc v1.19.1
9085
gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect
9186
gopkg.in/yaml.v2 v2.2.2
92-
k8s.io/klog v0.2.0 // indirect
9387
)

go.sum

Lines changed: 67 additions & 65 deletions
Large diffs are not rendered by default.

pkg/chunk/aws/metrics_autoscaling.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,19 @@ func promQuery(ctx context.Context, promAPI promV1.API, query string, duration,
363363
Step: step,
364364
}
365365

366-
value, err := promAPI.QueryRange(ctx, query, queryRange)
366+
value, wrngs, err := promAPI.QueryRange(ctx, query, queryRange)
367367
if err != nil {
368368
return nil, err
369369
}
370+
if wrngs != nil {
371+
level.Warn(util.Logger).Log(
372+
"query", query,
373+
"start", queryRange.Start,
374+
"end", queryRange.End,
375+
"step", queryRange.Step,
376+
"warnings", wrngs,
377+
)
378+
}
370379
matrix, ok := value.(model.Matrix)
371380
if !ok {
372381
return nil, fmt.Errorf("Unable to convert value to matrix: %#v", value)

pkg/chunk/aws/metrics_autoscaling_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"time"
88

99
"github.com/pkg/errors"
10+
"github.com/prometheus/client_golang/api"
1011
promV1 "github.com/prometheus/client_golang/api/prometheus/v1"
1112
"github.com/prometheus/common/model"
1213

@@ -429,12 +430,12 @@ func (m *mockPrometheus) SetResponseForReads(usageRates [][]int, errorRates [][]
429430
}
430431
}
431432

432-
func (m *mockPrometheus) QueryRange(ctx context.Context, query string, r promV1.Range) (model.Value, error) {
433+
func (m *mockPrometheus) QueryRange(ctx context.Context, query string, r promV1.Range) (model.Value, api.Warnings, error) {
433434
if len(m.rangeValues) == 0 {
434-
return nil, errors.New("mockPrometheus.QueryRange: out of values")
435+
return nil, nil, errors.New("mockPrometheus.QueryRange: out of values")
435436
}
436437
// Take the first value and move the slice up
437438
ret := m.rangeValues[0]
438439
m.rangeValues = m.rangeValues[1:]
439-
return ret, nil
440+
return ret, nil, nil
440441
}

pkg/configs/configs.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ func (c RulesConfig) parseV2() (map[string][]rules.Rule, error) {
219219
time.Duration(rl.For),
220220
labels.FromMap(rl.Labels),
221221
labels.FromMap(rl.Annotations),
222+
nil,
222223
true,
223224
log.With(util.Logger, "alert", rl.Alert),
224225
))
@@ -267,7 +268,7 @@ func (c RulesConfig) parseV1() (map[string][]rules.Rule, error) {
267268
}
268269

269270
rule = rules.NewAlertingRule(
270-
r.Name, expr, r.Duration, r.Labels, r.Annotations, true,
271+
r.Name, expr, r.Duration, r.Labels, r.Annotations, nil, true,
271272
log.With(util.Logger, "alert", r.Name),
272273
)
273274

pkg/configs/configs_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func TestParseLegacyAlerts(t *testing.T) {
4646
labels.Labels{
4747
labels.Label{Name: "message", Value: "I am a message"},
4848
},
49+
nil,
4950
true,
5051
log.With(util.Logger, "alert", "TestAlert"),
5152
)

pkg/configs/legacy_promql/engine.go

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,13 +1297,17 @@ func (ev *evaluator) VectorBinop(op ItemType, lhs, rhs Vector, matching *VectorM
12971297
// signatureFunc returns a function that calculates the signature for a metric
12981298
// ignoring the provided labels. If on, then the given labels are only used instead.
12991299
func signatureFunc(on bool, names ...string) func(labels.Labels) uint64 {
1300-
// TODO(fabxc): ensure names are sorted and then use that and sortedness
1301-
// of labels by names to speed up the operations below.
1302-
// Alternatively, inline the hashing and don't build new label sets.
1300+
sort.Strings(names)
13031301
if on {
1304-
return func(lset labels.Labels) uint64 { return lset.HashForLabels(names...) }
1302+
return func(lset labels.Labels) uint64 {
1303+
h, _ := lset.HashForLabels(make([]byte, 0, 1024), names...)
1304+
return h
1305+
}
1306+
}
1307+
return func(lset labels.Labels) uint64 {
1308+
h, _ := lset.HashWithoutLabels(make([]byte, 0, 1024), names...)
1309+
return h
13051310
}
1306-
return func(lset labels.Labels) uint64 { return lset.HashWithoutLabels(names...) }
13071311
}
13081312

13091313
// resultMetric returns the metric for the given sample(s) based on the Vector
@@ -1503,6 +1507,8 @@ func (ev *evaluator) aggregation(op ItemType, grouping []string, without bool, p
15031507
}
15041508
}
15051509

1510+
sort.Strings(grouping)
1511+
buf := make([]byte, 0, 1024)
15061512
for _, s := range vec {
15071513
metric := s.Metric
15081514

@@ -1516,9 +1522,9 @@ func (ev *evaluator) aggregation(op ItemType, grouping []string, without bool, p
15161522
groupingKey uint64
15171523
)
15181524
if without {
1519-
groupingKey = metric.HashWithoutLabels(grouping...)
1525+
groupingKey, buf = metric.HashWithoutLabels(buf, grouping...)
15201526
} else {
1521-
groupingKey = metric.HashForLabels(grouping...)
1527+
groupingKey, buf = metric.HashForLabels(buf, grouping...)
15221528
}
15231529

15241530
group, ok := result[groupingKey]

pkg/configs/legacy_promql/engine_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,11 @@ type errQuerier struct {
132132
func (q *errQuerier) Select(*storage.SelectParams, ...*labels.Matcher) (storage.SeriesSet, storage.Warnings, error) {
133133
return errSeriesSet{err: q.err}, nil, q.err
134134
}
135-
func (*errQuerier) LabelValues(name string) ([]string, error) { return nil, nil }
136-
func (*errQuerier) LabelNames() ([]string, error) { return nil, nil }
137-
func (*errQuerier) Close() error { return nil }
135+
func (q *errQuerier) LabelValues(name string) ([]string, storage.Warnings, error) {
136+
return nil, nil, q.err
137+
}
138+
func (q *errQuerier) LabelNames() ([]string, storage.Warnings, error) { return nil, nil, q.err }
139+
func (q *errQuerier) Close() error { return q.err }
138140

139141
// errSeriesSet implements storage.SeriesSet which always returns error.
140142
type errSeriesSet struct {

0 commit comments

Comments
 (0)