Merge branch 'jenkins-build-37' into 'master'

Auto-merge for build 37

See merge request puppet/prometheus_cd!36
This commit is contained in:
2025-12-03 11:27:44 +00:00
5 changed files with 132 additions and 7 deletions

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@
Gemfile.lock
FileList
.scannerwork
.vscode

View File

@@ -1,6 +1,8 @@
{
"cSpell.words": [
"changeme",
"GOMAXPROCS",
"procs",
"reqpackage",
"rpms",
"sslcacert",

View File

@@ -376,6 +376,96 @@
—
<div class='inline'>
<p>WAL segment size</p>
</div>
</li>
<li>
<span class='name'>ps_max_mem</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;6G&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>hard memory ceiling</p>
</div>
</li>
<li>
<span class='name'>ps_high_mem</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;5G&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>soft limit to make kernel reclaim earlier</p>
</div>
</li>
<li>
<span class='name'>ps_swap_mem</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;4G&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>allow swap, but limit it</p>
</div>
</li>
<li>
<span class='name'>ps_oom_score</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;500&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>OOM killer choosing prometheus</p>
</div>
</li>
<li>
<span class='name'>ps_max_procs</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;1&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>reduce parallel WAL replay workers</p>
</div>
</li>
@@ -391,11 +481,6 @@
<pre class="lines">
21
22
23
24
25
26
27
28
@@ -440,10 +525,22 @@
67
68
69
70</pre>
70
71
72
73
74
75
76
77
78
79
80
81
82</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 21</span>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 26</span>
class prometheus_cd::params (
@@ -472,6 +569,13 @@ class prometheus_cd::params (
String $ps_retention_size = &#39;20GB&#39;,
String $ps_wal_seg_size = &#39;50MB&#39;,
# service
String $ps_max_mem = &#39;6G&#39;,
String $ps_high_mem = &#39;5G&#39;,
String $ps_swap_mem = &#39;4G&#39;,
String $ps_oom_score = &#39;500&#39;,
String $ps_max_procs = &#39;1&#39;,
) {
# defaults
$fqdn = $facts[&#39;networking&#39;][&#39;fqdn&#39;]

View File

@@ -17,6 +17,11 @@
# @param [String] ps_retention_time tsdb retention time
# @param [String] ps_retention_size tsdb retention size
# @param [String] ps_wal_seg_size WAL segment size
# @param [String] ps_max_mem hard memory ceiling
# @param [String] ps_high_mem soft limit to make kernel reclaim earlier
# @param [String] ps_swap_mem allow swap, but limit it
# @param [String] ps_oom_score OOM killer choosing prometheus
# @param [String] ps_max_procs reduce parallel WAL replay workers
##############################################################################
class prometheus_cd::params (
@@ -45,6 +50,13 @@ class prometheus_cd::params (
String $ps_retention_size = '20GB',
String $ps_wal_seg_size = '50MB',
# service
String $ps_max_mem = '6G',
String $ps_high_mem = '5G',
String $ps_swap_mem = '4G',
String $ps_oom_score = '500',
String $ps_max_procs = '1',
) {
# defaults
$fqdn = $facts['networking']['fqdn']

View File

@@ -2,6 +2,12 @@
##### File created by Puppet - manual changes will be overwritten #####
###############################################################################
[Service]
MemoryMax=<%= @ps_max_mem %>
MemoryHigh=<%= @ps_high_mem %>
MemorySwapMax=<%= @ps_swap_mem %>
OOMScoreAdjust=<%= @ps_oom_score %>
Environment="GOMAXPROCS=<%= @ps_max_procs %>"
ExecStart=
ExecStart=/usr/bin/prometheus \
--config.file=/etc/prometheus/prometheus.yml \