From 5967b2b3fc8f1dc8d8ecd28e304087fd081cc26f Mon Sep 17 00:00:00 2001 From: 12ww1160 Date: Wed, 3 Dec 2025 15:29:56 +0100 Subject: [PATCH 1/2] OP#188 add option to allow external remote write in gerenal --- manifests/params.pp | 16 ++++++++++++++-- templates/prometheus.yml.erb | 9 ++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 688eec4..8c88892 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -23,7 +23,11 @@ # @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 +# @param [String] ps_max_procs reduce parallel WAL replay workers +# @param [Boolean] ps_write_external whether to allow remote postgres +# @param [String] ps_auth_ext_user user for writing to extern instance +# @param [String] ps_auth_ext_pass password for writing to extern instance +# @param [String] ps_external_url the full url for the remote write point ############################################################################## class prometheus_cd::params ( @@ -42,11 +46,15 @@ class prometheus_cd::params ( String $ps_fw_prefix = '50', String $ps_main_port = '9090', - # auth + # auth prometheus String $ps_auth_user = 'changeme', String $ps_auth_pass = 'changeme', String $ps_web_pass = 'changeme', + # auth remote + String $ps_auth_ext_user = 'changeme', + String $ps_auth_ext_pass = 'changeme', + # storage String $ps_retention_time = '15d', String $ps_retention_size = '20GB', @@ -61,6 +69,10 @@ class prometheus_cd::params ( String $ps_oom_score = '500', String $ps_max_procs = '1', + # remote write external + Boolean $ps_write_external = false, + String $ps_external_url = 'http://change.local', + ) { # defaults $fqdn = $facts['networking']['fqdn'] diff --git a/templates/prometheus.yml.erb b/templates/prometheus.yml.erb index 9c8521a..be62931 100644 --- a/templates/prometheus.yml.erb +++ b/templates/prometheus.yml.erb @@ -35,4 +35,11 @@ remote_write: - url: "http://localhost:9090/api/v1/write" basic_auth: username: <%= @ps_auth_user %> - password: <%= @ps_auth_pass %> \ No newline at end of file + password: <%= @ps_auth_pass %> +<% if @ps_write_external == true -%> +remote_write: + - url: "<%= @ps_external_url %>" + basic_auth: + username: <%= @ps_auth_ext_user %> + password: <%= @ps_auth_ext_pass %> +<% end -%> \ No newline at end of file From cdace949c6292c6545c23fe3f28583e721bd6b35 Mon Sep 17 00:00:00 2001 From: Jenkins Server Date: Wed, 3 Dec 2025 15:31:31 +0100 Subject: [PATCH 2/2] Recommit for updates in build 42 --- .../prometheus_cd_3A_3Aparams.html | 102 ++++++++++++++++-- 1 file changed, 95 insertions(+), 7 deletions(-) diff --git a/doc/puppet_classes/prometheus_cd_3A_3Aparams.html b/doc/puppet_classes/prometheus_cd_3A_3Aparams.html index ea4bd10..f2b5053 100644 --- a/doc/puppet_classes/prometheus_cd_3A_3Aparams.html +++ b/doc/puppet_classes/prometheus_cd_3A_3Aparams.html @@ -502,6 +502,78 @@ —

reduce parallel WAL replay workers

+
+ + + +
  • + + ps_write_external + + + (Boolean) + + + (defaults to: false) + + + — +
    +

    whether to allow remote postgres

    +
    + +
  • + +
  • + + ps_auth_ext_user + + + (String) + + + (defaults to: 'changeme') + + + — +
    +

    user for writing to extern instance

    +
    + +
  • + +
  • + + ps_auth_ext_pass + + + (String) + + + (defaults to: 'changeme') + + + — +
    +

    password for writing to extern instance

    +
    + +
  • + +
  • + + ps_external_url + + + (String) + + + (defaults to: 'http://change.local') + + + — +
    +

    the full url for the remote write point

  • @@ -517,10 +589,6 @@
     
     
    -28
    -29
    -30
    -31
     32
     33
     34
    @@ -575,10 +643,22 @@
     83
     84
     85
    -86
    +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 -
    # File 'manifests/params.pp', line 28
    +        
    # File 'manifests/params.pp', line 32
     
     class prometheus_cd::params (
     
    @@ -597,11 +677,15 @@ class prometheus_cd::params (
       String $ps_fw_prefix          = '50',
       String $ps_main_port          = '9090',
     
    -  # auth
    +  # auth prometheus
       String $ps_auth_user          = 'changeme',
       String $ps_auth_pass          = 'changeme',
       String $ps_web_pass           = 'changeme',
     
    +  # auth remote
    +  String $ps_auth_ext_user      = 'changeme',
    +  String $ps_auth_ext_pass      = 'changeme',
    +
       # storage
       String $ps_retention_time     = '15d',
       String $ps_retention_size     = '20GB',
    @@ -616,6 +700,10 @@ class prometheus_cd::params (
       String $ps_oom_score          = '500',
       String $ps_max_procs          = '1',
     
    +  # remote write external
    +  Boolean $ps_write_external    = false,
    +  String $ps_external_url       = 'http://change.local',
    +
     ) {
       # defaults
       $fqdn                   = $facts['networking']['fqdn']