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

Query: make endpoint heartbeat interval configurable #7407

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
- [#7317](https://github.com/thanos-io/thanos/pull/7317) Tracing: allow specifying resource attributes for the OTLP configuration.
- [#7367](https://github.com/thanos-io/thanos/pull/7367) Store Gateway: log request ID in request logs.
- [#7361](https://github.com/thanos-io/thanos/pull/7361) Query: *breaking :warning:* pass query stats from remote execution from server to client. We changed the protobuf of the QueryAPI, if you use `query.mode=distributed` you need to update your client (upper level Queriers) first, before updating leaf Queriers (servers).
- [#7407](https://github.com/thanos-io/thanos/pull/7407) Query: make endpoint heartbeat interval configurable

### Changed

Expand Down
8 changes: 6 additions & 2 deletions cmd/thanos/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ func registerQuery(app *extkingpin.App) {
unhealthyStoreTimeout := extkingpin.ModelDuration(cmd.Flag("store.unhealthy-timeout", "Timeout before an unhealthy store is cleaned from the store UI page.").Default("5m"))

endpointInfoTimeout := extkingpin.ModelDuration(cmd.Flag("endpoint.info-timeout", "Timeout of gRPC Info requests.").Default("5s").Hidden())
endpointInfoInterval := extkingpin.ModelDuration(cmd.Flag("endpoint.info-interval", "Interval to refresh gRPC Info requests.").Default("5s").Hidden())

enableAutodownsampling := cmd.Flag("query.auto-downsampling", "Enable automatic adjustment (step / 5) to what source of data should be used in store gateways if no max_source_resolution param is specified.").
Default("false").Bool()
Expand Down Expand Up @@ -347,6 +348,7 @@ func registerQuery(app *extkingpin.App) {
*dnsSDResolver,
time.Duration(*unhealthyStoreTimeout),
time.Duration(*endpointInfoTimeout),
time.Duration(*endpointInfoInterval),
time.Duration(*instantDefaultMaxSourceResolution),
*defaultMetadataTimeRange,
*strictStores,
Expand Down Expand Up @@ -429,6 +431,7 @@ func runQuery(
dnsSDResolver string,
unhealthyStoreTimeout time.Duration,
endpointInfoTimeout time.Duration,
endpointInfoInterval time.Duration,
instantDefaultMaxSourceResolution time.Duration,
defaultMetadataTimeRange time.Duration,
strictStores []string,
Expand Down Expand Up @@ -548,6 +551,7 @@ func runQuery(
dialOpts,
unhealthyStoreTimeout,
endpointInfoTimeout,
endpointInfoInterval,
queryConnMetricLabels...,
)

Expand Down Expand Up @@ -863,10 +867,10 @@ func prepareEndpointSet(
dialOpts []grpc.DialOption,
unhealthyStoreTimeout time.Duration,
endpointInfoTimeout time.Duration,
endpointInfoInterval time.Duration,
queryConnMetricLabels ...string,
) *query.EndpointSet {
endpointSet := query.NewEndpointSet(
time.Now,
logger,
reg,
func() (specs []*query.GRPCEndpointSpec) {
Expand Down Expand Up @@ -913,7 +917,7 @@ func prepareEndpointSet(
{
ctx, cancel := context.WithCancel(context.Background())
g.Add(func() error {
return runutil.Repeat(5*time.Second, ctx.Done(), func() error {
return runutil.Repeat(endpointInfoInterval, ctx.Done(), func() error {
endpointSet.Update(ctx)
return nil
})
Expand Down
1 change: 1 addition & 0 deletions cmd/thanos/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ func runRule(
dialOpts,
5*time.Minute,
5*time.Second,
5*time.Second,
)

// Periodically update the GRPC addresses from query config by resolving them using DNS SD if necessary.
Expand Down
Loading
Loading