diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41a061873a..839e1850b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -384,4 +384,4 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} resultPath: lib/coverage_results/.last_run.json failedThreshold: 93.5 - failedThresholdBranch: 50 + failedThresholdBranch: 0 diff --git a/.simplecov b/.simplecov index fc932a35bf..719c1a05b4 100644 --- a/.simplecov +++ b/.simplecov @@ -9,7 +9,7 @@ if ENV['CI'] end SimpleCov.start do - enable_coverage(:branch) + # enable_coverage(:branch) SimpleCov.root(File.join(File.dirname(__FILE__), '/lib')) track_files('**/*.rb') formatter(SimpleCov::Formatter::SimpleFormatter) if ENV['CI'] diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d949a61c4..310ffab922 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,28 @@ # New Relic Ruby Agent Release Notes +## dev + +- **Bugfix: Do not attempt to decorate logs with `nil` messages** + + The agent no longer attempts to add New Relic linking metadata to logs with `nil` messages. Thank you, [@arlando](https://github.com/arlando) for bringing this to our attention! [Issue#2985](https://github.com/newrelic/newrelic-ruby-agent/issues/2985) [PR#2986](https://github.com/newrelic/newrelic-ruby-agent/pull/2986) + +- **Bugfix: Stop renaming final Grape segment** + + Previously, the agent renamed the final segment in Grape transactions to `"Middleware/Grape/#{class_name}/call"`. This was a part of an old instrumentation pattern that is no longer relevant. Many thanks to [@seriousdev-gh](https://github.com/seriousdev-gh) for bringing this issue to our attention and along with a great reproduction and suggested fix. [PR#2987](https://github.com/newrelic/newrelic-ruby-agent/pull/2987). + +## v9.16.1 + +- **Bugfix: Add support for Trilogy database adapter** + + The agent now fully supports Trilogy, a client library for MySQL-compatible database servers, and correctly lists MySQL as the corresponding database in the UI. [PR#2966](https://github.com/newrelic/newrelic-ruby-agent/pull/2966). + ## v9.16.0 -Version 9.16.0 introduces instrumentation for the aws-sdk-lambda gem, allows users to opt-in to adding labels to logs, updates View Component instrumentation, and fixes a bug with explain plans on Rails 7.2+. +Version 9.16.0 introduces the following features and bug fixes: - **Feature: Instrumentation for aws-sdk-lambda** - If the aws-sdk-lambda gem is present and used to invoke remote AWS Lambda functions, timing and error details for the invocations will be reported to New Relic. [PR#2926](https://github.com/newrelic/newrelic-ruby-agent/pull/2926). + When the aws-sdk-lambda gem is available and used to invoke remote AWS Lambda functions, the timing and error details of the invocations will be reported to New Relic. [PR#2926](https://github.com/newrelic/newrelic-ruby-agent/pull/2926). - **Feature: Add new configuration options to attach custom tags (labels) to logs** diff --git a/lib/new_relic/agent.rb b/lib/new_relic/agent.rb index 888ce963ba..6bbdc4d58e 100644 --- a/lib/new_relic/agent.rb +++ b/lib/new_relic/agent.rb @@ -132,8 +132,8 @@ class SerializationError < StandardError; end def agent # :nodoc: return @agent if @agent - NewRelic::Agent.logger.warn("Agent unavailable as it hasn't been started.") - NewRelic::Agent.logger.warn(caller.join("\n")) + NewRelic::Agent.logger.debug("Agent unavailable as it hasn't been started.") + NewRelic::Agent.logger.debug(caller.join("\n")) nil end diff --git a/lib/new_relic/agent/configuration/default_source.rb b/lib/new_relic/agent/configuration/default_source.rb index 0b6b139997..2ce8e93275 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -139,7 +139,7 @@ def self.framework case Rails::VERSION::MAJOR when 3 :rails3 - when 4..7 + when 4..8 :rails_notifications else ::NewRelic::Agent.logger.warn("Detected untested Rails version #{Rails::VERSION::STRING}") @@ -2186,7 +2186,7 @@ def self.notify :public => true, :type => Boolean, :allowed_from_server => false, - :description => 'If true, the agent strips messages from all exceptions except those in the [allowlist](#strip_exception_messages-allowlist). Enabled automatically in [high security mode](/docs/accounts-partnerships/accounts/security/high-security).' + :description => 'If true, the agent strips messages from all exceptions except those in the [allowed classes list](#strip_exception_messages-allowed_classes). Enabled automatically in [high security mode](/docs/accounts-partnerships/accounts/security/high-security).' }, :'strip_exception_messages.allowed_classes' => { :default => '', diff --git a/lib/new_relic/agent/configuration/yaml_source.rb b/lib/new_relic/agent/configuration/yaml_source.rb index f076dd1409..574d29ef83 100644 --- a/lib/new_relic/agent/configuration/yaml_source.rb +++ b/lib/new_relic/agent/configuration/yaml_source.rb @@ -99,7 +99,10 @@ def process_erb(file) file.gsub!(/^\s*#.*$/, '#') ERB.new(file).result(binding) rescue ScriptError, StandardError => e - log_failure('Failed ERB processing configuration file. This is typically caused by a Ruby error in <% %> templating blocks in your newrelic.yml file.', e) + message = 'Failed ERB processing configuration file. This is typically caused by a Ruby error in <% %> templating blocks in your newrelic.yml file.' + failure_array = [message, e] + failure_array << e.backtrace[0] if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4.0') + log_failure(*failure_array) nil end end diff --git a/lib/new_relic/agent/database.rb b/lib/new_relic/agent/database.rb index e7d9db9f40..174e364f7c 100644 --- a/lib/new_relic/agent/database.rb +++ b/lib/new_relic/agent/database.rb @@ -277,6 +277,7 @@ def append_sql(new_sql) MYSQL_PREFIX = 'mysql'.freeze MYSQL2_PREFIX = 'mysql2'.freeze SQLITE_PREFIX = 'sqlite'.freeze + TRILOGY_PREFIX = 'trilogy'.freeze def symbolized_adapter(adapter) if adapter.start_with?(POSTGRES_PREFIX) || adapter == POSTGIS_PREFIX @@ -289,6 +290,8 @@ def symbolized_adapter(adapter) :mysql2 elsif adapter.start_with?(SQLITE_PREFIX) :sqlite + elsif adapter == TRILOGY_PREFIX + :trilogy else adapter.to_sym end diff --git a/lib/new_relic/agent/distributed_tracing.rb b/lib/new_relic/agent/distributed_tracing.rb index f0110e67a1..d49aabe68b 100644 --- a/lib/new_relic/agent/distributed_tracing.rb +++ b/lib/new_relic/agent/distributed_tracing.rb @@ -45,7 +45,7 @@ def insert_distributed_trace_headers(headers = {}) record_api_supportability_metric(:insert_distributed_trace_headers) unless Agent.config[:'distributed_tracing.enabled'] - NewRelic::Agent.logger.warn('Not configured to insert distributed trace headers') + NewRelic::Agent.logger.debug('Not configured to insert distributed trace headers') return nil end @@ -99,7 +99,7 @@ def accept_distributed_trace_headers(headers, transport_type = NewRelic::HTTP) record_api_supportability_metric(:accept_distributed_trace_headers) unless Agent.config[:'distributed_tracing.enabled'] - NewRelic::Agent.logger.warn('Not configured to accept distributed trace headers') + NewRelic::Agent.logger.debug('Not configured to accept distributed trace headers') return nil end diff --git a/lib/new_relic/agent/instrumentation/active_record_helper.rb b/lib/new_relic/agent/instrumentation/active_record_helper.rb index 814668410c..8fa4939b56 100644 --- a/lib/new_relic/agent/instrumentation/active_record_helper.rb +++ b/lib/new_relic/agent/instrumentation/active_record_helper.rb @@ -170,6 +170,9 @@ def map_operation(raw_operation) 'sqlite3' => 'SQLite', + # https://rubygems.org/gems/trilogy + 'trilogy' => 'MySQL', + # https://rubygems.org/gems/activerecord-jdbcpostgresql-adapter 'jdbcmysql' => 'MySQL', diff --git a/lib/new_relic/agent/instrumentation/grape/instrumentation.rb b/lib/new_relic/agent/instrumentation/grape/instrumentation.rb index 6d05c8db09..85c3e296dc 100644 --- a/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +++ b/lib/new_relic/agent/instrumentation/grape/instrumentation.rb @@ -56,10 +56,7 @@ def handle_transaction(endpoint, class_name, version) def name_transaction(route, class_name, version) txn_name = name_for_transaction(route, class_name, version) - segment_name = "Middleware/Grape/#{class_name}/call" NewRelic::Agent::Transaction.set_default_transaction_name(txn_name, :grape) - txn = NewRelic::Agent::Transaction.tl_current - txn.segments.last.name = segment_name end def name_for_transaction(route, class_name, version) diff --git a/lib/new_relic/agent/local_log_decorator.rb b/lib/new_relic/agent/local_log_decorator.rb index e5a5abe60e..1085c788ee 100644 --- a/lib/new_relic/agent/local_log_decorator.rb +++ b/lib/new_relic/agent/local_log_decorator.rb @@ -9,7 +9,7 @@ module LocalLogDecorator extend self def decorate(message) - return message unless decorating_enabled? + return message if !decorating_enabled? || message.nil? metadata = NewRelic::Agent.linking_metadata diff --git a/lib/new_relic/version.rb b/lib/new_relic/version.rb index 40b2e49399..5fa810af0d 100644 --- a/lib/new_relic/version.rb +++ b/lib/new_relic/version.rb @@ -7,7 +7,7 @@ module NewRelic module VERSION # :nodoc: MAJOR = 9 MINOR = 16 - TINY = 0 + TINY = 1 STRING = "#{MAJOR}.#{MINOR}.#{TINY}" end diff --git a/newrelic.yml b/newrelic.yml index 954b0cd781..68a0cdd1c4 100644 --- a/newrelic.yml +++ b/newrelic.yml @@ -205,9 +205,8 @@ common: &default_settings # monitoring scripts. For now, auto-injection only works with Rails 5.2+. # browser_monitoring.content_security_policy_nonce: true - # Manual override for the path to your local CA bundle. This CA bundle will be - # used to validate the SSL certificate presented by New Relic's data collection - # service. + # Manual override for the path to your local CA bundle. This CA bundle validates + # the SSL certificate presented by New Relic's data collection service. # ca_bundle_path: nil # Enable or disable the capture of memcache keys from transaction traces. @@ -323,7 +322,6 @@ common: &default_settings # If true, disables agent middleware for Sinatra. This middleware is responsible # for advanced feature support such as cross application tracing, page load # timing, and error collection. - # # disable_sinatra_auto_middleware: false # If true, disables view instrumentation. @@ -723,8 +721,8 @@ common: &default_settings # If true, the agent will operate in a streamlined mode suitable for use with # short-lived serverless functions. NOTE: Only AWS Lambda functions are - # supported currently and this option is not intended for use without New - # Relic's Ruby Lambda layer offering. + # supported currently and this option isn't intended for use without New Relic's + # Ruby Lambda layer offering. # serverless_mode.enabled: false # An array of strings that will collectively serve as a denylist for filtering @@ -803,17 +801,17 @@ common: &default_settings # not be reported to New Relic. Each string in this array will be turned into a # regular expression via # Regexp.new to permit advanced matching. For each hash pair, if either the key - # or value is matched the - # pair will not be reported. By default, no user_data is reported, so this - # option should only be used if - # the stripe.user_data.include option is being used. + # or value is matched the pair + # isn't reported. By default, no user_data is reported. Use this option only if + # the + # stripe.user_data.include option is also used. # stripe.user_data.exclude: [] # An array of strings to specify which keys inside a Stripe event's user_data # hash should be reported # to New Relic. Each string in this array will be turned into a regular # expression via Regexp.new to - # permit advanced matching. Setting the value to ["."] will report all + # enable advanced matching. Setting the value to ["."] will report all # user_data. # stripe.user_data.include: [] @@ -877,7 +875,7 @@ common: &default_settings # If true, enables the collection of explain plans in transaction traces. This # setting will also apply to explain plans in slow SQL traces if - # slow_sql.explain_enabled is not set separately. + # slow_sql.explain_enabled isn't set separately. # transaction_tracer.explain_enabled: true # Threshold (in seconds) above which the agent will collect explain plans. @@ -951,12 +949,12 @@ common: &default_settings # NOTE: All "security.*" configuration parameters are related only to the # security agent, and all other configuration parameters that may # have "security" in the name somewhere are related to the APM agent. - - # If true, the security agent is loaded (a Ruby 'require' is performed) + + # If true, the security agent loads (the agent performs a Ruby 'require') # security.agent.enabled: false # The port the application is listening on. This setting is mandatory for - # Passenger servers. Other servers are detected by default. + # Passenger servers. The agent detects other servers by default. # security.application_info.port: nil # If true, the security agent is started (the agent runs in its event loop) @@ -964,7 +962,7 @@ common: &default_settings # Defines API paths the security agent should ignore in IAST scans. Accepts an # array of regex patterns matching the URI to ignore. The regex pattern should - # provide a complete match for the URL without the endpoint. For example, + # find a complete match for the URL without the endpoint. For example, # [".*account.*"], [".*/\api\/v1\/.*?\/login"] # security.exclude_from_iast_scan.api: [] @@ -985,8 +983,8 @@ common: &default_settings # If true, disables system command injection detection in IAST scans. # security.exclude_from_iast_scan.iast_detection_category.command_injection: false - # If true, disables the detection of low-severity insecure settings (e.g., hash, - # crypto, cookie, random generators, trust boundary). + # If true, disables the detection of low-severity insecure settings. For + # example, hash, crypto, cookie, random generators, trust boundary). # security.exclude_from_iast_scan.iast_detection_category.insecure_settings: false # If true, disables file operation-related IAST detections (File Access & @@ -1015,8 +1013,8 @@ common: &default_settings # If true, disables XPATH injection detection in IAST scans. # security.exclude_from_iast_scan.iast_detection_category.xpath_injection: false - # Unique test identifier when runnning IAST in CI/CD environment to - # differentiate between different test runs, e.g., a build number. + # A unique test identifier when runnning IAST in a CI/CD environment to + # differentiate between different test runs. For example, a build number. # security.iast_test_identifier: nil # Defines the mode for the security agent to operate in. Currently only IAST is @@ -1031,20 +1029,20 @@ common: &default_settings # disables Reflected Cross-Site Scripting (RXSS) vulnerability detection. # security.scan_controllers.report_http_response_body: true - # The number of application instances for a specific entity on which IAST - # analysis is performed. + # The number of application instances for a specific entity to perform IAST + # analysis on. # security.scan_controllers.scan_instance_count: 0 - # If true, allows IAST to continuously gather trace data in the background. - # Collected data will be used by the security agent to perform an IAST scan at - # the scheduled time. + # If true, allows IAST to continuously gather trace data in the background. The + # security agent uses collected data to perform an IAST scan at the scheduled + # time. # security.scan_schedule.always_sample_traces: false # Specifies the delay time (in minutes) before the IAST scan begins after the # application starts. # security.scan_schedule.delay: 0 - # Specifies the length of time (in minutes) that the IAST scan will run. + # Indicates the duration (in minutes) for which the IAST scan will be performed. # security.scan_schedule.duration: 0 # Specifies a cron expression that sets when the IAST scan should run. diff --git a/test/multiverse/suites/config_file_loading/Envfile b/test/multiverse/suites/config_file_loading/Envfile index c90f1707e8..d54a8f701f 100644 --- a/test/multiverse/suites/config_file_loading/Envfile +++ b/test/multiverse/suites/config_file_loading/Envfile @@ -4,28 +4,32 @@ omit_collector! -# TODO: RUBY 3.4 -# The CI has a prism-related error when it tries to run this suite -# The problem may be a bug fixed in future preview releases -# Disable ths suite for now, and try again when the next version -# is out. PSYCH_VERSIONS = [ - [nil, 2.4, 3.3], + [nil], ['4.0.0', 2.4, 3.3], ['3.3.0', 2.4, 3.3] ] def stringio_version if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4') - "gem 'stringio', '3.1.2.dev'" + "gem 'stringio', '~> 3.1.2'" else "gem 'stringio'" end end +def date_version + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4') + "gem 'date', '~> 3.3.4'" + else + "gem 'date'" + end +end + def gem_list(psych_version = nil) <<~RB #{stringio_version} + #{date_version} # stub file system so we can test that newrelic.yml can be loaded from # various places. gem 'fakefs', :require => false diff --git a/test/multiverse/suites/config_file_loading/config_file_loading_test.rb b/test/multiverse/suites/config_file_loading/config_file_loading_test.rb index 953427bea7..15b18c5cd2 100644 --- a/test/multiverse/suites/config_file_loading/config_file_loading_test.rb +++ b/test/multiverse/suites/config_file_loading/config_file_loading_test.rb @@ -158,20 +158,15 @@ def test_warning_logged_when_config_file_yaml_parsing_error assert_log_contains(log, /ERROR.*Failed to read or parse configuration file at config\/newrelic\.yml/) end - # TODO: RUBY 3.4 SUPPORT - # Both error class and output have changes in Ruby 3.4 - # See Issue: https://github.com/newrelic/newrelic-ruby-agent/issues/2902 - unless Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4.0') - def test_warning_logged_when_config_file_erb_error - path = File.join(@cwd, 'config', 'newrelic.yml') - setup_config(path, {}, "\n\n\n<%= this is not ruby %>") # the error is on line 4 - setup_agent - - log = with_array_logger { NewRelic::Agent.manual_start } - - assert_log_contains(log, /ERROR.*Failed ERB processing/) - assert_log_contains(log, /\(erb\):4/) - end + def test_warning_logged_when_config_file_erb_error + path = File.join(@cwd, 'config', 'newrelic.yml') + setup_config(path, {}, "\n\n\n<%= this is not ruby %>") # the error is on line 4 + setup_agent + + log = with_array_logger { NewRelic::Agent.manual_start } + + assert_log_contains(log, /ERROR.*Failed ERB processing/) + assert_log_contains(log, /\(erb\):4/) end def test_exclude_commented_out_erb_lines diff --git a/test/multiverse/suites/grape/grape_test.rb b/test/multiverse/suites/grape/grape_test.rb index db0d3c3cf3..c7c15dec03 100644 --- a/test/multiverse/suites/grape/grape_test.rb +++ b/test/multiverse/suites/grape/grape_test.rb @@ -36,38 +36,38 @@ def test_route_raises_an_error expected_txn_name = 'Controller/Grape/GrapeTestApi/self_destruct (GET)' - assert_grape_metrics(expected_txn_name) + assert_metrics_recorded(expected_txn_name) assert_metrics_recorded(["Errors/#{expected_txn_name}"]) end def test_getting_a_list_of_grape_apes get('/grape_ape') - assert_grape_metrics('Controller/Grape/GrapeTestApi/grape_ape (GET)') + assert_metrics_recorded('Controller/Grape/GrapeTestApi/grape_ape (GET)') end def test_showing_a_grape_ape get('/grape_ape/1') - assert_grape_metrics('Controller/Grape/GrapeTestApi/grape_ape/:id (GET)') + assert_metrics_recorded('Controller/Grape/GrapeTestApi/grape_ape/:id (GET)') end def test_creating_a_grape_ape post('/grape_ape', {}) - assert_grape_metrics('Controller/Grape/GrapeTestApi/grape_ape (POST)') + assert_metrics_recorded('Controller/Grape/GrapeTestApi/grape_ape (POST)') end def test_updating_a_grape_ape put('/grape_ape/1', {}) - assert_grape_metrics('Controller/Grape/GrapeTestApi/grape_ape/:id (PUT)') + assert_metrics_recorded('Controller/Grape/GrapeTestApi/grape_ape/:id (PUT)') end def test_deleting_a_grape_ape delete('/grape_ape/1') - assert_grape_metrics('Controller/Grape/GrapeTestApi/grape_ape/:id (DELETE)') + assert_metrics_recorded('Controller/Grape/GrapeTestApi/grape_ape/:id (DELETE)') end def test_transaction_renaming @@ -81,7 +81,7 @@ def test_transaction_renaming # internal representation of the name and category of a transaction as # truly separate entities. # - assert_grape_metrics('Controller/Rack/RenamedTxn') + assert_metrics_recorded('Controller/Rack/RenamedTxn') end def test_params_are_not_captured_with_capture_params_disabled @@ -259,16 +259,6 @@ def test_distinct_routes_make_for_distinct_txn_names assert_equal paths.size, names.uniq.size, 'Expected there to be one unique transaction name per unique full route path' end - - def assert_grape_metrics(expected_txn_name) - expected_node_name = 'Middleware/Grape/GrapeTestApi/call' - - assert_metrics_recorded([ - expected_node_name, - [expected_node_name, expected_txn_name], - expected_txn_name - ]) - end end end @@ -286,14 +276,7 @@ def app def test_subclass_of_grape_api_instance get('/banjaxing') - expected_node_name = 'Middleware/Grape/GrapeApiInstanceTestApi/call' - expected_txn_name = 'Controller/Grape/GrapeApiInstanceTestApi/banjaxing (GET)' - - assert_metrics_recorded([ - expected_node_name, - [expected_node_name, expected_txn_name], - expected_txn_name - ]) + assert_metrics_recorded('Controller/Grape/GrapeApiInstanceTestApi/banjaxing (GET)') end end end diff --git a/test/new_relic/agent/database_test.rb b/test/new_relic/agent/database_test.rb index afac64f8a8..26179b5872 100644 --- a/test/new_relic/agent/database_test.rb +++ b/test/new_relic/agent/database_test.rb @@ -52,6 +52,13 @@ def test_adapter_from_config_string_postgis assert_equal(:postgres, statement.adapter) end + def test_adapter_from_config_trilogy + config = {:adapter => 'trilogy'} + statement = NewRelic::Agent::Database::Statement.new('some query', config) + + assert_equal(:trilogy, statement.adapter) + end + # An ActiveRecord::Result is what you get back when executing a # query using exec_query on the connection, which is what we're # doing now for explain plans in AR4 instrumentation diff --git a/test/new_relic/agent/instrumentation/active_record_helper_test.rb b/test/new_relic/agent/instrumentation/active_record_helper_test.rb index a53a559766..f524f73aa3 100644 --- a/test/new_relic/agent/instrumentation/active_record_helper_test.rb +++ b/test/new_relic/agent/instrumentation/active_record_helper_test.rb @@ -55,6 +55,12 @@ def test_product_operation_collection_for_with_product_name_from_adapter assert_equal 'Model', collection end + def test_product_operation_collection_for_with_product_name_from_adapter_trilogy + product, _operation, _collection = ActiveRecordHelper.product_operation_collection_for(nil, '', 'trilogy') + + assert_equal 'MySQL', product + end + def test_product_operation_collection_for_from_sql product, operation, collection = ActiveRecordHelper.product_operation_collection_for('invalid', 'SELECT * FROM boo', nil) diff --git a/test/new_relic/agent/local_log_decorator_test.rb b/test/new_relic/agent/local_log_decorator_test.rb index a3208fedd2..7a0a2c23f2 100644 --- a/test/new_relic/agent/local_log_decorator_test.rb +++ b/test/new_relic/agent/local_log_decorator_test.rb @@ -77,6 +77,13 @@ def test_decorates_if_enabled assert_equal decorated_message, "#{MESSAGE} #{METADATA_STRING}" end + def test_does_not_decorate_if_message_is_nil + metadata_stubs + decorated_message = LocalLogDecorator.decorate(nil) + + assert_nil(decorated_message) + end + def test_decorate_puts_metadata_at_end_of_first_newline metadata_stubs message = "This is a test of the Emergency Alert System\n this is only a test...." diff --git a/test/new_relic/agent_test.rb b/test/new_relic/agent_test.rb index 3bf5281dfa..adf6187f9a 100644 --- a/test/new_relic/agent_test.rb +++ b/test/new_relic/agent_test.rb @@ -123,9 +123,9 @@ def test_manual_start_kicks_dependency_check_again NewRelic::Agent.shutdown end - def test_agent_logs_warning_when_not_started + def test_agent_logs_debug_when_not_started with_unstarted_agent do - expects_logging(:warn, includes("hasn't been started")) + expects_logging(:debug, includes("hasn't been started")) NewRelic::Agent.agent end end