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

Fix Datadog Reports #848

Merged
merged 5 commits into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,11 @@ platforms:
- dnf module -y reset ruby
- dnf module -y enable ruby:3.1
- dnf module -y install ruby:3.1/common
- dnf update -y

- rpm -Uvh https://yum.puppet.com/puppet8-release-el-9.noarch.rpm #installs the puppet-agent repo
- yum install -y puppet-agent-8.10.0 rubygems ruby-devel procps-ng
- dnf group install -y "Development Tools"
- dnf group install -y "Development Tools" --nobest
Copy link
Contributor Author

Choose a reason for hiding this comment

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

--nobest is to allow installing a lower version that meets package version requirements

- ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet

- mkdir /home/kitchen/puppet -p
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/reports/datadog_reports.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def process
Puppet.debug "Sending metrics for #{@msg_host} to Datadog"
@dog.batch_metrics do
metrics.each do |metric, data|
data.each_value do |val|
data.values.each do |val| # rubocop:disable Style/HashEachMethods
Copy link
Member

Choose a reason for hiding this comment

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

error that requires this:
2025-03-14T15:12:49.135Z ERROR [qtp2067368747-71] [puppetserver] Puppet Report processor failed: undefined method each_value' for #<Puppet::Util::Metric:0x7317bca6>

name = "puppet.#{val[1].tr(' ', '_')}.#{metric}".downcase
value = val[2]
@dog.emit_point(name.to_s, value, host: @msg_host.to_s)
Expand Down
Loading