Skip to content

Commit

Permalink
have a $service_name parameter for all prometheus-exporters
Browse files Browse the repository at this point in the history
  • Loading branch information
unki committed Feb 28, 2020
1 parent a4f8945 commit 7aeddef
Show file tree
Hide file tree
Showing 23 changed files with 105 additions and 51 deletions.
14 changes: 14 additions & 0 deletions data/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ prometheus::consul_exporter::group: 'consul-exporter'
prometheus::consul_exporter::log_level: 'info'
prometheus::consul_exporter::package_ensure: 'latest'
prometheus::consul_exporter::package_name: 'consul_exporter'
prometheus::consul_exporter::service_name: 'consul_exporter'
prometheus::consul_exporter::user: 'consul-exporter'
prometheus::consul_exporter::version: '0.5.0'
prometheus::consul_exporter::web_listen_address: ':9107'
Expand All @@ -90,6 +91,7 @@ prometheus::elasticsearch_exporter::extra_groups: []
prometheus::elasticsearch_exporter::group: 'elasticsearch-exporter'
prometheus::elasticsearch_exporter::package_ensure: 'latest'
prometheus::elasticsearch_exporter::package_name: 'elasticsearch_exporter'
prometheus::elasticsearch_exporter::service_name: 'elasticsearch_exporter'
prometheus::elasticsearch_exporter::user: 'elasticsearch-exporter'
prometheus::elasticsearch_exporter::version: '1.1.0rc1'
prometheus::elasticsearch_exporter::use_kingpin: true
Expand All @@ -111,6 +113,7 @@ prometheus::mesos_exporter::group: 'mesos-exporter'
prometheus::mesos_exporter::user: 'mesos-exporter'
prometheus::mesos_exporter::package_ensure: 'latest'
prometheus::mesos_exporter::package_name: 'mesos_exporter'
prometheus::mesos_exporter::service_name: 'mesos_exporter'
prometheus::mesos_exporter::version: '1.1.2'
prometheus::haproxy_exporter::cnf_scrape_uri: 'http://localhost:1234/haproxy?stats;csv'
prometheus::haproxy_exporter::download_extension: 'tar.gz'
Expand All @@ -129,6 +132,7 @@ prometheus::nginx_vts_exporter::extra_groups: []
prometheus::nginx_vts_exporter::group: 'nginx-vts-exporter'
prometheus::nginx_vts_exporter::package_ensure: 'latest'
prometheus::nginx_vts_exporter::package_name: 'nginx-vts-exporter'
prometheus::nginx_vts_exporter::service_name: 'nginx-vts-exporter'
prometheus::nginx_vts_exporter::user: 'nginx-vts-exporter'
prometheus::nginx_vts_exporter::version: '0.10.3'
prometheus::process_exporter::download_extension: 'tar.gz'
Expand All @@ -137,6 +141,7 @@ prometheus::process_exporter::extra_groups: []
prometheus::process_exporter::group: 'process-exporter'
prometheus::process_exporter::package_ensure: 'latest'
prometheus::process_exporter::package_name: 'process-exporter'
prometheus::process_exporter::service_name: 'process-exporter'
prometheus::process_exporter::user: 'process-exporter'
prometheus::process_exporter::version: '0.5.0'
prometheus::process_exporter::config_path: '/etc/process-exporter.yaml'
Expand All @@ -154,6 +159,7 @@ prometheus::rabbitmq_exporter::extra_groups: []
prometheus::rabbitmq_exporter::group: 'rabbitmq-exporter'
prometheus::rabbitmq_exporter::package_ensure: 'latest'
prometheus::rabbitmq_exporter::package_name: 'rabbitmq_exporter'
prometheus::rabbitmq_exporter::service_name: 'rabbitmq_exporter'
prometheus::rabbitmq_exporter::user: 'rabbitmq-exporter'
prometheus::rabbitmq_exporter::version: '0.25.2'
prometheus::rabbitmq_exporter::rabbit_url: 'http://localhost:15672'
Expand All @@ -173,6 +179,7 @@ prometheus::mysqld_exporter::extra_groups: []
prometheus::mysqld_exporter::group: 'mysqld-exporter'
prometheus::mysqld_exporter::package_ensure: 'latest'
prometheus::mysqld_exporter::package_name: 'mysqld_exporter'
prometheus::mysqld_exporter::service_name: 'mysqld_exporter'
prometheus::mysqld_exporter::user: 'mysqld-exporter'
prometheus::mysqld_exporter::version: '0.12.0'
prometheus::mongodb_exporter::cnf_uri: 'mongodb://localhost:27017'
Expand All @@ -182,6 +189,7 @@ prometheus::mongodb_exporter::extra_groups: []
prometheus::mongodb_exporter::group: 'mongodb-exporter'
prometheus::mongodb_exporter::package_ensure: 'latest'
prometheus::mongodb_exporter::package_name: 'mongodb_exporter'
prometheus::mongodb_exporter::service_name: 'mongodb_exporter'
prometheus::mongodb_exporter::user: 'mongodb-exporter'
prometheus::mongodb_exporter::version: '0.3.1'
prometheus::mongodb_exporter::use_kingpin: false
Expand All @@ -201,6 +209,7 @@ prometheus::beanstalkd_exporter::extra_groups: []
prometheus::beanstalkd_exporter::group: 'beanstalkd-exporter'
prometheus::beanstalkd_exporter::package_ensure: 'latest'
prometheus::beanstalkd_exporter::package_name: 'beanstalkd_exporter'
prometheus::beanstalkd_exporter::service_name: 'beanstalkd_exporter'
prometheus::beanstalkd_exporter::user: 'beanstalkd-exporter'
prometheus::beanstalkd_exporter::version: '1.0.0'
prometheus::beanstalkd_exporter::mapping_config: '/etc/beanstalkd-exporter-mapping.conf'
Expand Down Expand Up @@ -228,6 +237,7 @@ prometheus::snmp_exporter::extra_groups: []
prometheus::snmp_exporter::group: 'snmp-exporter'
prometheus::snmp_exporter::package_ensure: 'latest'
prometheus::snmp_exporter::package_name: 'snmp_exporter'
prometheus::snmp_exporter::service_name: 'snmp_exporter'
prometheus::snmp_exporter::user: 'snmp-exporter'
prometheus::snmp_exporter::version: '0.15.0'
prometheus::statsd_exporter::download_extension: 'tar.gz'
Expand All @@ -238,6 +248,7 @@ prometheus::statsd_exporter::mapping_config_path: '/etc/statsd-exporter-mapping.
prometheus::statsd_exporter::mappings: []
prometheus::statsd_exporter::package_ensure: 'latest'
prometheus::statsd_exporter::package_name: 'statsd_exporter'
prometheus::statsd_exporter::service_name: 'statsd_exporter'
prometheus::statsd_exporter::user: 'statsd-exporter'
prometheus::statsd_exporter::version: '0.12.1'
prometheus::storage_retention: '360h' # 15d; "d" suffix is only supported with prom >= 2.*
Expand Down Expand Up @@ -278,13 +289,15 @@ prometheus::varnish_exporter::extra_groups: []
prometheus::varnish_exporter::group: 'varnish'
prometheus::varnish_exporter::package_ensure: 'latest'
prometheus::varnish_exporter::package_name: 'prometheus_varnish_exporter'
prometheus::varnish_exporter::service_name: 'prometheus_varnish_exporter'
prometheus::varnish_exporter::user: 'varnish_exporter'
prometheus::varnish_exporter::version: '1.5'
prometheus::graphite_exporter::download_extension: 'tar.gz'
prometheus::graphite_exporter::download_url_base: 'https://github.com/prometheus/graphite_exporter/releases'
prometheus::graphite_exporter::group: 'graphite-exporter'
prometheus::graphite_exporter::package_ensure: 'latest'
prometheus::graphite_exporter::package_name: 'graphite_exporter'
prometheus::graphite_exporter::service_name: 'graphite_exporter'
prometheus::graphite_exporter::user: 'graphite-exporter'
prometheus::graphite_exporter::version: '0.2.0'
prometheus::graphite_exporter::options: ''
Expand All @@ -293,6 +306,7 @@ prometheus::collectd_exporter::download_url_base: 'https://github.com/prometheus
prometheus::collectd_exporter::group: 'collectd-exporter'
prometheus::collectd_exporter::package_ensure: 'latest'
prometheus::collectd_exporter::package_name: 'collectd_exporter'
prometheus::collectd_exporter::service_name: 'collectd_exporter'
prometheus::collectd_exporter::user: 'collectd-exporter'
prometheus::collectd_exporter::version: '0.4.0'
prometheus::collectd_exporter::options: ''
Expand Down
2 changes: 1 addition & 1 deletion manifests/apache_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@

