Commit 37524939 authored by Ben Kochie's avatar Ben Kochie

Merge branch 'bjk/thanos_7d' into 'master'

Reduce local retention when using Thanos storage

See merge request !444
parents 9ad2f307 7ebf944e
Pipeline #54968972 passed with stages
in 3 minutes and 26 seconds
......@@ -28,7 +28,7 @@ GRAPH
zypper (>= 0.0.0)
compat_resource (12.19.1)
cpu (2.0.0)
gitlab-prometheus (1.0.5)
gitlab-prometheus (1.0.6)
accumulator (~> 0.2)
ark (~> 3.1)
chef-vault (~> 3.0)
......
......@@ -4,7 +4,7 @@ maintainer_email "ops-contact@gitlab.com"
license "All rights reserved"
description "Installs/Configures gitlab-monitoring"
long_description IO.read(File.join(File.dirname(__FILE__), "README.md"))
version "1.0.5"
version "1.0.6"
depends "accumulator", "~> 0.2"
depends "ark", "~> 3.1"
......
......@@ -59,10 +59,17 @@ thanos_storage_config = {
"config" => node["thanos"]["storage"]["config"],
}
# Flip flags when Thanos storage is enabled.
if node["thanos"]["storage"]["enable"]
# Enable the object storage config flag.
node.default["thanos-sidecar"]["flags"]["objstore.config-file"] = node["thanos"]["storage"]["config-file"]
node.default["thanos-store"]["flags"]["objstore.config-file"] = node["thanos"]["storage"]["config-file"]
node.default["thanos-compact"]["flags"]["objstore.config-file"] = node["thanos"]["storage"]["config-file"]
# Disable Prometheus compactions, this is handled by Thanos compact component.
node.override["prometheus"]["flags"]["storage.tsdb.min-block-duration"] = "2h"
node.override["prometheus"]["flags"]["storage.tsdb.max-block-duration"] = "2h"
# Reduce local retention to 7 days.
node.default["prometheus"]["flags"]["storage.tsdb.retention"] = "7d"
end
file "object-storage-config" do
......@@ -74,12 +81,6 @@ file "object-storage-config" do
only_if { node["thanos"]["storage"]["enable"] }
end
# Disable Prometheus compaction when storage uploading is enabled.
if node["thanos"]["storage"]["enable"]
node.override["prometheus"]["flags"]["storage.tsdb.min-block-duration"] = "2h"
node.override["prometheus"]["flags"]["storage.tsdb.max-block-duration"] = "2h"
end
runit_service "thanos-sidecar" do
options(
thanos_mode: "sidecar"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment