Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Add params, separate configs #20

Merged
merged 1 commit into from
Dec 26, 2018
Merged

Conversation

genebean
Copy link
Contributor

Parameters added:

  • influxdb_urls
  • telegraf_db_name
  • telegraf_agent_interval
  • http_response_timeout

Global telegraf settings are now managed via ini_setting resources.
Settings for this module are moved from telegraf.conf to
telegraf.d/puppet_metrics_dashboard.conf. These changes allow configs other
than the ones for this module to be set while still allowing this module
to udpate its config.

Update .fixtures and metadata (fixes #18)

Also removed top scope references and replaced legacy facts

@genebean
Copy link
Contributor Author

So... not sure why beaker isn't installing the inifile module. Its listed in both .fixtures.yaml and metadata.json. There is also a failure related to gem update --system that I believe is a known issue.

@suckatrash
Copy link
Contributor

I suspect the problem is that we also need to update new module dependencies in spec/spec_helper_acceptance.rb
@jarretlavallee - Does that sound right to you?

@jarretlavallee
Copy link
Contributor

@genebean The inifile module needs to be installed on the beaker machine in https://github.com/puppetlabs/puppet_metrics_dashboard/blob/master/spec/spec_helper_acceptance.rb#L29-L32. The acceptance spec helper could be better written with beaker-module_install_helper or rsyncing from the spec/fixtures, but that's a separate issue.

@genebean
Copy link
Contributor Author

@suckatrash & @jarretlavallee - the only failing test is the one that I believe is a known issue (gem update --system)... do I need to do anything more or is this good from a CI perspective?

@jarretlavallee
Copy link
Contributor

Thanks @genebean. It's up to @suckatrash. It seems that we can merge this and I will fix the gem update issue in another pr.

@genebean
Copy link
Contributor Author

The next version of the pdk should resolve that issue FWIW.

@suckatrash
Copy link
Contributor

@genebean - I'm fine with merging this and ignoring the build failure.

Question though: How would the change in puppet_metrics_dashboard.conf vs telegraf.conf impact existing users? Will they end up with duplicate configuration? Will the service start if configured that way? Basically, could this be a breaking change?

@genebean
Copy link
Contributor Author

I believe that the conf.d files override the .conf file but am not 100% sure... let me test that and document the results

@genebean genebean force-pushed the enhancements branch 3 times, most recently from dfb3252 to 82ec274 Compare December 26, 2018 20:04
Parameters added:
- influxdb_urls
- telegraf_db_name
- telegraf_agent_interval
- http_response_timeout

Global telegraf settings are now managed via ini_setting resources.
Settings for this module are moved from telegraf.conf to
telegraf.d/puppet_metrics_dashboard.conf. These changes allow configs other
than the ones for this module to be set while still allowing this module
to udpate its config.

Update .fixtures and metadata (fixes puppetlabs#18)

Also removed top scope references and replaced legacy facts
@genebean
Copy link
Contributor Author

Telegraf seems to be working just fine after migrating from the forge module to my pr. I updated the readme with a note about this change too.

Here's how I tested:

~ » sudo -i puppet module install puppetlabs-puppet_metrics_dashboard

~ » sudo -i puppet apply -e "include puppet_metrics_dashboard"

~ » systemctl status telegraf
● telegraf.service - The plugin-driven server agent for reporting metrics into InfluxDB
   Loaded: loaded (/usr/lib/systemd/system/telegraf.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2018-12-26 12:10:52 PST; 9s ago
     Docs: https://github.com/influxdata/telegraf
 Main PID: 2989 (telegraf)
   CGroup: /system.slice/telegraf.service
           └─2989 /usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d

Dec 26 12:10:52 localhost.localdomain systemd[1]: Started The plugin-driven server agent for reporting metrics into InfluxDB.
Dec 26 12:10:52 localhost.localdomain systemd[1]: Starting The plugin-driven server agent for reporting metrics into InfluxDB...
Dec 26 12:10:52 localhost.localdomain telegraf[2989]: 2018-12-26T20:10:52Z I! Starting Telegraf 1.9.1

~ » cd /etc/puppetlabs/code/environments/production/modules

/etc/puppetlabs/code/environments/production/modules » sudo rm -rf puppet_metrics_dashboard

/etc/puppetlabs/code/environments/production/modules » sudo git clone https://github.com/genebean/puppet_metrics_dashboard.git puppet_metrics_dashboard

/etc/puppetlabs/code/environments/production/modules » cd puppet_metrics_dashboard

/etc/puppetlabs/code/environments/production/modules/puppet_metrics_dashboard(master) » sudo git checkout enhancements

/etc/puppetlabs/code/environments/production/modules/puppet_metrics_dashboard(enhancements) » cd

~ » sudo -i puppet module install puppetlabs-inifile

~ » sudo -i puppet apply -e "include puppet_metrics_dashboard"

~ » systemctl status telegraf
● telegraf.service - The plugin-driven server agent for reporting metrics into InfluxDB
   Loaded: loaded (/usr/lib/systemd/system/telegraf.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2018-12-26 12:12:35 PST; 11s ago
     Docs: https://github.com/influxdata/telegraf
 Main PID: 4358 (telegraf)
   CGroup: /system.slice/telegraf.service
           └─4358 /usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d

Dec 26 12:12:35 localhost.localdomain systemd[1]: Started The plugin-driven server agent for reporting metrics into InfluxDB.
Dec 26 12:12:35 localhost.localdomain systemd[1]: Starting The plugin-driven server agent for reporting metrics into InfluxDB...
Dec 26 12:12:35 localhost.localdomain telegraf[4358]: 2018-12-26T20:12:35Z I! Starting Telegraf 1.9.1

~ » grep -v 'connection refused' /var/log/telegraf/telegraf.log 
2018-12-26T20:10:52Z I! Loaded inputs: inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson
2018-12-26T20:10:52Z I! Loaded aggregators:
2018-12-26T20:10:52Z I! Loaded processors:
2018-12-26T20:10:52Z I! Loaded outputs: influxdb
2018-12-26T20:10:52Z I! Tags enabled: host=localhost.localdomain
2018-12-26T20:10:52Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"localhost.localdomain", Flush Interval:10s
2018-12-26T20:12:35Z I! [agent] Hang on, flushing any cached metrics before shutdown
2018-12-26T20:12:35Z I! Loaded inputs: inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson inputs.httpjson
2018-12-26T20:12:35Z I! Loaded aggregators:
2018-12-26T20:12:35Z I! Loaded processors:
2018-12-26T20:12:35Z I! Loaded outputs: influxdb
2018-12-26T20:12:35Z I! Tags enabled: host=localhost.localdomain
2018-12-26T20:12:35Z I! [agent] Config: Interval:5s, Quiet:false, Hostname:"localhost.localdomain", Flush Interval:10s

@suckatrash suckatrash merged commit c5945a5 into puppetlabs:master Dec 26, 2018
@genebean
Copy link
Contributor Author

Thanks for the quick feedback @suckatrash and @jarretlavallee !

@genebean genebean deleted the enhancements branch December 26, 2018 21:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

apt module not in metadata.json
4 participants