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

keep same logic with prometheus resend delay configuration #1612

Merged
merged 1 commit into from
Oct 8, 2019
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
8 changes: 7 additions & 1 deletion cmd/thanos/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ func registerRule(m map[string]setupFunc, app *kingpin.Application) {

ruleFiles := cmd.Flag("rule-file", "Rule files that should be used by rule manager. Can be in glob format (repeated).").
Default("rules/").Strings()

resendDelay := modelDuration(cmd.Flag("resend-delay", "Minimum amount of time to wait before resending an alert to Alertmanager.").
Default("1m"))
evalInterval := modelDuration(cmd.Flag("eval-interval", "The default evaluation interval to use.").
Default("30s"))
tsdbBlockDuration := modelDuration(cmd.Flag("tsdb.block-duration", "Block duration for TSDB block.").
Expand Down Expand Up @@ -162,6 +163,7 @@ func registerRule(m map[string]setupFunc, app *kingpin.Application) {
*webRoutePrefix,
*webExternalPrefix,
*webPrefixHeaderName,
time.Duration(*resendDelay),
time.Duration(*evalInterval),
*dataDir,
*ruleFiles,
Expand Down Expand Up @@ -196,6 +198,7 @@ func runRule(
webRoutePrefix string,
webExternalPrefix string,
webPrefixHeaderName string,
resendDelay time.Duration,
evalInterval time.Duration,
dataDir string,
ruleFiles []string,
Expand Down Expand Up @@ -299,6 +302,8 @@ func runRule(
}
if !alrt.ResolvedAt.IsZero() {
a.EndsAt = alrt.ResolvedAt
} else {
a.EndsAt = alrt.ValidUntil
}
res = append(res, a)
}
Expand All @@ -312,6 +317,7 @@ func runRule(
Appendable: st,
ExternalURL: nil,
TSDB: st,
ResendDelay: resendDelay,
}

for _, strategy := range storepb.PartialResponseStrategy_value {
Expand Down
2 changes: 2 additions & 0 deletions docs/components/rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ Flags:
--data-dir="data/" data directory
--rule-file=rules/ ... Rule files that should be used by rule manager.
Can be in glob format (repeated).
--resend-delay=1m Minimum amount of time to wait before resending
an alert to Alertmanager.
--eval-interval=30s The default evaluation interval to use.
--tsdb.block-duration=2h Block duration for TSDB block.
--tsdb.retention=48h Block retention time on local disk.
Expand Down