-
Notifications
You must be signed in to change notification settings - Fork 832
Adding the Ruler to the Single Binary #2854
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
pracucci
merged 23 commits into
cortexproject:master
from
joe-elliott:ruler-single-binary
Jul 16, 2020
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
2b92507
Moved queryable and engine creation into initStoreQueryables
joe-elliott ad832c7
Enabled ruler sharding in local dev mode
joe-elliott 822c244
Added local filesystem option. Added ruler config to single binary.
joe-elliott 8b01b6b
StoreQueryable => Queryable
joe-elliott 74391b7
Made queryable dependent on the distributor
joe-elliott c3b066c
lint + doc
joe-elliott 6fab147
changelog
joe-elliott a3222bf
Fixed test
joe-elliott 0782259
Url => URL
joe-elliott 9347b3a
Url => URL
joe-elliott b698acb
Added local storage option for ruler and added tests
joe-elliott befddc8
lint
joe-elliott c3f651e
make doc
joe-elliott 94f51af
Merge branch 'master' into ruler-single-binary
joe-elliott 207d7f6
Split promql query engine in two
joe-elliott ad38df0
Addressed review concerns
joe-elliott e3ded38
removed 2s poll interval from standard configs and moved to test
joe-elliott fd63adc
Added notes about local storage
joe-elliott 569599d
Clarified creation/deletion
joe-elliott d0e1254
readme cleanup
joe-elliott 2eab3d7
Removed ruler config from integration tests. Allow single binary to …
joe-elliott 41a65f5
Reworked the CHANGELOG
pracucci a18f4cb
Merge branch 'master' into ruler-single-binary
pracucci File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
development/tsdb-blocks-storage-s3-single-binary/.data-minio/.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
* | ||
!cortex-rules | ||
!cortex-tsdb | ||
!.gitignore |
2 changes: 2 additions & 0 deletions
2
development/tsdb-blocks-storage-s3-single-binary/.data-minio/cortex-rules/.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,7 +169,8 @@ func (t *Cortex) initDistributor() (serv services.Service, err error) { | |
} | ||
|
||
func (t *Cortex) initQuerier() (serv services.Service, err error) { | ||
queryable, engine := querier.New(t.Cfg.Querier, t.Overrides, t.Distributor, t.StoreQueryables, t.TombstonesLoader, prometheus.DefaultRegisterer) | ||
querierRegisterer := prometheus.WrapRegistererWith(prometheus.Labels{"engine": "querier"}, prometheus.DefaultRegisterer) | ||
queryable, engine := querier.New(t.Cfg.Querier, t.Overrides, t.Distributor, t.StoreQueryables, t.TombstonesLoader, querierRegisterer) | ||
|
||
// Prometheus histograms for requests to the querier. | ||
querierRequestDuration := promauto.With(prometheus.DefaultRegisterer).NewHistogramVec(prometheus.HistogramOpts{ | ||
|
@@ -454,9 +455,19 @@ func (t *Cortex) initTableManager() (services.Service, error) { | |
} | ||
|
||
func (t *Cortex) initRuler() (serv services.Service, err error) { | ||
// if the ruler is not configured and we're in single binary then let's just log an error and continue | ||
// unfortunately there is no way to generate a "default" config and compare default against actual | ||
// to determine if it's unconfigured. the following check, however, correctly tests this. | ||
// Single binary integration tests will break if this ever drifts | ||
if t.Cfg.Target == All && t.Cfg.Ruler.StoreConfig.Type == "configdb" && t.Cfg.Ruler.StoreConfig.ConfigDB.ConfigsAPIURL.URL == nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No active work is being done on the configdb so I doubt this will break in the near future. |
||
level.Info(util.Logger).Log("msg", "Ruler is not configured in single binary mode and will not be started.") | ||
return nil, nil | ||
} | ||
|
||
t.Cfg.Ruler.Ring.ListenPort = t.Cfg.Server.GRPCListenPort | ||
t.Cfg.Ruler.Ring.KVStore.MemberlistKV = t.MemberlistKV.GetMemberlistKV | ||
queryable, engine := querier.New(t.Cfg.Querier, t.Overrides, t.Distributor, t.StoreQueryables, t.TombstonesLoader, prometheus.DefaultRegisterer) | ||
rulerRegisterer := prometheus.WrapRegistererWith(prometheus.Labels{"engine": "ruler"}, prometheus.DefaultRegisterer) | ||
queryable, engine := querier.New(t.Cfg.Querier, t.Overrides, t.Distributor, t.StoreQueryables, t.TombstonesLoader, rulerRegisterer) | ||
|
||
t.Ruler, err = ruler.NewRuler(t.Cfg.Ruler, engine, queryable, t.Distributor, prometheus.DefaultRegisterer, util.Logger) | ||
if err != nil { | ||
|
@@ -602,7 +613,7 @@ func (t *Cortex) setupModuleManager() error { | |
Compactor: {API}, | ||
StoreGateway: {API}, | ||
Purger: {Store, DeleteRequestsStore, API}, | ||
All: {QueryFrontend, Querier, Ingester, Distributor, TableManager, Purger, StoreGateway}, | ||
All: {QueryFrontend, Querier, Ingester, Distributor, TableManager, Purger, StoreGateway, Ruler}, | ||
} | ||
for mod, targets := range deps { | ||
if err := mm.AddDependency(mod, targets...); err != nil { | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.