Forge Home

prometheus

Prometheus Puppet module

12,626 downloads

7,192 latest version

4.6 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.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 2.0.0 (latest)
  • 1.6.1
  • 1.6.0
  • 1.5.0
  • 1.4.1
  • 1.3.0
  • 1.2.0
  • 1.1.2
  • 1.1.1
  • 1.1.0
  • 1.0.0
released May 8th 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 'cristifalcas-prometheus', '2.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install cristifalcas-prometheus --version 2.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

cristifalcas/prometheus — version 2.0.0 May 8th 2017

puppet-prometheus

Build Status

Table of Contents

  1. Overview
  2. Usage - Configuration options and additional functionality
  3. 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',
    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