Skip to content

Commit

Permalink
Upgrade Prometheus to master (#2918)
Browse files Browse the repository at this point in the history
* Upgrade Prometheus to master

Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>

* Fix promql default interval

Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>

* Fix tests

Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>

* Add comment for manager.Run()

Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
  • Loading branch information
codesome authored Jul 23, 2020
1 parent cedb0b4 commit 32427f7
Show file tree
Hide file tree
Showing 16 changed files with 197 additions and 133 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
* `s3.http.idle-conn-timeout`
* `s3.http.response-header-timeout`
* `s3.http.insecure-skip-verify`
* [ENHANCEMENT] Prometheus upgraded. #2798 #2849 #2867 #2902
* [ENHANCEMENT] Prometheus upgraded. #2798 #2849 #2867 #2902 #2918
* Optimized labels regex matchers for patterns containing literals (eg. `foo.*`, `.*foo`, `.*foo.*`)
* [ENHANCEMENT] Add metric `cortex_ruler_config_update_failures_total` to Ruler to track failures of loading rules files. #2857
* [ENHANCEMENT] Experimental Alertmanager: Alertmanager configuration persisted to object storage using an experimental API that accepts and returns YAML-based Alertmanager configuration. #2768
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ require (
github.com/prometheus/client_golang v1.7.1
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.10.0
github.com/prometheus/prometheus v1.8.2-0.20200720162558-f762a9ec77b3
github.com/prometheus/prometheus v1.8.2-0.20200722151933-4a8531a64b32
github.com/rafaeljusto/redigomock v0.0.0-20190202135759-257e089e14a1
github.com/segmentio/fasthash v0.0.0-20180216231524-a72b379d632e
github.com/spf13/afero v1.2.2
Expand Down
7 changes: 5 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1002,8 +1002,8 @@ github.com/prometheus/prometheus v0.0.0-20190818123050-43acd0e2e93f/go.mod h1:rM
github.com/prometheus/prometheus v1.8.2-0.20200107122003-4708915ac6ef/go.mod h1:7U90zPoLkWjEIQcy/rweQla82OCTUzxVHE51G3OhJbI=
github.com/prometheus/prometheus v1.8.2-0.20200213233353-b90be6f32a33/go.mod h1:fkIPPkuZnkXyopYHmXPxf9rgiPkVgZCN8w9o8+UgBlY=
github.com/prometheus/prometheus v1.8.2-0.20200619100132-74207c04655e/go.mod h1:QV6T0PPQi5UFmqcLBJw3JiyIR8r1O7KEv9qlVw4VV40=
github.com/prometheus/prometheus v1.8.2-0.20200720162558-f762a9ec77b3 h1:nqmHN6hoNaeHjTAU6eNndT09OwBvoxrJHHl+rxHx0Ok=
github.com/prometheus/prometheus v1.8.2-0.20200720162558-f762a9ec77b3/go.mod h1:nnrpCyzNlHMAvHQl3Edz6cUiJZu3q4owFNV3oU3K7x0=
github.com/prometheus/prometheus v1.8.2-0.20200722151933-4a8531a64b32 h1:GcJMaFu1uu6rSueToTRZuVS3AiORbFtLEDMUfp4GA9Q=
github.com/prometheus/prometheus v1.8.2-0.20200722151933-4a8531a64b32/go.mod h1:+/y4DzJ62qmhy0o/H4PtXegRXw+80E8RVRHhLbv+bkM=
github.com/rafaeljusto/redigomock v0.0.0-20190202135759-257e089e14a1 h1:+kGqA4dNN5hn7WwvKdzHl0rdN5AEkbNZd0VjRltAiZg=
github.com/rafaeljusto/redigomock v0.0.0-20190202135759-257e089e14a1/go.mod h1:JaY6n2sDr+z2WTsXkOmNRUfDy6FN0L6Nk7x06ndm4tY=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
Expand Down Expand Up @@ -1164,6 +1164,8 @@ go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/automaxprocs v1.2.0/go.mod h1:YfO3fm683kQpzETxlTGZhGIVmXAhaw3gxeBADbpZtnU=
go.uber.org/goleak v1.0.0 h1:qsup4IcBdlmsnGfqyLl4Ntn3C2XCCuKAE7DwHpScyUo=
go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
Expand Down Expand Up @@ -1421,6 +1423,7 @@ golang.org/x/tools v0.0.0-20190918214516-5a1a30219888/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191111182352-50fa39b762bc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
Expand Down
8 changes: 3 additions & 5 deletions pkg/cortex/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,6 @@ func (t *Cortex) initQueryFrontend() (serv services.Service, err error) {
return
}

// Ensure the default evaluation interval is set (promql uses a package-scoped mutable variable).
// This is important when `querier.parallelise-shardable-queries` is enabled because the frontend
// aggregates the sharded queries.
promql.SetDefaultEvaluationInterval(t.Cfg.Querier.DefaultEvaluationInterval)

tripperware, cache, err := queryrange.NewTripperware(
t.Cfg.QueryRange,
util.Logger,
Expand All @@ -382,6 +377,9 @@ func (t *Cortex) initQueryFrontend() (serv services.Service, err error) {
Reg: prometheus.DefaultRegisterer,
MaxSamples: t.Cfg.Querier.MaxSamples,
Timeout: t.Cfg.Querier.Timeout,
NoStepSubqueryIntervalFn: func(int64) int64 {
return t.Cfg.Querier.DefaultEvaluationInterval.Milliseconds()
},
},
t.Cfg.Querier.QueryIngestersWithin,
prometheus.DefaultRegisterer,
Expand Down
4 changes: 3 additions & 1 deletion pkg/querier/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,16 @@ func New(cfg Config, limits *validation.Overrides, distributor Distributor, stor
level.Warn(util.Logger).Log("msg", "Using deprecated flag -promql.lookback-delta, use -querier.lookback-delta instead")
}

promql.SetDefaultEvaluationInterval(cfg.DefaultEvaluationInterval)
engine := promql.NewEngine(promql.EngineOpts{
Logger: util.Logger,
Reg: reg,
ActiveQueryTracker: createActiveQueryTracker(cfg),
MaxSamples: cfg.MaxSamples,
Timeout: cfg.Timeout,
LookbackDelta: lookbackDelta,
NoStepSubqueryIntervalFn: func(int64) int64 {
return cfg.DefaultEvaluationInterval.Milliseconds()
},
})
return &sampleAndChunkQueryable{lazyQueryable}, engine
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/ruler/ruler.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,9 @@ func (r *Ruler) syncManager(ctx context.Context, user string, groups store.RuleG
level.Error(r.logger).Log("msg", "unable to create rule manager", "user", user, "err", err)
return
}
manager.Run()
// manager.Run() starts running the manager and blocks until Stop() is called.
// Hence run it as another goroutine.
go manager.Run()
r.userManagers[user] = manager
}
err = manager.Update(r.cfg.EvaluationInterval, files, nil)
Expand Down
12 changes: 12 additions & 0 deletions vendor/github.com/prometheus/prometheus/discovery/README.md

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

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

122 changes: 54 additions & 68 deletions vendor/github.com/prometheus/prometheus/promql/engine.go

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

9 changes: 5 additions & 4 deletions vendor/github.com/prometheus/prometheus/promql/test.go

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

Loading

0 comments on commit 32427f7

Please sign in to comment.