Skip to content

Commit

Permalink
Fix instrumentation generator
Browse files Browse the repository at this point in the history
* Rubocop has stricter checks on using :: to prefix a class now
It consistently fails on files generated from this template
* There's a syntax error due to a missing comma in the config HEREDOC
  • Loading branch information
kaylareopelle committed Aug 12, 2024
1 parent 4f71983 commit 2959ec8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/tasks/instrumentation_generator/instrumentation.thor
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class Instrumentation < Thor
<<-CONFIG
:'instrumentation.#{snake_name}' => {
:default => 'auto',
:documentation_default => 'auto'
:documentation_default => 'auto',
:public => true,
:type => String,
:dynamic_name => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ DependencyDetection.defer do
depends_on do
# The class that needs to be defined to prepend/chain onto. This can be used
# to determine whether the library is installed.
defined?(::<%= @class_name %>)
defined?(<%= @class_name %>)
# Add any additional requirements to verify whether this instrumentation
# should be installed
end

executes do
::NewRelic::Agent.logger.info('Installing <%= @name.downcase %> instrumentation')
NewRelic::Agent.logger.info('Installing <%= @name.downcase %> instrumentation')

if use_prepend?
prepend_instrument ::<%= @class_name %>, NewRelic::Agent::Instrumentation::<%= @class_name %>::Prepend
prepend_instrument <%= @class_name %>, NewRelic::Agent::Instrumentation::<%= @class_name %>::Prepend
else
chain_instrument NewRelic::Agent::Instrumentation::<%= @class_name %>::Chain
end
Expand Down

0 comments on commit 2959ec8

Please sign in to comment.