Puppet Class: profile::atlasexporter

Defined in:
modules/profile/manifests/atlasexporter.pp

Overview

Class: profile::atlasexporter

Sets up a Prometheus exporter for RIPE Atlas checks.

Parameters:

  • atlas_measurements (Hash[String, Hash]) (defaults to: lookup('ripeatlas_measurements'))
  • prometheus_nodes (Any) (defaults to: lookup('prometheus_nodes'))
  • exporter_port (Any) (defaults to: lookup('profile::atlasexporter::exporter_port'))


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
# File 'modules/profile/manifests/atlasexporter.pp', line 5

class profile::atlasexporter(
    Hash[String, Hash] $atlas_measurements = lookup('ripeatlas_measurements'),
    $prometheus_nodes = lookup('prometheus_nodes'),
    $exporter_port    = lookup('profile::atlasexporter::exporter_port'),
) {
    class { 'netops::atlasexporter':
        atlas_measurements => $atlas_measurements,
        exporter_port      => $exporter_port,
    }
    $prometheus_nodes_str = join($prometheus_nodes, ' ')
    $ferm_srange = "(@resolve((${prometheus_nodes_str})) @resolve((${prometheus_nodes_str}), AAAA))"
    ferm::service { 'prometheus-atlas-exporter':
        proto  => 'tcp',
        port   => $exporter_port,
        srange => $ferm_srange,
    }

    # Generate a textfile exporter that provides atlas_measurement_label,
    # with metadata about each measurement ID, suitable for joining against
    # other metrics (similar to node_hwmon_sensor_label).
    file {'/var/lib/prometheus/node.d/atlas_metadata.prom':
        ensure  => 'file',
        content => template('profile/atlasexporter/atlas_metadata.prom.erb'),
    }
}