Version information
released Dec 6th 2016
This version is compatible with:
- , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'cristifalcas-prometheus', '1.4.1'
Learn more about managing modules with a PuppetfileDocumentation
cristifalcas/prometheus — version 1.4.1 Dec 6th 2016
puppet-prometheus
Table of Contents
- Overview
- Usage - Configuration options and additional functionality
- Development - Guide for contributing to the module
Overview
This module installs and configures the Prometheus monitoring tool: Prometheus web site
The installation can be made from packages or with docker containers.
We manage prometheus, node-exporter, alertmanager and pushgateway.
In order to print the yaml config files for prometheus and alertmanager, we are using some lib files from puppet-elasticsearch module.
Usage
Install the prometheus server:
$scrape_prometheus = {
'job_name' => 'prometheus',
'static_configs' => [{
'targets' => ['localhost:9090',],
'labels' => {
'alias' => 'Prometheus',
}
,
}
,],
}
$scrape_nerve = {
'job_name' => 'nerve',
'nerve_sd_configs' => [{
'servers' => ['localhost:2181',],
'paths' => ['/monitoring/os',],
}
,],
}
class { '::prometheus':
package_ensure => 'latest',
purge_config_dir => true,
alertmanager_url => 'http://localhost:9093',
log_format => 'logger:syslog?appname=prometheus&local=7',
storage_local_path => '/var/lib/prometheus/data',
web_console_libraries => '/usr/share/prometheus/console_libraries',
web_console_templates => '/usr/share/prometheus/consoles',
web_listen_address => ':9090',
config => {
global => {
'scrape_interval' => '30s',
'scrape_timeout' => '10s',
'evaluation_interval' => '30s',
}
,
scrape_configs => [$scrape_prometheus, $scrape_nerve,],
}
,
}
or:
include ::prometheus
Install node exporter:
$node_collectors = [
'conntrack',
'diskstats',
'entropy',
'filefd',
'filesystem',
'interrupts',
'ksmd',
'loadavg',
'logind',
'mdadm',
'meminfo',
'meminfo_numa',
'netdev',
'netstat',
'sockstat',
'stat',
'systemd',
'tcpstat',
'textfile',
'time',
'uname',
'vmstat',
]
class { '::prometheus::node_exporter':
package_name => 'node_exporter',
collectors_enabled => $node_collectors,
log_format => 'logger:syslog?appname=node_exporter&local=7',
web_listen_address => ':9100',
}
or:
include ::prometheus::node_exporter
Install alertmanager:
$alertmanager_config = {
global => {
'smtp_from' => 'alertmanager@company.com',
'smtp_smarthost' => 'localhost:25',
}
,
templates => ['/etc/prometheus/alert.template',],
route => {
'receiver' => 'default-receiver',
'group_wait' => '30s',
'group_interval' => '5m',
'continue' => true,
}
,
receivers => [{
'name' => 'default-receiver',
'email_configs' => [{
'send_resolved' => true,
'to' => 'cloud-ops@company.com',
}
,],
}
,],
}
class { '::prometheus::alertmanager':
package_name => 'alertmanager',
package_ensure => 'latest',
storage_path => '/var/lib/prometheus/alertmanager/data',
config => $alertmanager_config,
}
Install from docker containers:
class { '::prometheus::alertmanager':
log_format => 'logger:stdout?json=true',
manage_as => 'container',
config => $alertmanager_config,
}
Development
- Fork the project
- Commit and push until you are happy with your contribution
- Send a pull request with a description of your changes
Dependencies
- puppetlabs/stdlib (>= 4.6.0 <5.0.0)
- cristifalcas/docker (>= 5.5.0 <6.0.0)
Copyright (C) 2014 R. Tyler Croy <tyler@monkeypox.org> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.