add prometheus static labels fqdn
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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 %>"
|
||||
|
||||
Reference in New Issue
Block a user