Defined Type: prometheus::scrape_job
- Defined in:
- manifests/scrape_job.pp
Summary
This module manages prometheus scrape jobs.Overview
Note:
This define is used to export prometheus scrape settings from nodes to be scraped to the node running prometheus itself. This can be used to make prometheus find instances of your running service or application.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'manifests/scrape_job.pp', line 18
define prometheus::scrape_job (
String[1] $job_name,
Array[String[1]] $targets,
Hash[String[1], String[1]] $labels = {},
Stdlib::Absolutepath $collect_dir = undef,
Enum['present', 'absent'] $ensure = 'present',
) {
$config = stdlib::to_yaml([
{
targets => $targets,
labels => $labels,
},
])
file { "${collect_dir}/${job_name}_${name}.yaml":
ensure => stdlib::ensure($ensure, 'file'),
owner => 'root',
group => $prometheus::group,
mode => $prometheus::config_mode,
content => "# this file is managed by puppet; changes will be overwritten\n${config}",
}
}
|