Skip to content

Commit

Permalink
(MAINT) Bug Fix - ship sar metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
coreymbe committed Mar 26, 2024
1 parent 7448325 commit 37e20d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ All notable changes to this project will be documented in this file. The format

### Fixed

- Bug fix preventing `sar` metrics collected by `puppet_metrics_collector::system` from being shipped to Splunk. [#214](https://github.com/puppetlabs/puppetlabs-splunk_hec/pull/214)

- The `collect_facts` parameter has been renamed to `facts_allowlist` to align with the `facts_blocklist` parameter. [#212](https://github.com/puppetlabs/puppetlabs-splunk_hec/pull/212)

- No longer utilizing `parse_legacy_metrics` function for metrics collected with older versions of `puppet_metrics_collector`. [#211](https://github.com/puppetlabs/puppetlabs-splunk_hec/pull/211)
Expand Down
7 changes: 6 additions & 1 deletion lib/puppet/application/splunk_hec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ def send_pe_metrics(data, sourcetype)
content.each_key do |serv|
event = event_template.clone
event['host'] = name
event['event'] = content[serv.to_s]
if content[serv.to_s].is_a?(Array)
event['event'] = {}
event['event']['metrics'] = content[serv.to_s]
else
event['event'] = content[serv.to_s]
end
event['event']['pe_console'] = pe_console
event['event']['pe_service'] = serv.to_s
Puppet.info 'Submitting metrics to Splunk'
Expand Down

0 comments on commit 37e20d3

Please sign in to comment.