Skip to content
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

*: update Cortex (and Prometheus) dependency #4586

Merged
merged 8 commits into from
Sep 1, 2021
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
- [#4607](https://github.com/thanos-io/thanos/pull/4607) Azure: Fix Azure MSI Rate Limit

### Changed

- [#4519](https://github.com/thanos-io/thanos/pull/4519) Query: switch to miekgdns DNS resolver as the default one.
- [#4586](https://github.com/thanos-io/thanos/pull/4586) Update Prometheus/Cortex dependencies and implement LabelNames() pushdown as a result; provides massive speed-up for the labels API in Thanos Query.

## [v0.22.0](https://github.com/thanos-io/thanos/tree/release-0.22) - 2021.07.22

Expand Down
5 changes: 3 additions & 2 deletions cmd/thanos/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/opentracing/opentracing-go"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/prometheus/common/version"
"github.com/thanos-io/thanos/pkg/extkingpin"
"github.com/thanos-io/thanos/pkg/logging"
Expand Down Expand Up @@ -71,8 +72,8 @@ func main() {
metrics := prometheus.NewRegistry()
metrics.MustRegister(
version.NewCollector("thanos"),
prometheus.NewGoCollector(),
prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}),
collectors.NewGoCollector(),
collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}),
)

// Some packages still use default Register. Replace to have those metrics.
Expand Down
2 changes: 1 addition & 1 deletion cmd/thanos/query_frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func runQueryFrontend(
}

// Create a downstream roundtripper.
roundTripper, err := cortexfrontend.NewDownstreamRoundTripper(cfg.DownstreamURL)
roundTripper, err := cortexfrontend.NewDownstreamRoundTripper(cfg.DownstreamURL, http.DefaultTransport)
if err != nil {
return errors.Wrap(err, "setup downstream roundtripper")
}
Expand Down
5 changes: 3 additions & 2 deletions cmd/thanos/receive.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func registerReceive(app *extkingpin.App) {
WALCompression: conf.walCompression,
AllowOverlappingBlocks: conf.tsdbAllowOverlappingBlocks,
MaxExemplars: conf.tsdbMaxExemplars,
EnableExemplarStorage: true,
yeya24 marked this conversation as resolved.
Show resolved Hide resolved
}

// Are we running in IngestorOnly, RouterOnly or RouterIngestor mode?
Expand Down Expand Up @@ -695,7 +696,7 @@ type receiveConfig struct {
tsdbMinBlockDuration *model.Duration
tsdbMaxBlockDuration *model.Duration
tsdbAllowOverlappingBlocks bool
tsdbMaxExemplars int
tsdbMaxExemplars int64

walCompression bool
noLockFile bool
Expand Down Expand Up @@ -773,7 +774,7 @@ func (rc *receiveConfig) registerFlag(cmd extkingpin.FlagClause) {
"Enables support for ingesting exemplars and sets the maximum number of exemplars that will be stored per tenant."+
" In case the exemplar storage becomes full (number of stored exemplars becomes equal to max-exemplars),"+
" ingesting a new exemplar will evict the oldest exemplar from storage. 0 (or less) value of this flag disables exemplars storage.").
Default("0").IntVar(&rc.tsdbMaxExemplars)
Default("0").Int64Var(&rc.tsdbMaxExemplars)

cmd.Flag("hash-func", "Specify which hash function to use when calculating the hashes of produced files. If no function has been specified, it does not happen. This permits avoiding downloading some files twice albeit at some performance cost. Possible values are: \"\", \"SHA256\".").
Default("").EnumVar(&rc.hashFunc, "SHA256", "")
Expand Down
6 changes: 5 additions & 1 deletion cmd/thanos/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ func runRule(
addDiscoveryGroups(g, queryClient, conf.query.dnsSDInterval)
}

db, err := tsdb.Open(conf.dataDir, log.With(logger, "component", "tsdb"), reg, tsdbOpts)
db, err := tsdb.Open(conf.dataDir, log.With(logger, "component", "tsdb"), reg, tsdbOpts, nil)
if err != nil {
return errors.Wrap(err, "open TSDB")
}
Expand Down Expand Up @@ -436,6 +436,10 @@ func runRule(
},
queryFuncCreator(logger, queryClients, metrics.duplicatedQuery, metrics.ruleEvalWarnings, conf.query.httpMethod),
conf.lset,
// In our case the querying URL is the external URL because in Prometheus
// --web.external-url points to it i.e. it points at something where the user
// could execute the alert or recording rule's expression and get results.
conf.alertQueryURL.String(),
)

// Schedule rule manager that evaluates rules.
Expand Down
45 changes: 24 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module github.com/thanos-io/thanos

