Skip to content

Update prometheus vendor to master #3345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 11 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.14

require (
cloud.google.com/go/bigtable v1.2.0
cloud.google.com/go/storage v1.6.0
cloud.google.com/go/storage v1.10.0
github.com/Azure/azure-pipeline-go v0.2.2
github.com/Azure/azure-storage-blob-go v0.8.0
github.com/Masterminds/squirrel v0.0.0-20161115235646-20f192218cf5
Expand All @@ -13,7 +13,7 @@ require (
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect
github.com/alicebob/miniredis v2.5.0+incompatible
github.com/armon/go-metrics v0.3.3
github.com/aws/aws-sdk-go v1.34.9
github.com/aws/aws-sdk-go v1.35.5
github.com/blang/semver v3.5.0+incompatible
github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b
github.com/cespare/xxhash v1.1.0
Expand All @@ -28,10 +28,10 @@ require (
github.com/gogo/status v1.0.3
github.com/golang-migrate/migrate/v4 v4.7.0
github.com/golang/protobuf v1.4.2
github.com/golang/snappy v0.0.1
github.com/golang/snappy v0.0.2
github.com/gorilla/mux v1.7.3
github.com/grpc-ecosystem/go-grpc-middleware v1.1.0
github.com/hashicorp/consul/api v1.6.0
github.com/hashicorp/consul/api v1.7.0
github.com/hashicorp/go-cleanhttp v0.5.1
github.com/hashicorp/go-sockaddr v1.0.2
github.com/hashicorp/memberlist v0.2.2
Expand All @@ -48,7 +48,7 @@ require (
github.com/prometheus/client_golang v1.7.1
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.14.0
github.com/prometheus/prometheus v1.8.2-0.20200923143134-7e2db3d092f3
github.com/prometheus/prometheus v1.8.2-0.20201014093524-73e2ce1bd643
github.com/segmentio/fasthash v0.0.0-20180216231524-a72b379d632e
github.com/sony/gobreaker v0.4.1
github.com/spf13/afero v1.2.2
Expand All @@ -59,12 +59,12 @@ require (
github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da // indirect
go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50
go.etcd.io/etcd v0.5.0-alpha.5.0.20200520232829-54ba9589114f
go.uber.org/atomic v1.6.0
golang.org/x/net v0.0.0-20200822124328-c89045814202
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208
go.uber.org/atomic v1.7.0
golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0
golang.org/x/sync v0.0.0-20200930132711-30421366ff76
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e
google.golang.org/api v0.29.0
google.golang.org/grpc v1.30.0
google.golang.org/api v0.32.0
google.golang.org/grpc v1.32.0
gopkg.in/yaml.v2 v2.3.0
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776
sigs.k8s.io/yaml v1.2.0
Expand All @@ -73,7 +73,7 @@ require (
// Override since git.apache.org is down. The docs say to fetch from github.
replace git.apache.org/thrift.git => github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999

replace k8s.io/client-go => k8s.io/client-go v0.18.3
replace k8s.io/client-go => k8s.io/client-go v0.19.2

// >v1.2.0 has some conflict with prometheus/alertmanager. Hence prevent the upgrade till it's fixed.
replace github.com/satori/go.uuid => github.com/satori/go.uuid v1.2.0
Expand Down
184 changes: 153 additions & 31 deletions go.sum

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions pkg/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/opentracing-contrib/go-stdlib/nethttp"
"github.com/opentracing/opentracing-go"
"github.com/prometheus/client_golang/prometheus"
dto "github.com/prometheus/client_model/go"

"github.com/felixge/fgprof"
"github.com/go-kit/kit/log"
Expand Down Expand Up @@ -325,6 +326,8 @@ func (a *API) RegisterQuerier(
regexp.MustCompile(".*"),
func() (v1.RuntimeInfo, error) { return v1.RuntimeInfo{}, errors.New("not implemented") },
&v1.PrometheusVersion{},
// This is used for the stats API which we should not support. Or find other ways to.
prometheus.GathererFunc(func() ([]*dto.MetricFamily, error) { return nil, nil }),
)

// these routes are always registered to the default server
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/queryable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"testing"
"time"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/route"
"github.com/prometheus/prometheus/config"
"github.com/prometheus/prometheus/pkg/labels"
Expand Down Expand Up @@ -149,6 +150,7 @@ func createPrometheusAPI(q storage.SampleAndChunkQueryable) *route.Router {
regexp.MustCompile(".*"),
func() (v1.RuntimeInfo, error) { return v1.RuntimeInfo{}, errors.New("not implemented") },
&v1.PrometheusVersion{},
prometheus.DefaultGatherer,
)

promRouter := route.New().WithPrefix("/api/v1")
Expand Down
4 changes: 3 additions & 1 deletion pkg/querier/distributor_queryable.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ func (q *distributorQuerier) Select(_ bool, sp *storage.SelectHints, matchers ..
// time range manipulation, otherwise we'll end up returning no series at all for
// older time ranges (while in Cortex we do ignore the start/end and always return
// series in ingesters).
if sp == nil {
// Also, in the recent versions of Prometheus, we pass in the hint but with Func set to "series".
// See: https://github.com/prometheus/prometheus/pull/8050
if sp == nil || sp.Func == "series" {
ms, err := q.distributor.MetricsForLabelMatchers(ctx, model.Time(q.mint), model.Time(q.maxt), matchers...)
if err != nil {
return storage.ErrSeriesSet(err)
Expand Down
6 changes: 4 additions & 2 deletions pkg/querier/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,10 @@ func (q querier) Select(_ bool, sp *storage.SelectHints, matchers ...*labels.Mat
// which needs only metadata. Here we expect that metadataQuerier querier will handle that.
// In Cortex it is not feasible to query entire history (with no mint/maxt), so we only ask ingesters and skip
// querying the long-term storage.
if sp == nil {
return q.metadataQuerier.Select(true, nil, matchers...)
// Also, in the recent versions of Prometheus, we pass in the hint but with Func set to "series".
// See: https://github.com/prometheus/prometheus/pull/8050
if sp == nil || sp.Func == "series" {
return q.metadataQuerier.Select(true, sp, matchers...)
}

userID, err := user.ExtractOrgID(ctx)
Expand Down
178 changes: 176 additions & 2 deletions vendor/cloud.google.com/go/CHANGES.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading