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

[file-sd-part-3] Added file sd to rule #547

Merged
merged 7 commits into from
Oct 16, 2018
Merged

Conversation

ivan-valkov
Copy link

@ivan-valkov ivan-valkov commented Oct 1, 2018

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

@ivan-valkov ivan-valkov force-pushed the file-sd-rule branch 4 times, most recently from 575c9b3 to 1e633d1 Compare October 4, 2018 15:56
@ivan-valkov ivan-valkov self-assigned this Oct 5, 2018
@ivan-valkov ivan-valkov changed the base branch from file-sd-query to file-sd-query-test October 5, 2018 10:56
@ivan-valkov ivan-valkov force-pushed the file-sd-query-test branch 2 times, most recently from 89afd05 to b07ebc2 Compare October 9, 2018 16:25
@ivan-valkov ivan-valkov force-pushed the file-sd-rule branch 2 times, most recently from 0c68519 to b9a7cf0 Compare October 9, 2018 17:19
@ivan-valkov ivan-valkov changed the title Added file sd to rule [file-sd-part-3] Added file sd to rule Oct 10, 2018
@@ -168,9 +185,15 @@ func runRule(
})
}

// FileSD query addresses
fileSDCache := newFileSDCache()
Copy link
Contributor

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

@@ -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).").
Copy link
Contributor

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 :)

@@ -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
Copy link
Contributor

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.

@@ -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).").
Copy link
Contributor

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?

Copy link
Contributor

@domgreen domgreen left a 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?

* Added flag for query addresses to ruler
@ivan-valkov ivan-valkov merged commit 1ec8639 into file-sd-query-test Oct 16, 2018
@ivan-valkov ivan-valkov deleted the file-sd-rule branch October 17, 2018 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants