From dc472aee795e0dd646854829da3c20cb69481c41 Mon Sep 17 00:00:00 2001 From: linus astrom Date: Thu, 10 Aug 2023 13:35:10 +0200 Subject: [PATCH] apps sc: thanos receiver out-of-order bug fix --- WIP-CHANGELOG.md | 1 + config/config/sc-config.yaml | 5 +++++ helmfile/values/thanos/receiver.yaml.gotmpl | 10 ++++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/WIP-CHANGELOG.md b/WIP-CHANGELOG.md index 34cdf2d69..78c6805ca 100644 --- a/WIP-CHANGELOG.md +++ b/WIP-CHANGELOG.md @@ -16,6 +16,7 @@ ### Fixed - Broken link in v0.30 migration instructions +- Fixed thanos ingesting out-of-order error. ### Updated diff --git a/config/config/sc-config.yaml b/config/config/sc-config.yaml index 7af66478f..6c90fca36 100644 --- a/config/config/sc-config.yaml +++ b/config/config/sc-config.yaml @@ -601,6 +601,9 @@ thanos: # standalone: Single instance of receiver. mode: dual-mode + # Can only be used if thanos.compactor.verticalCompaction is set to true + outOfOrderTimeWindow: 600s + # Retention for the metrics in the receiver tsdbRetention: 15d @@ -630,6 +633,8 @@ thanos: retentionResolution5m: 90d retentionResolution1h: 0s + verticalCompaction: false + # Deduplication of metrics in long term storage # receiverReplicas: Deduplicate results from multiple receivers, simpler dedup # prometheusReplicas: Deduplicate results from multiple receivers and multiple prometheis, heavier dedup diff --git a/helmfile/values/thanos/receiver.yaml.gotmpl b/helmfile/values/thanos/receiver.yaml.gotmpl index 024cb5b3b..c8d51b7e8 100644 --- a/helmfile/values/thanos/receiver.yaml.gotmpl +++ b/helmfile/values/thanos/receiver.yaml.gotmpl @@ -13,12 +13,14 @@ compactor: retentionResolution5m: {{ .Values.thanos.compactor.retentionResolution5m }} retentionResolution1h: {{ .Values.thanos.compactor.retentionResolution1h }} - {{- if eq .Values.thanos.compactor.deduplication "receiverReplicas" }} extraFlags: + {{- if eq .Values.thanos.compactor.verticalCompaction true }} + - --compact.enable-vertical-compaction + {{- end }} + {{- if eq .Values.thanos.compactor.deduplication "receiverReplicas" }} - --deduplication.func= - --deduplication.replica-label=replica {{- else if eq .Values.thanos.compactor.deduplication "prometheusReplicas" }} - extraFlags: - --deduplication.func=penalty - --deduplication.replica-label=replica - --deduplication.replica-label=prometheus_replica @@ -44,6 +46,10 @@ receive: mode: {{ .Values.thanos.receiver.mode }} + {{- if eq .Values.thanos.compactor.verticalCompaction true }} + extraFlags: + - --tsdb.out-of-order.time-window={{ .Values.thanos.receiver.outOfOrderTimeWindow }} + {{- end }} # extraFlags: # - "--receive.tenant-label-name=\"cluster\""