Defined Type: prometheus::elasticsearch_exporter

Defined in:
modules/prometheus/manifests/elasticsearch_exporter.pp

Overview

Parameters:

  • prometheus_port (Stdlib::Port)
  • elasticsearch_host (Stdlib::Host)
  • elasticsearch_port (Stdlib::Port)
  • elasticsearch_scheme (Enum['http', 'https'])
  • extra_config (String) (defaults to: '')


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'modules/prometheus/manifests/elasticsearch_exporter.pp', line 1

define prometheus::elasticsearch_exporter(
    Stdlib::Port          $prometheus_port,
    Stdlib::Host          $elasticsearch_host,
    Stdlib::Port          $elasticsearch_port,
    Enum['http', 'https'] $elasticsearch_scheme,
    String                $extra_config = '',
) {
  include ::prometheus::elasticsearch_exporter::common

  $es_uri = "${elasticsearch_scheme}://${elasticsearch_host}:${elasticsearch_port}"
  systemd::service { "prometheus-elasticsearch-exporter-${elasticsearch_port}":
    ensure         => present,
    content        => systemd_template('prometheus-elasticsearch-exporter'),
    require        => Package['prometheus-elasticsearch-exporter'],
    service_params => {
      ensure => 'running',
    }
  }

  $service_name = "prometheus-elasticsearch-exporter-${elasticsearch_port}"
  profile::auto_restarts::service { $service_name: }
}