-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[file-sd-part-3] Added file sd to rule #547
Conversation
575c9b3
to
1e633d1
Compare
df34473
to
6c9aca9
Compare
1e633d1
to
fca9f88
Compare
98d95c0
to
4dc205f
Compare
fca9f88
to
5bf8121
Compare
89afd05
to
b07ebc2
Compare
0c68519
to
b9a7cf0
Compare
b9a7cf0
to
75ea2e7
Compare
e46e182
to
92a046a
Compare
75ea2e7
to
965b239
Compare
cmd/thanos/rule.go
Outdated
@@ -168,9 +185,15 @@ func runRule( | |||
}) | |||
} | |||
|
|||
// FileSD query addresses | |||
fileSDCache := newFileSDCache() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we look at moving this to a seperate pkg? I know its still being used in this one package but it might feel nicer now that its not just in the compact.go
cmd/thanos/rule.go
Outdated
@@ -75,6 +77,9 @@ func registerRule(m map[string]setupFunc, app *kingpin.Application, name string) | |||
|
|||
objStoreConfig := regCommonObjStoreFlags(cmd, "") | |||
|
|||
filesToWatch := cmd.Flag("query-sd-file", "Path to file that contain addresses of query peers. The path can be a glob pattern (repeatable)."). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as part 1 can we update the flag :)
92a046a
to
5093da5
Compare
e5c31e4
to
e5bcfed
Compare
cmd/thanos/rule.go
Outdated
@@ -96,6 +102,16 @@ func registerRule(m map[string]setupFunc, app *kingpin.Application, name string) | |||
NoLockfile: true, | |||
WALFlushInterval: 30 * time.Second, | |||
} | |||
|
|||
var filesd *file.Discovery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comments in here as from @bwplotka in part 1 fileSD
etc.
cmd/thanos/rule.go
Outdated
@@ -75,6 +78,9 @@ func registerRule(m map[string]setupFunc, app *kingpin.Application, name string) | |||
|
|||
objStoreConfig := regCommonObjStoreFlags(cmd, "") | |||
|
|||
filesToWatch := cmd.Flag("store.file-sd-config", "Path to file that contain addresses of query peers. The path can be a glob pattern (repeatable)."). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
store.file-sd-config
> store.file-sd-config.files
? or is that just over-complicating things?
4858fca
to
940080a
Compare
e5bcfed
to
7180ccc
Compare
940080a
to
1e77f44
Compare
28392c6
to
7d55dfc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, only nit would be same as in Part1 about a super short duration ... would we want to default to 5s if it is <1s? Or warn? Or just not run?
1e77f44
to
49718a7
Compare
7d55dfc
to
3e4abbd
Compare
* Added flag for query addresses to ruler
ref: #492
Changes
Added file sd to ruler. You can specify files to watch via a command line flag. Then the ruler will load queriers' addresses from the files whenever the files are updated.
Verification
Tests in this PR: #556