require (
cloud.google.com/go v0.81.0
cloud.google.com/go v0.87.0
cloud.google.com/go/storage v1.10.0
github.com/Azure/azure-pipeline-go v0.2.3
github.com/Azure/azure-storage-blob-go v0.13.0
Expand All @@ -16,7 +16,7 @@ require (
github.com/cespare/xxhash/v2 v2.1.1
github.com/chromedp/cdproto v0.0.0-20200424080200-0de008e41fa0
github.com/chromedp/chromedp v0.5.3
github.com/cortexproject/cortex v1.8.1-0.20210422151339-cf1c444e0905
github.com/cortexproject/cortex v1.10.1-0.20210820081236-70dddb6b70b8
github.com/davecgh/go-spew v1.1.1
github.com/efficientgo/e2e v0.9.0
github.com/efficientgo/tools/extkingpin v0.0.0-20210609125236-d73259166f20
Expand All @@ -25,13 +25,15 @@ require (
github.com/felixge/fgprof v0.9.1
github.com/fortytw2/leaktest v1.3.0
github.com/fsnotify/fsnotify v1.4.9
github.com/go-kit/kit v0.10.0
github.com/go-kit/kit v0.11.0
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-openapi/strfmt v0.20.1
github.com/gogo/protobuf v1.3.2
github.com/gogo/status v1.0.3
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
github.com/golang/snappy v0.0.3
github.com/gogo/status v1.1.0
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
github.com/golang/snappy v0.0.4
github.com/googleapis/gax-go v2.0.2+incompatible
github.com/grafana/dskit v0.0.0-20210819132858-471020752967
github.com/grpc-ecosystem/go-grpc-middleware/providers/kit/v2 v2.0.0-20201002093600-73cf2ae9d891
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.2.0.20201207153454-9f6bf00c00a7
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
Expand All @@ -41,7 +43,7 @@ require (
github.com/leanovate/gopter v0.2.4
github.com/lightstep/lightstep-tracer-go v0.18.1
github.com/lovoo/gcloud-opentracing v0.3.0
github.com/miekg/dns v1.1.41
github.com/miekg/dns v1.1.42
github.com/minio/minio-go/v7 v7.0.10
github.com/mozillazg/go-cos v0.13.0
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
Expand All @@ -53,27 +55,28 @@ require (
github.com/opentracing/opentracing-go v1.2.0
github.com/pkg/errors v0.9.1
github.com/pmezard/go-difflib v1.0.0
github.com/prometheus/alertmanager v0.21.1-0.20210422101724-8176f78a70e1
github.com/prometheus/client_golang v1.10.0
github.com/prometheus/alertmanager v0.22.3-0.20210726110322-3d86bd709df8
github.com/prometheus/client_golang v1.11.0
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.23.0
github.com/prometheus/exporter-toolkit v0.5.1
github.com/prometheus/prometheus v1.8.2-0.20210519120135-d95b0972505f
github.com/uber/jaeger-client-go v2.28.0+incompatible
github.com/prometheus/common v0.29.0
github.com/prometheus/exporter-toolkit v0.6.0
github.com/prometheus/prometheus v1.8.2-0.20210720123808-b1ed4a0a663d
github.com/uber/jaeger-client-go v2.29.1+incompatible
github.com/uber/jaeger-lib v2.4.1+incompatible
github.com/weaveworks/common v0.0.0-20210419092856-009d1eebd624
github.com/weaveworks/common v0.0.0-20210722103813-e649eff5ab4a
go.elastic.co/apm v1.11.0
go.elastic.co/apm/module/apmot v1.11.0
go.uber.org/atomic v1.7.0
go.uber.org/atomic v1.9.0
go.uber.org/automaxprocs v1.4.0
go.uber.org/goleak v1.1.10
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a
golang.org/x/oauth2 v0.0.0-20210427180440-81ed05c6b58c
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20210820121016-41cdb8703e55 // indirect
golang.org/x/text v0.3.6
google.golang.org/api v0.46.0
google.golang.org/genproto v0.0.0-20210429181445-86c259c2b4ab
google.golang.org/grpc v1.37.0
google.golang.org/api v0.50.0
google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a
google.golang.org/grpc v1.39.0
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/fsnotify.v1 v1.4.7
gopkg.in/yaml.v2 v2.4.0
Expand All @@ -94,7 +97,7 @@ replace (
// TODO: Remove this: https://github.com/thanos-io/thanos/issues/3967.
github.com/minio/minio-go/v7 => github.com/bwplotka/minio-go/v7 v7.0.11-0.20210324165441-f9927e5255a6
// Make sure Prometheus version is pinned as Prometheus semver does not include Go APIs.
github.com/prometheus/prometheus => github.com/prometheus/prometheus v1.8.2-0.20210519120135-d95b0972505f
github.com/prometheus/prometheus => github.com/prometheus/prometheus v1.8.2-0.20210720123808-b1ed4a0a663d
github.com/sercand/kuberesolver => github.com/sercand/kuberesolver v2.4.0+incompatible
google.golang.org/grpc => google.golang.org/grpc v1.29.1

Expand Down
Loading