Skip to content

Commit

Permalink
Merge pull request #265 from ahysing/concurrent-thanos-compact
Browse files Browse the repository at this point in the history
Added multithreading support to thanos compact
  • Loading branch information
yeya24 authored Feb 10, 2022
2 parents 336482e + eff77b7 commit 6328583
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel

### Added

- [#265](https://github.com/thanos-io/kube-thanos/pull/265) Added support for multithreaded thanos compact.
- [#237](https://github.com/thanos-io/kube-thanos/pull/237) Add new bucket replicate component.
- [#245](https://github.com/thanos-io/kube-thanos/pull/245) Support scraping config reloader sidecar for ruler.
- [#251](https://github.com/thanos-io/kube-thanos/pull/251) Add support for extraEnv (custom environment variables) to all components.
Expand Down
2 changes: 2 additions & 0 deletions examples/all/manifests/thanos-compact-shard0-statefulSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ spec:
- --retention.resolution-5m=0d
- --retention.resolution-1h=0d
- --delete-delay=48h
- --compact.concurrency=1
- --downsample.concurrency=1
- --downsampling.disable
- |-
--tracing.config="config":
Expand Down
2 changes: 2 additions & 0 deletions examples/all/manifests/thanos-compact-shard1-statefulSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ spec:
- --retention.resolution-5m=0d
- --retention.resolution-1h=0d
- --delete-delay=48h
- --compact.concurrency=1
- --downsample.concurrency=1
- --downsampling.disable
- |-
--tracing.config="config":
Expand Down
2 changes: 2 additions & 0 deletions examples/all/manifests/thanos-compact-shard2-statefulSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ spec:
- --retention.resolution-5m=0d
- --retention.resolution-1h=0d
- --delete-delay=48h
- --compact.concurrency=1
- --downsample.concurrency=1
- --downsampling.disable
- |-
--tracing.config="config":
Expand Down
2 changes: 2 additions & 0 deletions examples/all/manifests/thanos-compact-statefulSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ spec:
- --retention.resolution-5m=0d
- --retention.resolution-1h=0d
- --delete-delay=48h
- --compact.concurrency=1
- --downsample.concurrency=1
- --downsampling.disable
- --deduplication.replica-label=prometheus_replica
- --deduplication.replica-label=rule_replica
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
retentionResolutionRaw: '0d',
retentionResolution5m: '0d',
retentionResolution1h: '0d',
compactConcurrency: 1,
deduplicationReplicaLabels: [],
deleteDelay: '48h',
disableDownsampling: false,
deduplicationReplicaLabels: [],
downsampleConcurrency: 1,
ports: {
http: 10902,
},
Expand Down
4 changes: 4 additions & 0 deletions jsonnet/kube-thanos/kube-thanos-compact.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ function(params) {
// Combine the defaults and the passed params to make the component's config.
config:: defaults + params,
// Safety checks for combined config of defaults and params
assert std.isNumber(tc.config.compactConcurrency),
assert std.isNumber(tc.config.downsampleConcurrency),
assert std.isNumber(tc.config.replicas) && (tc.config.replicas == 0 || tc.config.replicas == 1) : 'thanos compact replicas can only be 0 or 1',
assert std.isObject(tc.config.resources),
assert std.isObject(tc.config.volumeClaimTemplate),
Expand Down Expand Up @@ -65,6 +67,8 @@ function(params) {
'--retention.resolution-5m=' + tc.config.retentionResolution5m,
'--retention.resolution-1h=' + tc.config.retentionResolution1h,
'--delete-delay=' + tc.config.deleteDelay,
'--compact.concurrency=' + tc.config.compactConcurrency,
'--downsample.concurrency=' + tc.config.downsampleConcurrency,
] + (
if tc.config.disableDownsampling then ['--downsampling.disable'] else []
) + (
Expand Down

0 comments on commit 6328583

Please sign in to comment.