Defined Type: prometheus::blackbox::import_checks

Defined in:
modules/prometheus/manifests/blackbox/import_checks.pp

Overview

Make sure to add new Prometheus instances to type Prometheus::Blackbox::Check::Instance

Parameters:

  • prometheus_instance (String)
  • site (Wmflib::Sites)


5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'modules/prometheus/manifests/blackbox/import_checks.pp', line 5

define prometheus::blackbox::import_checks (
  String        $prometheus_instance,
  Wmflib::Sites $site,
) {

  ['http', 'tcp', 'icmp'].each |String $module| {
    wmflib::resource::import(
      'prometheus::blackbox::module',
      undef,
      { tag => "prometheus::blackbox::check::${module}::${site}::${prometheus_instance}::module" }
    )

    wmflib::resource::import(
      'prometheus::rule',
      undef,
      { tag => "prometheus::blackbox::check::${module}::${::site}::${prometheus_instance}::alert" }
    )

    # TODO: the following will concatenate all content simlar to the puppetlabs::concat module
    # We need to check if we need to inser addtional line breaks (\n)
    # also if we want to do something similar for alert files?
    wmflib::resource::import(
      'file',
      undef,
      { tag => "prometheus::blackbox::check::${module}::${::site}::${prometheus_instance}::target" },
      true
    )
  }
}