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 Gemfile.lock
FileList FileList
.scannerwork .scannerwork
.vscode

View File

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

View File

@@ -376,6 +376,96 @@
— —
<div class='inline'> <div class='inline'>
<p>WAL segment size</p> <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> </div>
</li> </li>
@@ -391,11 +481,6 @@
<pre class="lines"> <pre class="lines">
21
22
23
24
25
26 26
27 27
28 28
@@ -440,10 +525,22 @@
67 67
68 68
69 69
70</pre> 70
71
72
73
74
75
76
77
78
79
80
81
82</pre>
</td> </td>
<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 ( class prometheus_cd::params (
@@ -472,6 +569,13 @@ class prometheus_cd::params (
String $ps_retention_size = &#39;20GB&#39;, String $ps_retention_size = &#39;20GB&#39;,
String $ps_wal_seg_size = &#39;50MB&#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 # defaults
$fqdn = $facts[&#39;networking&#39;][&#39;fqdn&#39;] $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_time tsdb retention time
# @param [String] ps_retention_size tsdb retention size # @param [String] ps_retention_size tsdb retention size
# @param [String] ps_wal_seg_size WAL segment 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 ( class prometheus_cd::params (
@@ -45,6 +50,13 @@ class prometheus_cd::params (
String $ps_retention_size = '20GB', String $ps_retention_size = '20GB',
String $ps_wal_seg_size = '50MB', 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 # defaults
$fqdn = $facts['networking']['fqdn'] $fqdn = $facts['networking']['fqdn']

View File

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