Defined Type: prometheus::elasticsearch_exporter

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

Overview

Parameters:

  • prometheus_port (Stdlib::Port)
  • elasticsearch_port (Stdlib::Port)


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

define prometheus::elasticsearch_exporter(
    Stdlib::Port $prometheus_port,
    Stdlib::Port $elasticsearch_port,
) {
  include ::prometheus::elasticsearch_exporter::common

  $es_uri = "http://localhost:${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: }
}