diff --git a/manifests/params.pp b/manifests/params.pp index 5acae8c..0f926e0 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -10,10 +10,6 @@ # @param [boolean] ay_manage_prom whether to manage metric forwarding # @param [string] ay_prom_url the url where alloy will send metrics # @param [array] ay_log_targets the logging targets -# @param [boolean] ay_manage_user whether to manage user settings -# @param [string] ay_user the alloy user name -# @param [array] ay_groups which groups the user should be in -# @param [string] ay_user_shell which shell to use # @summary Class contains all parameters for the alloy_cd module. ############################################################################## class alloy_cd::params ( @@ -32,12 +28,6 @@ class alloy_cd::params ( Boolean $ay_manage_prom = true, String $ay_prom_url = 'https://prometheus.example.net/api/v1/write', -# user - Boolean $ay_manage_user = true, - String $ay_user = 'alloy', - Array $ay_groups = ['systemd-journal','adm'], - String $ay_user_shell = '/sbin/nologin', - ) { # service $ay_service = 'alloy' diff --git a/templates/config.alloy.erb b/templates/config.alloy.erb index 49e4e2e..2f1b950 100644 --- a/templates/config.alloy.erb +++ b/templates/config.alloy.erb @@ -61,10 +61,21 @@ prometheus.exporter.unix "system_metrics" { prometheus.scrape "scrape_system" { targets = prometheus.exporter.unix.system_metrics.targets - forward_to = [prometheus.remote_write.prometheus.receiver] + forward_to = [prometheus.process.metrics.receiver] scrape_interval = "15s" } +prometheus.process "metrics" { + + stage.static_labels { + values = { + fqdn = constants.hostname, + service = "prometheus", + } + } + forward_to = [prometheus.remote_write.prometheus.receiver] +} + prometheus.remote_write "prometheus" { endpoint { url = "<%= @ay_prom_url %>"