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

querier: Add lookback delta for querier #145

Merged
merged 2 commits into from
Sep 1, 2020
Merged
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
@@ -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

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

1 change: 1 addition & 0 deletions examples/all/manifests/thanos-query-deployment.yaml
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions jsonnet/kube-thanos/kube-thanos-query.libsonnet
Original file line number Diff line number Diff line change
@@ -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
],
},
},
},
},
},
}