Forge Home

prometheus

This module installs, configures and manages the Prometheus service.

1,395,492 downloads

104 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 15.0.0 (latest)
  • 14.0.0
  • 13.4.0
  • 13.3.0
  • 13.2.0
  • 13.1.0
  • 13.0.0
  • 12.5.0
  • 12.4.0
  • 12.3.0
  • 12.2.0
  • 12.1.1
  • 12.1.0
  • 12.0.0
  • 11.2.0
  • 11.1.0
  • 11.0.0
  • 10.2.0
  • 10.1.0
  • 10.0.0
  • 9.1.0
  • 9.0.0
  • 8.5.0
  • 8.4.0
  • 8.3.0
  • 8.2.1
  • 8.2.0
  • 8.1.0
  • 8.0.0
  • 7.1.0
  • 7.0.0
  • 6.4.0
  • 6.3.0
  • 6.2.0
  • 6.1.0
  • 6.0.6
  • 6.0.5
  • 6.0.4
  • 6.0.3
  • 6.0.2
  • 6.0.1
  • 6.0.0
  • 5.0.0
  • 4.1.1
  • 4.1.0
  • 4.0.0
  • 3.1.0
  • 3.0.0
  • 2.0.0
  • 1.0.0
  • 0.2.4
  • 0.2.0
released Nov 16th 2017
This version is compatible with:
  • , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'puppet-prometheus', '3.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add puppet-prometheus
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install puppet-prometheus --version 3.0.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

puppet/prometheus — version 3.0.0 Nov 16th 2017

puppet-prometheus

Puppet Forge Puppet Forge Puppet Forge

Compatibility

Prometheus Version Recommended Puppet Module Version
>= 0.16.2 latest

node_exporter >= 0.15.0

Background

This module automates the install and configuration of Prometheus monitoring tool: Prometheus web site

What This Module Affects

  • Installs the prometheus daemon, alertmanager or exporters(via url or package)
    • The package method was implemented, but currently there isn't any package for prometheus
  • Optionally installs a user to run it under (per exporter)
  • Installs a configuration file for prometheus daemon (/etc/prometheus/prometheus.yaml) or for alertmanager (/etc/prometheus/alert.rules)
  • Manages the services via upstart, sysv, or systemd
  • Optionally creates alert rules
  • The following exporters are currently implemented: node_exporter, statsd_exporter, process_exporter, haproxy_exporter, mysqld_exporter, blackbox_exporter

Usage

To set up a prometheus daemon: On the server (for prometheus version < 1.0.0):

class { '::prometheus':
  global_config  => { 'scrape_interval'=> '15s', 'evaluation_interval'=> '15s', 'external_labels'=> { 'monitor'=>'master'}},
  rule_files     => [ "/etc/prometheus/alert.rules" ],
  scrape_configs => [ 
     { 'job_name'=> 'prometheus',
       'scrape_interval'=> '10s',
       'scrape_timeout' => '10s',
       'target_groups'  => [
        { 'targets'     => [ 'localhost:9090' ],
            'labels'    => { 'alias'=> 'Prometheus'}
         }
      ]
    }
  ]
}

On the server (for prometheus version >= 1.0.0):

class { 'prometheus':
    version => '1.0.0',
    scrape_configs => [ {'job_name'=>'prometheus','scrape_interval'=> '30s','scrape_timeout'=>'30s','static_configs'=> [{'targets'=>['localhost:9090'], 'labels'=> { 'alias'=>'Prometheus'}}]}],
    extra_options => '-alertmanager.url http://localhost:9093 -web.console.templates=/opt/prometheus-1.0.0.linux-amd64/consoles -web.console.libraries=/opt/prometheus-1.0.0.linux-amd64/console_libraries',
    localstorage => '/prometheus/prometheus',
}

or simply:

include ::prometheus

To add alert rules, add the following to the class prometheus:

    alerts => [{ 'name' => 'InstanceDown', 'condition' => 'up == 0', 'timeduration' => '5m', labels => [{ 'name' => 'severity', 'content' => 'page'}], 'annotations' => [{ 'name' => 'summary', content => 'Instance {{ $labels.instance }} down'}, {'name' => 'description', content => '{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes.' }]}]

or in hiera:

alertrules:
    -
        name: 'InstanceDown'
        condition:  'up == 0'
        timeduration: '5m'
        labels:
            -
                name: 'severity'
                content: 'critical'
        annotations:
            -
                name: 'summary'
                content: 'Instance {{ $labels.instance }} down'
            -
                name: 'description'
                content: '{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes.'

On the monitored nodes:

   include prometheus::node_exporter

or:

class { 'prometheus::node_exporter':
    version => '0.12.0',
    collectors_disable => ['loadavg','mdadm' ],
    extra_options => '--collector.ntp.server ntp1.orange.intra',
}

For more information regarding class parameters please take a look at class docstring.

Limitations/Known issues

In version 0.1.14 of this module the alertmanager was configured to run as the service alert_manager. This has been changed in version 0.2.00 to be alertmanager.

Do not use version 1.0.0 of Prometheus: https://groups.google.com/forum/#!topic/prometheus-developers/vuSIxxUDff8 ; it does break the compatibility with thus module!

Even if the module has templates for several linux distributions, only RH family distributions were tested.