Skip to content

Commit a6a0027

Browse files
authored
querier: Add lookback delta for querier (#145)
* Add lookback delta for querier Signed-off-by: Kemal Akkoyun <[email protected]> * Add changelog entry Signed-off-by: Kemal Akkoyun <[email protected]>
1 parent 44edee6 commit a6a0027

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel
1818
### Added
1919

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

2223
### Fixed
2324

all.jsonnet

+2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ local q =
103103
t.query +
104104
t.query.withServiceMonitor +
105105
t.query.withQueryTimeout +
106+
t.query.withLookbackDelta +
106107
commonConfig + {
107108
config+:: {
108109
name: 'thanos-query',
@@ -113,6 +114,7 @@ local q =
113114
],
114115
replicaLabels: ['prometheus_replica', 'rule_replica'],
115116
queryTimeout: '5m',
117+
lookbackDelta: '15m',
116118
},
117119
};
118120

examples/all/manifests/thanos-query-deployment.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ spec:
4949
- --store=dnssrv+_grpc._tcp.thanos-rule.thanos.svc.cluster.local
5050
- --store=dnssrv+_grpc._tcp.thanos-store.thanos.svc.cluster.local
5151
- --query.timeout=5m
52+
- --query.lookback-delta=15m
5253
image: quay.io/thanos/thanos:master-2020-08-11-2ea2c2b7
5354
livenessProbe:
5455
failureThreshold: 4

jsonnet/kube-thanos/kube-thanos-query.libsonnet

+24
Original file line numberDiff line numberDiff line change
@@ -195,4 +195,28 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
195195
},
196196
},
197197
},
198+
199+
withLookbackDelta:: {
200+
local tq = self,
201+
config+:: {
202+
lookbackDelta: error 'must provide lookbackDelta',
203+
},
204+
205+
deployment+: {
206+
spec+: {
207+
template+: {
208+
spec+: {
209+
containers: [
210+
if c.name == 'thanos-query' then c {
211+
args+: [
212+
'--query.lookback-delta=' + tq.config.lookbackDelta,
213+
],
214+
} else c
215+
for c in super.containers
216+
],
217+
},
218+
},
219+
},
220+
},
221+
},
198222
}

0 commit comments

Comments
 (0)