OP#188 add option to allow external remote write in gerenal
This commit is contained in:
@@ -24,6 +24,10 @@
|
|||||||
# @param [String] ps_swap_mem allow swap, but limit it
|
# @param [String] ps_swap_mem allow swap, but limit it
|
||||||
# @param [String] ps_oom_score OOM killer choosing prometheus
|
# @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 (
|
class prometheus_cd::params (
|
||||||
|
|
||||||
@@ -42,11 +46,15 @@ class prometheus_cd::params (
|
|||||||
String $ps_fw_prefix = '50',
|
String $ps_fw_prefix = '50',
|
||||||
String $ps_main_port = '9090',
|
String $ps_main_port = '9090',
|
||||||
|
|
||||||
# auth
|
# auth prometheus
|
||||||
String $ps_auth_user = 'changeme',
|
String $ps_auth_user = 'changeme',
|
||||||
String $ps_auth_pass = 'changeme',
|
String $ps_auth_pass = 'changeme',
|
||||||
String $ps_web_pass = 'changeme',
|
String $ps_web_pass = 'changeme',
|
||||||
|
|
||||||
|
# auth remote
|
||||||
|
String $ps_auth_ext_user = 'changeme',
|
||||||
|
String $ps_auth_ext_pass = 'changeme',
|
||||||
|
|
||||||
# storage
|
# storage
|
||||||
String $ps_retention_time = '15d',
|
String $ps_retention_time = '15d',
|
||||||
String $ps_retention_size = '20GB',
|
String $ps_retention_size = '20GB',
|
||||||
@@ -61,6 +69,10 @@ class prometheus_cd::params (
|
|||||||
String $ps_oom_score = '500',
|
String $ps_oom_score = '500',
|
||||||
String $ps_max_procs = '1',
|
String $ps_max_procs = '1',
|
||||||
|
|
||||||
|
# remote write external
|
||||||
|
Boolean $ps_write_external = false,
|
||||||
|
String $ps_external_url = 'http://change.local',
|
||||||
|
|
||||||
) {
|
) {
|
||||||
# defaults
|
# defaults
|
||||||
$fqdn = $facts['networking']['fqdn']
|
$fqdn = $facts['networking']['fqdn']
|
||||||
|
|||||||
@@ -36,3 +36,10 @@ remote_write:
|
|||||||
basic_auth:
|
basic_auth:
|
||||||
username: <%= @ps_auth_user %>
|
username: <%= @ps_auth_user %>
|
||||||
password: <%= @ps_auth_pass %>
|
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 -%>
|
||||||
Reference in New Issue
Block a user