From f7280ea7a9a0edf887d50a2aa714a3c506ac00f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20R=C3=BCegg?= Date: Thu, 8 Apr 2021 10:19:39 +0200 Subject: [PATCH] Enable query auto downsampling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Rüegg --- CHANGELOG.md | 1 + all.jsonnet | 1 + examples/all/manifests/thanos-query-deployment.yaml | 1 + jsonnet/kube-thanos/kube-thanos-query.libsonnet | 6 ++++++ manifests/thanos-query-deployment.yaml | 1 + 5 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdf15286..d814fa0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel - [#194](https://github.com/thanos-io/kube-thanos/pull/194) Allow configuring --label and --receive.tenant-label-name flags. - [#209](https://github.com/thanos-io/kube-thanos/pull/209) Allow configuring --label and --refresh flags of bucket web. - [#213](https://github.com/thanos-io/kube-thanos/pull/213) Allow configuring `--min-time` and `--max-time` of store. +- [#218](https://github.com/thanos-io/kube-thanos/pull/218) Enable `--query.auto-downsampling` for query by default. ### Fixed diff --git a/all.jsonnet b/all.jsonnet index f3369448..d4fb544d 100644 --- a/all.jsonnet +++ b/all.jsonnet @@ -111,6 +111,7 @@ local q = t.query(commonConfig { externalPrefix: '', resources: {}, queryTimeout: '5m', + autoDownsampling: true, lookbackDelta: '15m', ports: { grpc: 10901, diff --git a/examples/all/manifests/thanos-query-deployment.yaml b/examples/all/manifests/thanos-query-deployment.yaml index 4b2c4cc0..fcb54bbc 100644 --- a/examples/all/manifests/thanos-query-deployment.yaml +++ b/examples/all/manifests/thanos-query-deployment.yaml @@ -63,6 +63,7 @@ spec: "sampler_type": "ratelimiting" "service_name": "thanos-query" "type": "JAEGER" + - --query.auto-downsampling image: quay.io/thanos/thanos:v0.17.2 livenessProbe: failureThreshold: 4 diff --git a/jsonnet/kube-thanos/kube-thanos-query.libsonnet b/jsonnet/kube-thanos/kube-thanos-query.libsonnet index 66d129d1..5091d03d 100644 --- a/jsonnet/kube-thanos/kube-thanos-query.libsonnet +++ b/jsonnet/kube-thanos/kube-thanos-query.libsonnet @@ -11,6 +11,7 @@ local defaults = { replicaLabels: error 'must provide replicaLabels', stores: ['dnssrv+_grpc._tcp.thanos-store.%s.svc.cluster.local' % defaults.namespace], externalPrefix: '', + autoDownsampling: true, resources: {}, queryTimeout: '', lookbackDelta: '', @@ -54,6 +55,7 @@ function(params) { assert std.isString(tq.config.externalPrefix), assert std.isString(tq.config.queryTimeout), assert std.isBoolean(tq.config.serviceMonitor), + assert std.isBoolean(tq.config.autoDownsampling), service: { apiVersion: 'v1', @@ -127,6 +129,10 @@ function(params) { { config+: { service_name: defaults.name } } + tq.config.tracing ), ] else [] + ) + ( + if tq.config.autoDownsampling then [ + '--query.auto-downsampling', + ] else [] ), ports: [ { name: port.name, containerPort: port.port } diff --git a/manifests/thanos-query-deployment.yaml b/manifests/thanos-query-deployment.yaml index d52f24ae..da6ce801 100644 --- a/manifests/thanos-query-deployment.yaml +++ b/manifests/thanos-query-deployment.yaml @@ -47,6 +47,7 @@ spec: - --query.replica-label=prometheus_replica - --query.replica-label=rule_replica - --store=dnssrv+_grpc._tcp.thanos-store.thanos.svc.cluster.local + - --query.auto-downsampling image: quay.io/thanos/thanos:v0.17.2 livenessProbe: failureThreshold: 4