Showing with 33 additions and 23 deletions.
  1. +0 −2 .rubocop.yml
  2. +6 −0 .sync.yml
  3. +4 −3 .travis.yml
  4. +5 −0 CHANGELOG.md
  5. +6 −7 Rakefile
  6. +1 −1 files/amq_metrics
  7. +1 −1 files/pe_metrics.rb
  8. +2 −2 files/system_metrics
  9. +4 −4 manifests/service/orchestrator.pp
  10. +3 −3 metadata.json
  11. +1 −0 spec/spec_helper.rb
2 changes: 0 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,6 @@ Style/BlockComments:
Enabled: false
Style/BlockDelimiters:
Enabled: false
Style/BracesAroundHashParameters:
Enabled: false
Style/CaseEquality:
Enabled: false
Style/CharacterLiteral:
Expand Down
6 changes: 6 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ spec/default_facts.yml:
pe_server_version: '2016.4.5'
.rubocop.yml:
selected_profile: off

.travis.yml:
branches:
- master
- main
- /^v\d/
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ script:
- 'bundle exec rake $CHECK'
bundler_args: --without system_tests
rvm:
- 2.5.3
- 2.5.7
stages:
- static
- spec
Expand All @@ -36,14 +36,15 @@ jobs:
stage: spec
-
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
rvm: 2.5.3
rvm: 2.5.7
stage: spec
-
env: DEPLOY_TO_FORGE=yes
stage: deploy
branches:
only:
- master
- main
- /^v\d/
- master
notifications:
email: false
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Patch Release 6.1.1

## Changes:
- Fixes a bug where Orchestrator metrics collection used the Puppetserver parameters

# Minor Release 6.1.0

## Improvements
Expand Down
13 changes: 6 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,36 +52,35 @@ if Bundler.rubygems.find_name('github_changelog_generator').any?
config.header = "# Change log\n\nAll notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org)."
config.add_pr_wo_labels = true
config.issues = false
config.merge_prefix = "### UNCATEGORIZED PRS; GO LABEL THEM"
config.merge_prefix = "### UNCATEGORIZED PRS; LABEL THEM ON GITHUB"
config.configure_sections = {
"Changed" => {
"prefix" => "### Changed",
"labels" => ["backwards-incompatible"],
},
"Added" => {
"prefix" => "### Added",
"labels" => ["feature", "enhancement"],
"labels" => ["enhancement", "feature"],
},
"Fixed" => {
"prefix" => "### Fixed",
"labels" => ["bugfix"],
"labels" => ["bug", "documentation", "bugfix"],
},
}
end
else
desc 'Generate a Changelog from GitHub'
task :changelog do
raise <<EOM
The changelog tasks depends on unreleased features of the github_changelog_generator gem.
The changelog tasks depends on recent features of the github_changelog_generator gem.
Please manually add it to your .sync.yml for now, and run `pdk update`:
---
Gemfile:
optional:
':development':
- gem: 'github_changelog_generator'
git: 'https://github.com/skywinder/github-changelog-generator'
ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"
version: '~> 1.15'
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')"
EOM
end
end
Expand Down
2 changes: 1 addition & 1 deletion files/amq_metrics
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ HOSTS.each do |host|
end
else
req = element['request']
metrics = treeify(req['mbean'], { req['attribute'] => req['value'] })
metrics = treeify(req['mbean'], req['attribute'] => req['value'])
recurse_merge!(dataset['servers'][hostkey][METRICS_TYPE], metrics)
end
end
Expand Down
2 changes: 1 addition & 1 deletion files/pe_metrics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
config = YAML.load_file(config_file)

def coalesce(higher_precedence, lower_precedence, default = nil)
[higher_precedence, lower_precedence].find{|x|!x.nil?} || default
[higher_precedence, lower_precedence, default].find{|x|!x.nil?}
end

METRICS_TYPE = options[:metrics_type]
Expand Down
4 changes: 2 additions & 2 deletions files/system_metrics
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ module SystemMetrics
unknown_count += 1
comm_identifier = "#{comm_identifier}_#{unknown_count}"
end
data_hash[k].merge!({"command_full" => v, "pid" => k})
data_hash[k].merge!("command_full" => v, "pid" => k)
data_hash[comm_identifier] = data_hash.delete(k)
end

Expand Down Expand Up @@ -309,7 +309,7 @@ module SystemMetrics
# Time object is created after successful sar run
# so could be nil when an error occurs. But the file needs a name based on a timestamp
@time_stamp_obj = Time.now if @time_stamp_obj.nil?
metrics_json = metrics_to_json({:error => error_msg})
metrics_json = metrics_to_json(:error => error_msg)
write_metrics_to_file(metrics_json)
exit 1
end
Expand Down
8 changes: 4 additions & 4 deletions manifests/service/orchestrator.pp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Collect Service Metrics
class puppet_metrics_collector::service::orchestrator (
String $metrics_ensure = $puppet_metrics_collector::puppetserver_metrics_ensure,
String $metrics_ensure = $puppet_metrics_collector::orchestrator_metrics_ensure,
Integer $collection_frequency = $puppet_metrics_collector::collection_frequency,
Integer $retention_days = $puppet_metrics_collector::retention_days,
Array[String] $hosts = $puppet_metrics_collector::puppetserver_hosts,
Integer $port = $puppet_metrics_collector::puppetserver_port,
Array[String] $hosts = $puppet_metrics_collector::orchestrator_hosts,
Integer $port = $puppet_metrics_collector::orchestrator_port,
Optional[String] $override_metrics_command = $puppet_metrics_collector::override_metrics_command,
Optional[Array[String]] $excludes = $puppet_metrics_collector::puppetserver_excludes,
Optional[Array[String]] $excludes = $puppet_metrics_collector::orchestrator_excludes,
Optional[Enum['influxdb', 'graphite', 'splunk_hec']] $metrics_server_type = $puppet_metrics_collector::metrics_server_type,
Optional[String] $metrics_server_hostname = $puppet_metrics_collector::metrics_server_hostname,
Optional[Integer] $metrics_server_port = $puppet_metrics_collector::metrics_server_port,
Expand Down
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-puppet_metrics_collector",
"version": "6.1.0",
"version": "6.1.1",
"author": "npwalker",
"summary": "A Puppet module for gathering metrics from PE components",
"license": "Apache-2.0",
Expand Down Expand Up @@ -56,7 +56,7 @@
"version_requirement": ">= 5.5.1"
}
],
"pdk-version": "1.16.0",
"pdk-version": "1.18.1",
"template-url": "https://github.com/puppetlabs/pdk-templates#master",
"template-ref": "heads/master-0-g522fe70"
"template-ref": "remotes/origin/master-0-ga58fd92"
}
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
# set to strictest setting for testing
# by default Puppet runs at warning level
Puppet.settings[:strict] = :warning
Puppet.settings[:strict_variables] = true
end
c.filter_run_excluding(bolt: true) unless ENV['GEM_BOLT']
c.after(:suite) do
Expand Down