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

Refactor statsd_exporter class to support version >= 0.5.0; bump from 0.3.0->0.8.0 #271

Merged
merged 3 commits into from
Nov 2, 2018
Merged

Refactor statsd_exporter class to support version >= 0.5.0; bump from 0.3.0->0.8.0 #271

merged 3 commits into from
Nov 2, 2018

Conversation

wiebe
Copy link

@wiebe wiebe commented Oct 17, 2018

Signed-off-by: Wiebe Verweij wiebe@wiebelt.nl

Pull Request (PR) description

Refactor statsd_exporter class to support version >= 0.5.0

This Pull Request (PR) fixes the following issues

Fixes #248

@wiebe
Copy link
Author

wiebe commented Oct 17, 2018

I dont have enough time anymore, i'll fix the small style issues next week. Probably Tuesday.

prometheus::statsd_exporter::package_ensure: 'latest'
prometheus::statsd_exporter::package_name: 'statsd_exporter'
prometheus::statsd_exporter::user: 'statsd-exporter'
prometheus::statsd_exporter::version: '0.3.0'
prometheus::statsd_exporter::version: '0.8.0'
Copy link
Member

Choose a reason for hiding this comment

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

Can you please keep the old version? Otherwise it would be a breaking change. We want to do that in a later release for all exporters.

Copy link
Author

@wiebe wiebe Oct 17, 2018

Choose a reason for hiding this comment

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

It is a breaking change anyways. The configuration format changed between v0.4.0 and v0.5.0. It won't download and configure v0.3.0 or older correctly, it would require more/duplicate logic to also support the old version.

Copy link
Author

Choose a reason for hiding this comment

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

The style issues are fixed now and saw that i didn't see that versions older than v0.7.0 still used the single dash options so i added some logic for that too.

Copy link
Author

Choose a reason for hiding this comment

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

I also did an experiment to see how difficult it would be to support older versions as well but it gets quite funky and i think more confusing with the different file format and names..

Copy link
Member

Choose a reason for hiding this comment

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

We did a release of this module a few days ago. In the current merge window we want to update all exporters, so this is fine now.

Signed-off-by: Wiebe Verweij <wiebe@wiebelt.nl>
@bastelfreak bastelfreak changed the title Refactor statsd_exporter class to support version >= 0.5.0 Refactor statsd_exporter class to support version >= 0.5.0; bump from 0.3.0->0.8.0 Oct 24, 2018
@@ -0,0 +1,3 @@
<% require 'yaml' -%>
<% full_config = { 'mappings'=>@mappings } -%>
<%= full_config.to_yaml -%>
Copy link
Member

Choose a reason for hiding this comment

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

Can't we use this puppet function to generate the yaml? https://github.com/puppetlabs/puppetlabs-stdlib#to_yaml
and provide that to the file as content? That would allow us to not use a template at all.

Copy link
Author

@wiebe wiebe Oct 24, 2018

Choose a reason for hiding this comment

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

I looked at code for other exporter how they did it and they also used this method, thought it was a bit silly too but didn't know about the to_yaml function in the stdlib and made the click i could just use it directly :-)

The blackbox and process exporter do something similiar.

@bastelfreak
Copy link
Member

Can you please add an acceptance test for this?

@wiebe
Copy link
Author

wiebe commented Oct 24, 2018

Can you please add an acceptance test for this?

Is there any information somewhere on how i can even run the acceptance tests myself?, that is what held me back the most (i already have docker and everything installed i think, just need the command really)..

@bastelfreak
Copy link
Member

You can execute them locally with:

PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker\,hostname=puppet.local} BEAKER_destroy=yes bundle exec rspec spec/acceptance/$specfile.rb

@bastelfreak bastelfreak added enhancement New feature or request backwards-incompatible and removed enhancement New feature or request labels Nov 2, 2018
@bastelfreak
Copy link
Member

Thanks for the PR!

@bastelfreak bastelfreak merged commit 4083f66 into voxpupuli:master Nov 2, 2018
cegeka-jenkins pushed a commit to cegeka/puppet-prometheus that referenced this pull request Aug 28, 2019
Refactor statsd_exporter class to support version >= 0.5.0; bump from 0.3.0->0.8.0
Rovanion pushed a commit to Rovanion/puppet-prometheus that referenced this pull request May 5, 2021
Refactor statsd_exporter class to support version >= 0.5.0; bump from 0.3.0->0.8.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support statsd_exporter >= 0.5.0
2 participants