Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new feature - consul_exporter #36

Merged
merged 12 commits into from Jan 23, 2018
Merged

new feature - consul_exporter #36

merged 12 commits into from Jan 23, 2018

Conversation

pavloos
Copy link

@pavloos pavloos commented May 11, 2017

  • added consul_exporter

@pavloos
Copy link
Author

pavloos commented Jun 2, 2017

bump

@pavloos
Copy link
Author

pavloos commented Aug 16, 2017

Hello, Can this PR be looked into please ?

@liamjbennett
Copy link
Member

This looks good to me. @bastelfreak any issues with me merging?

}

$real_download_url = pick($download_url,"${download_url_base}/download/v${version}/${package_name}-${version}.${os}-${arch}.${download_extension}")
validate_bool($purge_config_dir)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @pjfbashton, could you replace those legacy functions with native puppet datatypes?

# [*web_telemetry_path*]
# Path under which to expose metrics. (default "/metrics")
class prometheus::consul_exporter (
String $arch = $::prometheus::params::arch,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

datatypes \o/

@bastelfreak
Copy link
Member

@pjfbashton thanks for the datatypes. Can you add at least a little unit test that verifies if the catalog compiles?

@pavloos
Copy link
Author

pavloos commented Nov 16, 2017

@bastelfreak Oh, those tests failed a while ago, have changed anything ? I think there is a problem with prometheus service - it does not start (at least on Centos 7) on the first run with default settings (just include ::prometheus). Is this known bug?

I can try adding unit test although it is new to me, have you got an example I could take a look at?

@bastelfreak
Copy link
Member

One example is at: https://github.com/voxpupuli/puppet-prometheus/blob/master/spec/classes/beanstalkd_exporter_spec.rb

I am not really sure why the acceptance tests fail randomly. I wasn't able to reproduce this locally. Sometimes they work, sometimes they don't :(

@pavloos
Copy link
Author

pavloos commented Nov 16, 2017

Failed again on prometheus service not starting after first run. The same happens for me locally...

[root@e789cf77067a ~]# cat /etc/redhat-release 
CentOS Linux release 7.2.1511 (Core) 
[root@e789cf77067a ~]# puppet -V
4.10.5

puppet module install puppet-archive -v 2.1.0
puppet module install puppetlabs-stdlib -v 4.22.0
puppet module install camptocamp-systemd -v 1.1.0
git clone --branch v3.0.0 https://github.com/voxpupuli/puppet-prometheus.git \
  && mv puppet-prometheus/ /etc/puppetlabs/code/modules/prometheus
echo "include prometheus" > p.pp

[root@e789cf77067a ~]# puppet apply --verbose p.pp
Info: Loading facts
Info: Loading facts
Info: Loading facts
Warning: /etc/puppetlabs/puppet/hiera.yaml: Use of 'hiera.yaml' version 3 is deprecated. It should be converted to version 5
   (in /etc/puppetlabs/puppet/hiera.yaml)
Notice: Compiled catalog for e789cf77067a.xps13.pjf in environment production in 0.45 seconds
Info: Applying configuration version '1510830353'
Notice: /Stage[main]/Prometheus::Install/Archive[/tmp/prometheus-1.5.2.tar.gz]/ensure: download archive from https://github.com/prometheus/prometheus/releases/download/v1.5.2/prometheus-1.5.2.linux-amd64.tar.gz to /tmp/prometheus-1.5.2.tar.gz and extracted in /opt with cleanup
Notice: /Stage[main]/Prometheus::Install/File[/opt/prometheus-1.5.2.linux-amd64/prometheus]/owner: owner changed 'pawel' to 'root'
Notice: /Stage[main]/Prometheus::Install/File[/opt/prometheus-1.5.2.linux-amd64/prometheus]/group: group changed 'pawel' to 'root'
Notice: /Stage[main]/Prometheus::Install/File[/opt/prometheus-1.5.2.linux-amd64/prometheus]/mode: mode changed '0755' to '0555'
Notice: /Stage[main]/Prometheus::Install/File[/usr/local/bin/prometheus]/ensure: created
Info: /Stage[main]/Prometheus::Install/File[/usr/local/bin/prometheus]: Scheduling refresh of Service[prometheus]
Notice: /Stage[main]/Prometheus::Install/Group[prometheus]/ensure: created
Notice: /Stage[main]/Prometheus::Install/User[prometheus]/ensure: created
Notice: /Stage[main]/Prometheus::Install/File[/var/lib/prometheus]/ensure: created
Notice: /Stage[main]/Prometheus::Install/File[/usr/local/share/prometheus]/ensure: created
Notice: /Stage[main]/Prometheus::Install/File[/usr/local/share/prometheus/consoles]/ensure: created
Info: /Stage[main]/Prometheus::Install/File[/usr/local/share/prometheus/consoles]: Scheduling refresh of Service[prometheus]
Notice: /Stage[main]/Prometheus::Install/File[/usr/local/share/prometheus/console_libraries]/ensure: created
Info: /Stage[main]/Prometheus::Install/File[/usr/local/share/prometheus/console_libraries]: Scheduling refresh of Service[prometheus]
Notice: /Stage[main]/Prometheus::Config/File[/etc/prometheus]/ensure: created
Info: /Stage[main]/Prometheus::Config/File[/etc/prometheus]: Scheduling refresh of Class[Prometheus::Run_service]
Notice: /Stage[main]/Prometheus::Config/File[prometheus.yaml]/ensure: defined content as '{md5}1463d85961bf7b73da62eaf7be1eaef9'
Info: /Stage[main]/Prometheus::Config/File[prometheus.yaml]: Scheduling refresh of Class[Prometheus::Service_reload]
Notice: /Stage[main]/Prometheus::Config/Systemd::Unit_file[prometheus.service]/File[/etc/systemd/system/prometheus.service]/ensure: defined content as '{md5}5ca91801aafbad71eec1c195d4d508dc'
Info: /Stage[main]/Prometheus::Config/Systemd::Unit_file[prometheus.service]/File[/etc/systemd/system/prometheus.service]: Scheduling refresh of Class[Systemd::Systemctl::Daemon_reload]
Info: Class[Systemd::Systemctl::Daemon_reload]: Scheduling refresh of Exec[systemctl-daemon-reload]
Notice: /Stage[main]/Systemd::Systemctl::Daemon_reload/Exec[systemctl-daemon-reload]: Triggered 'refresh' from 1 events
Info: Class[Prometheus::Run_service]: Scheduling refresh of Service[prometheus]
Notice: /Stage[main]/Prometheus::Run_service/Service[prometheus]/ensure: ensure changed 'stopped' to 'running'
Info: /Stage[main]/Prometheus::Run_service/Service[prometheus]: Unscheduling refresh on Service[prometheus]
Info: Class[Prometheus::Service_reload]: Scheduling refresh of Exec[prometheus-reload]
Notice: /Stage[main]/Prometheus::Service_reload/Exec[prometheus-reload]: Triggered 'refresh' from 1 events
Info: Creating state file /opt/puppetlabs/puppet/cache/state/state.yaml
Notice: Applied catalog in 19.75 seconds
[root@e789cf77067a ~]# systemctl status prometheus
● prometheus.service - Prometheus Monitoring framework
   Loaded: loaded (/etc/systemd/system/prometheus.service; enabled; vendor preset: disabled)
   Active: inactive (dead) since Thu 2017-11-16 11:06:13 UTC; 23s ago
  Process: 409 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)
 Main PID: 369 (code=killed, signal=HUP)

Nov 16 11:06:13 e789cf77067a systemd[1]: Started Prometheus Monitoring framework.
Nov 16 11:06:13 e789cf77067a systemd[1]: Starting Prometheus Monitoring framework...
Nov 16 11:06:13 e789cf77067a systemd[1]: Reloaded Prometheus Monitoring framework.

@pavloos
Copy link
Author

pavloos commented Jan 23, 2018

all green now @bastelfreak

@tuxmea tuxmea merged commit c1da72f into voxpupuli:master Jan 23, 2018
@tuxmea
Copy link
Member

tuxmea commented Jan 23, 2018

looks good to me. thank you for the PR.

Rovanion pushed a commit to Rovanion/puppet-prometheus that referenced this pull request May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants