Skip to content

Commit

Permalink
querier: Add lookback delta for querier (#145)
Browse files Browse the repository at this point in the history
* Add lookback delta for querier

Signed-off-by: Kemal Akkoyun <[email protected]>

* Add changelog entry

Signed-off-by: Kemal Akkoyun <[email protected]>
  • Loading branch information
kakkoyun authored Sep 1, 2020
1 parent 44edee6 commit a6a0027
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel
### Added

- [#142](https://github.com/thanos-io/kube-thanos/pull/142) query-frontend: Add thanos query frontend component.
- [#145](https://github.com/thanos-io/kube-thanos/pull/145) querier: Add a new mixin to specify `--query.lookback-delta` flag.

### Fixed

Expand Down
2 changes: 2 additions & 0 deletions all.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ local q =
t.query +
t.query.withServiceMonitor +
t.query.withQueryTimeout +
t.query.withLookbackDelta +
commonConfig + {
config+:: {
name: 'thanos-query',
Expand All @@ -113,6 +114,7 @@ local q =
],
replicaLabels: ['prometheus_replica', 'rule_replica'],
queryTimeout: '5m',
lookbackDelta: '15m',
},
};

Expand Down
1 change: 1 addition & 0 deletions examples/all/manifests/thanos-query-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ spec:
- --store=dnssrv+_grpc._tcp.thanos-rule.thanos.svc.cluster.local
- --store=dnssrv+_grpc._tcp.thanos-store.thanos.svc.cluster.local
- --query.timeout=5m
- --query.lookback-delta=15m
image: quay.io/thanos/thanos:master-2020-08-11-2ea2c2b7
livenessProbe:
failureThreshold: 4
Expand Down
24 changes: 24 additions & 0 deletions jsonnet/kube-thanos/kube-thanos-query.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,28 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
},
},
},

withLookbackDelta:: {
local tq = self,
config+:: {
lookbackDelta: error 'must provide lookbackDelta',
},

deployment+: {
spec+: {
template+: {
spec+: {
containers: [
if c.name == 'thanos-query' then c {
args+: [
'--query.lookback-delta=' + tq.config.lookbackDelta,
],
} else c
for c in super.containers
],
},
},
},
},
},
}

0 comments on commit a6a0027

Please sign in to comment.