Skip to content

Commit

Permalink
Query: add exemplar.partial-response flag to control partial response (
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjm authored and someshkoli committed Nov 7, 2021
1 parent 707419e commit 890e85a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -10,6 +10,9 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re

## Unreleased

### Added
- [#4680](https://github.com/thanos-io/thanos/pull/4680) Query: add `exemplar.partial-response` flag to control partial response.

## v0.23.0 - In Progress

### Added
Expand Down
6 changes: 6 additions & 0 deletions cmd/thanos/query.go
Expand Up @@ -146,6 +146,9 @@ func registerQuery(app *extkingpin.App) {
enableMetricMetadataPartialResponse := cmd.Flag("metric-metadata.partial-response", "Enable partial response for metric metadata endpoint. --no-metric-metadata.partial-response for disabling.").
Hidden().Default("true").Bool()

enableExemplarPartialResponse := cmd.Flag("exemplar.partial-response", "Enable partial response for exemplar endpoint. --no-exemplar.partial-response for disabling.").
Hidden().Default("true").Bool()

defaultEvaluationInterval := extkingpin.ModelDuration(cmd.Flag("query.default-evaluation-interval", "Set default evaluation interval for sub queries.").Default("1m"))

defaultRangeQueryStep := extkingpin.ModelDuration(cmd.Flag("query.default-step", "Set default step for range queries. Default step is only used when step is not set in UI. In such cases, Thanos UI will use default step to calculate resolution (resolution = max(rangeSeconds / 250, defaultStep)). This will not work from Grafana, but Grafana has __step variable which can be used.").
Expand Down Expand Up @@ -254,6 +257,7 @@ func registerQuery(app *extkingpin.App) {
*enableRulePartialResponse,
*enableTargetPartialResponse,
*enableMetricMetadataPartialResponse,
*enableExemplarPartialResponse,
fileSD,
time.Duration(*dnsSDInterval),
*dnsSDResolver,
Expand Down Expand Up @@ -316,6 +320,7 @@ func runQuery(
enableRulePartialResponse bool,
enableTargetPartialResponse bool,
enableMetricMetadataPartialResponse bool,
enableExemplarPartialResponse bool,
fileSD *file.Discovery,
dnsSDInterval time.Duration,
dnsSDResolver string,
Expand Down Expand Up @@ -554,6 +559,7 @@ func runQuery(
enableRulePartialResponse,
enableTargetPartialResponse,
enableMetricMetadataPartialResponse,
enableExemplarPartialResponse,
queryReplicaLabels,
flagsMap,
defaultRangeQueryStep,
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/query/v1.go
Expand Up @@ -118,6 +118,7 @@ func NewQueryAPI(
enableRulePartialResponse bool,
enableTargetPartialResponse bool,
enableMetricMetadataPartialResponse bool,
enableExemplarPartialResponse bool,
replicaLabels []string,
flagsMap map[string]string,
defaultRangeQueryStep time.Duration,
Expand All @@ -143,6 +144,7 @@ func NewQueryAPI(
enableRulePartialResponse: enableRulePartialResponse,
enableTargetPartialResponse: enableTargetPartialResponse,
enableMetricMetadataPartialResponse: enableMetricMetadataPartialResponse,
enableExemplarPartialResponse: enableExemplarPartialResponse,
replicaLabels: replicaLabels,
endpointSet: endpointSet,
defaultRangeQueryStep: defaultRangeQueryStep,
Expand Down

0 comments on commit 890e85a

Please sign in to comment.