$options = "-scrape_uri \"${scrape_uri}\" ${extra_options}"

prometheus::daemon { $service_name:
prometheus::daemon { $name:
install_method => $install_method,
version => $version,
download_extension => $download_extension,
Expand Down
11 changes: 7 additions & 4 deletions manifests/beanstalkd_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
# Whether to enable the service from puppet (default true)
# @param service_ensure
# State ensured for the service (default 'running')
# @param service_name
# Name of the beanstalkd exporter service (default 'beanstalkd_exporter')
# @param user
# User which runs the service
# @param version
Expand All @@ -58,6 +60,7 @@
String $group,
String $package_ensure,
String $package_name,
String[1] $service_name,
String $user,
String $version,
String $config,
Expand Down Expand Up @@ -88,7 +91,7 @@
$real_download_url = pick($download_url,"${download_url_base}/download/${version}/${package_name}-${version}.${os}-${arch}.${download_extension}")

$notify_service = $restart_on_change ? {
true => Service['beanstalkd_exporter'],
true => Service[$service_name],
default => undef,
}

Expand All @@ -97,15 +100,15 @@
file { $config:
ensure => file,
content => $beanstalkd_address,
before => Prometheus::Daemon['beanstalkd_exporter'],
before => Prometheus::Daemon[$name],
}

file { $mapping_config:
ensure => file,
before => Prometheus::Daemon['beanstalkd_exporter'],
before => Prometheus::Daemon[$name],
}

prometheus::daemon { 'beanstalkd_exporter':
prometheus::daemon { $name:
install_method => $install_method,
version => $version,
download_extension => $download_extension,
Expand Down
2 changes: 1 addition & 1 deletion manifests/bird_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
default => undef,
}

prometheus::daemon { $service_name :
prometheus::daemon { $name:
install_method => $install_method,
version => $version,
download_extension => $download_extension,
Expand Down
2 changes: 1 addition & 1 deletion manifests/blackbox_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
}


prometheus::daemon { $service_name :
prometheus::daemon { $name:
install_method => $install_method,
version => $version,
download_extension => $download_extension,
Expand Down
7 changes: 5 additions & 2 deletions manifests/collectd_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
# Whether to enable the service from puppet (default true)
# @param service_ensure
# State ensured for the service (default 'running')
# @param service_name
# Name of the collectd exporter service (default 'collectd_exporter')
# @param user
# User which runs the service
# @param version
Expand All @@ -47,6 +49,7 @@
String[1] $group,
String[1] $package_ensure,
String[1] $package_name,
String[1] $service_name,
String[1] $user,
String[1] $version,
String $options,
Expand All @@ -72,11 +75,11 @@
$real_download_url = pick($download_url,"${download_url_base}/download/v${version}/${package_name}-${version}.${os}-${arch}.${download_extension}")

$notify_service = $restart_on_change ? {
true => Service['collectd_exporter'],
true => Service[$service_name],
default => undef,
}

prometheus::daemon { 'collectd_exporter':
prometheus::daemon { $name:
install_method => $install_method,
version => $version,
download_extension => $download_extension,
Expand Down
7 changes: 5 additions & 2 deletions manifests/consul_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
# Whether to enable the service from puppet (default true)
# @param service_ensure
# State ensured for the service (default 'running')
# @param service_name
# Name of the consul exporter service (default 'consul_exporter')
# @param user
# User which runs the service
# @param version
Expand All @@ -63,6 +65,7 @@
String $log_level,
String $package_ensure,
String $package_name,
String[1] $service_name,
String $user,
String $version,
String $web_listen_address,
Expand Down Expand Up @@ -105,7 +108,7 @@
}

$notify_service = $restart_on_change ? {
true => Service['consul_exporter'],
true => Service[$service_name],
default => undef,
}

Expand All @@ -115,7 +118,7 @@
$options = "--consul.server=${consul_server} ${real_consul_health_summary} --web.listen-address=${web_listen_address} --web.telemetry-path=${web_telemetry_path} --log.level=${log_level} ${extra_options}"
}

prometheus::daemon { 'consul_exporter':
prometheus::daemon { $name:
install_method => $install_method,
version => $version,
download_extension => $download_extension,
Expand Down
5 changes: 3 additions & 2 deletions manifests/elasticsearch_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
String $group,
String $package_ensure,
String $package_name,
String[1] $service_name,
String $user,
String $version,
Boolean $use_kingpin,
Expand Down Expand Up @@ -87,7 +88,7 @@
$real_download_url = pick($download_url,"${download_url_base}/download/v${version}/${package_name}-${version}.${os}-${arch}.${download_extension}")

$notify_service = $restart_on_change ? {
true => Service['elasticsearch_exporter'],
true => Service[$service_name],
default => undef,
}

Expand All @@ -98,7 +99,7 @@

$options = "${flag_prefix}es.uri=${cnf_uri} ${flag_prefix}es.timeout=${cnf_timeout} ${extra_options}"

prometheus::daemon { 'elasticsearch_exporter':
prometheus::daemon { $name:
install_method => $install_method,
version => $version,
download_extension => $download_extension,
Expand Down
7 changes: 5 additions & 2 deletions manifests/graphite_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
# Whether to enable the service from puppet (default true)
# @param service_ensure
# State ensured for the service (default 'running')
# @param service_name
# Name of the graphite exporter service (default 'graphite_exporter')
# @param user
# User which runs the service
# @param version
Expand All @@ -47,6 +49,7 @@
String $group,
String $package_ensure,
String $package_name,
String[1] $service_name,
String $user,
String $version,
String $options,
Expand All @@ -72,11 +75,11 @@
$real_download_url = pick($download_url,"${download_url_base}/download/v${version}/${package_name}-${version}.${os}-${arch}.${download_extension}")

$notify_service = $restart_on_change ? {
true => Service['graphite_exporter'],
true => Service[$service_name],
default => undef,
}

prometheus::daemon { 'graphite_exporter':
prometheus::daemon { $name:
install_method => $install_method,
version => $version,
download_extension => $download_extension,
Expand Down
4 changes: 2 additions & 2 deletions manifests/haproxy_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
String $group,
String $package_ensure,
String $package_name,
String[1] $service_name,
String $user,
String $version,
String[1] $service_name,
Prometheus::Uri $download_url_base,
Boolean $purge_config_dir = true,
Boolean $restart_on_change = true,
Expand Down Expand Up @@ -86,7 +86,7 @@

$options = "--haproxy.scrape-uri=\"${cnf_scrape_uri}\" ${extra_options}"

prometheus::daemon { $service_name:
prometheus::daemon { $name:
install_method => $install_method,
version => $version,
download_extension => $download_extension,
Expand Down
7 changes: 5 additions & 2 deletions manifests/mesos_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
# Whether to enable the service from puppet (default true)
# @param service_ensure
# State ensured for the service (default 'running')
# @param service_name
# Name of the mesos exporter service (default 'mesos_exporter')
# @param user
# User which runs the service
# @param version
Expand All @@ -56,6 +58,7 @@
String $group,
String $package_ensure,
String $package_name,
String[1] $service_name,
String $user,
String $version,
Boolean $purge_config_dir = true,
Expand All @@ -80,13 +83,13 @@

$real_download_url = pick($download_url,"${download_url_base}/download/v${version}/${package_name}-${version}.${os}-${arch}.${download_extension}")
$notify_service = $restart_on_change ? {
true => Service['mesos_exporter'],
true => Service[$service_name],
default => undef,
}

$options = "-${server_type} ${cnf_scrape_uri} ${extra_options}"

prometheus::daemon { 'mesos_exporter':
prometheus::daemon { $name:
install_method => $install_method,
version => $version,
download_extension => $download_extension,
Expand Down
7 changes: 5 additions & 2 deletions manifests/mongodb_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
# Whether to enable the service from puppet (default true)
# @param service_ensure
# State ensured for the service (default 'running')
# @param service_name
# Name of the mongodb exporter service (default 'mongodb_exporter')
# @param user
# User which runs the service
# @param version
Expand All @@ -57,6 +59,7 @@
String $group,
String $package_ensure,
String $package_name,
String[1] $service_name,
String $user,
String $version,
Boolean $use_kingpin,
Expand Down Expand Up @@ -84,7 +87,7 @@
$real_download_url = pick($download_url,"${download_url_base}/download/v${version}/${package_name}-${version}.${os}-${arch}.${download_extension}")

$notify_service = $restart_on_change ? {
true => Service['mongodb_exporter'],
true => Service[$service_name],
default => undef,
}

Expand All @@ -95,7 +98,7 @@

$options = "${flag_prefix}mongodb.uri=${cnf_uri} ${extra_options}"

prometheus::daemon { 'mongodb_exporter':
prometheus::daemon { $name:
install_method => $install_method,
version => $version,
download_extension => $download_extension,
Expand Down
Loading

0 comments on commit 7aeddef

Please sign in to comment.