newrelic_rpm 9.16.0 → 9.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.build_ignore +0 -1
  3. data/CHANGELOG.md +51 -3
  4. data/CONTRIBUTING.md +2 -2
  5. data/lib/boot/strap.rb +4 -3
  6. data/lib/new_relic/agent/agent.rb +4 -0
  7. data/lib/new_relic/agent/agent_helpers/connect.rb +3 -0
  8. data/lib/new_relic/agent/agent_helpers/harvest.rb +3 -0
  9. data/lib/new_relic/agent/agent_helpers/shutdown.rb +3 -0
  10. data/lib/new_relic/agent/agent_helpers/start_worker_thread.rb +1 -0
  11. data/lib/new_relic/agent/agent_helpers/startup.rb +7 -0
  12. data/lib/new_relic/agent/aws.rb +54 -3
  13. data/lib/new_relic/agent/configuration/default_source.rb +52 -11
  14. data/lib/new_relic/agent/configuration/yaml_source.rb +6 -1
  15. data/lib/new_relic/agent/database.rb +5 -1
  16. data/lib/new_relic/agent/distributed_tracing.rb +2 -2
  17. data/lib/new_relic/agent/health_check.rb +136 -0
  18. data/lib/new_relic/agent/instrumentation/active_record_helper.rb +5 -1
  19. data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +8 -4
  20. data/lib/new_relic/agent/instrumentation/aws_sdk_firehose/chain.rb +21 -0
  21. data/lib/new_relic/agent/instrumentation/aws_sdk_firehose/instrumentation.rb +66 -0
  22. data/lib/new_relic/agent/instrumentation/aws_sdk_firehose/prepend.rb +15 -0
  23. data/lib/new_relic/agent/instrumentation/aws_sdk_firehose.rb +22 -0
  24. data/lib/new_relic/agent/instrumentation/aws_sdk_kinesis/chain.rb +21 -0
  25. data/lib/new_relic/agent/instrumentation/aws_sdk_kinesis/instrumentation.rb +91 -0
  26. data/lib/new_relic/agent/instrumentation/aws_sdk_kinesis/prepend.rb +15 -0
  27. data/lib/new_relic/agent/instrumentation/aws_sdk_kinesis.rb +22 -0
  28. data/lib/new_relic/agent/instrumentation/aws_sdk_lambda/instrumentation.rb +8 -9
  29. data/lib/new_relic/agent/instrumentation/dynamodb/instrumentation.rb +7 -1
  30. data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +0 -3
  31. data/lib/new_relic/agent/instrumentation/resque.rb +7 -1
  32. data/lib/new_relic/agent/instrumentation/sidekiq/extensions/delayed_class.rb +1 -1
  33. data/lib/new_relic/agent/local_log_decorator.rb +12 -2
  34. data/lib/new_relic/agent/new_relic_service.rb +8 -2
  35. data/lib/new_relic/agent/threading/backtrace_node.rb +10 -1
  36. data/lib/new_relic/agent/transaction/message_broker_segment.rb +3 -0
  37. data/lib/new_relic/agent.rb +2 -2
  38. data/lib/new_relic/dependency_detection.rb +1 -8
  39. data/lib/new_relic/version.rb +1 -1
  40. data/newrelic.yml +32 -26
  41. data/test/agent_helper.rb +7 -0
  42. metadata +12 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23ad23d616fbcea334710ab3d67003e1775aedbadaecd7d50932c22543419ef4
4
- data.tar.gz: f26ff6b168dc8975354fa1bf7f73f02400d01e2feca735f71b510f92978b3edf
3
+ metadata.gz: c16c3149d187e88f60c408712fa5da2209c4cac08769477b951df4dfb780e95b
4
+ data.tar.gz: d6a0c36115e0b2f9db2ceeb806435737865615dc9043b669376bab20f443dce9
5
5
  SHA512:
6
- metadata.gz: 4519cf295a06513f04810805b8428d0cebdbd8aa4731c4e831de0d873c014978396dee436a966c726866246a26b6ced9dcea5fd1bba2c839b6d69b66b00f51d7
7
- data.tar.gz: 5e32b59dea295c346c88de6c0cc317d7d2d8981fbe7fed6d2d0d72a6cfb2bd6b2eb5ae006871603757e957e85fe0404b618d4e4cee7afae0189ffebb1770945f
6
+ metadata.gz: fc16046f04498bc268cfe08839f9a98580fede0d249c87bd9000d00a8560b0a99ffb2d504f018bc4a752a2008e1339a106a8dc38e46687ed2ddbf76aef839abf
7
+ data.tar.gz: 1b704cc45064a6ccbea20474f1537379b113bdf38788d2a0f7b283e885e0d9cc54c3ea5f935a8d41a81017a416f14adec7a814351c89dbf89d6072c044fb31ff
data/.build_ignore CHANGED
@@ -19,7 +19,6 @@ lefthook.yml
19
19
  log/
20
20
  README.md
21
21
  test/
22
- trivy.yaml
23
22
  lib/tasks/bump_version.rb
24
23
  lib/tasks/coverage_report.rb
25
24
  lib/tasks/multiverse.rake
data/CHANGELOG.md CHANGED
@@ -1,12 +1,60 @@
1
1
  # New Relic Ruby Agent Release Notes
2
2
 
3
+ ## v9.17.0
4
+
5
+ - **Feature: Support Ruby 3.4.0**
6
+
7
+ The agent now supports Ruby 3.4.0. We've made incremental changes throughout the preview stage to reach compatibility. This release includes an update to the Thread Profiler for compatibility with Ruby 3.4.0's new backtrace format. [Issue#2992](https://github.com/newrelic/newrelic-ruby-agent/issues/2992) [PR#2997](https://github.com/newrelic/newrelic-ruby-agent/pull/2997)
8
+
9
+ - **Feature: Add instrumentation for aws-sdk-firehose**
10
+
11
+ The agent now has instrumentation for the [aws-sdk-firehose](https://rubygems.org/gems/aws-sdk-firehose) gem. [PR#2973](https://github.com/newrelic/newrelic-ruby-agent/pull/2973)
12
+
13
+ - **Feature: Kubernetes APM auto-attach - new agent version precedent**
14
+
15
+ Previously, when a customer installed the Ruby agent via [Kubernetes APM auto-attach](https://docs.newrelic.com/docs/kubernetes-pixie/kubernetes-integration/installation/k8s-agent-operator/) and also had the Ruby agent listed in their `Gemfile`, the agent version in `Gemfile` would take precedence. Now, the agent version installed by auto-attach takes priority. [PR#3018](https://github.com/newrelic/newrelic-ruby-agent/pull/3018)
16
+
17
+ - **Feature: Add health checks when the agent runs within Agent Control**
18
+
19
+ When the agent is started within an [Agent Control](https://docs-preview.newrelic.com/docs/new-relic-agent-control) environment, a health check file will be created at the configured file location for every agent process. By default, this location is: '/newrelic/apm/health'. The health check files will be updated at the configured frequency, which defaults to every five seconds. [PR#2995](https://github.com/newrelic/newrelic-ruby-agent/pull/2995)
20
+
21
+ - **Feature: Add Redshift as recognized ActiveRecord adapter**
22
+
23
+ When the agent does not recognize an ActiveRecord adapter, the host, port, and database name information is not added to the datastore span. Redshift will now be treated like PostgreSQL, and the agent will save the host, port, and database name on the span. [PR#3032](https://github.com/newrelic/newrelic-ruby-agent/pull/3032)
24
+
25
+ - **Feature: Add instrumentation for aws-sdk-kinesis**
26
+
27
+ The agent now has instrumentation for the [aws-sdk-kinesis](https://rubygems.org/gems/aws-sdk-kinesis) gem. It will record message broker segments for `get_records`, `put_record`, and `put_records` operations. All other operations will record standard segments. [PR#2974](https://github.com/newrelic/newrelic-ruby-agent/pull/2974)
28
+
29
+ - **Bugfix: Stop emitting inaccurate debug-level log about deprecated configuration options**
30
+
31
+ In the previous major release, we dropped support for `disable_<library_name>` configuration options in favor of `instrumentation.<library_name>`. Previously, a DEBUG level log warning appeared whenever `disable_*` options were set to `true`, even for libraries (e.g. Action Dispatch) without equivalent `instrumentation.*` options:
32
+
33
+ >DEBUG : [DEPRECATED] configuration disable_<library_name> for <library_name> will be removed in the next major release. Use instrumentation.<library_name> with one of ["auto", "disabled", "prepend", "chain"]
34
+
35
+ This inaccurate warning has been removed. If you are disabling instrumentation using `instrumentation.<library_name>: disabled` or `NEW_RELIC_INSTRUMENTATION_<LIBRARY_NAME>=disabled`, please verify the option exists by consulting our [configuration documentation](https://docs.newrelic.com/docs/apm/agents/ruby-agent/configuration/ruby-agent-configuration/#instrumentation). If the option does not exist, check the ['Disabling' section](https://docs.newrelic.com/docs/apm/agents/ruby-agent/configuration/ruby-agent-configuration/#disabling) to see if there is a related option. We apologize for the confusion. [PR#3005](https://github.com/newrelic/newrelic-ruby-agent/pull/3005)
36
+
37
+ - **Bugfix: Do not attempt to decorate logs with `nil` messages**
38
+
39
+ 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)
40
+
41
+ - **Bugfix: Stop renaming final Grape segment**
42
+
43
+ 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).
44
+
45
+ ## v9.16.1
46
+
47
+ - **Bugfix: Add support for Trilogy database adapter**
48
+
49
+ 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).
50
+
3
51
  ## v9.16.0
4
52
 
5
- 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+.
53
+ Version 9.16.0 introduces the following features and bug fixes:
6
54
 
7
55
  - **Feature: Instrumentation for aws-sdk-lambda**
8
56
 
9
- 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).
57
+ 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).
10
58
 
11
59
  - **Feature: Add new configuration options to attach custom tags (labels) to logs**
12
60
 
@@ -598,7 +646,7 @@ Version 9.3.0 of the agent adds log-level filtering, adds custom attributes for
598
646
  | --------------------------- | ------- | ------------------------------------------------------ | ------ |
599
647
  | `application_logging.forwarding.log_level` | `debug` | Sets the minimum log level for events forwarded to New Relic | `debug`, `info`, `warn`, `error`, `fatal`, `unknown` |
600
648
 
601
- This setting uses [Ruby's Logger::Severity constants integer values](https://github.com/ruby/ruby/blob/master/lib/logger/severity.rb#L6-L17) to determine precedence.
649
+ This setting uses [Ruby's Logger::Severity constants integer values](https://github.com/ruby/logger/blob/113b82a06b3076b93a71cd467e1605b23afb3088/lib/logger/severity.rb#L6-L17) to determine precedence.
602
650
 
603
651
  - **Feature: Custom attributes for logs**
604
652
 
data/CONTRIBUTING.md CHANGED
@@ -184,9 +184,9 @@ New Relic hosts and moderates an online forum where customers can interact with
184
184
  New Relic employees as well as other customers to get help and share best
185
185
  practices. Like all official New Relic open source projects, there's a related
186
186
  Community topic in the New Relic Explorers Hub. You can find this project's
187
- topic/threads here:
187
+ topic/threads under the "Ruby Agent" category here:
188
188
 
189
- [Explorer's Hub](https://discuss.newrelic.com/tags/rubyagent)
189
+ [Explorer's Hub](https://forum.newrelic.com/s/category/Category__c/Default)
190
190
 
191
191
  ## And Finally...
192
192
 
data/lib/boot/strap.rb CHANGED
@@ -44,14 +44,15 @@ module NRBundlerPatch
44
44
  NR_AGENT_GEM = 'newrelic_rpm'
45
45
 
46
46
  def require(*_groups)
47
- super
48
-
49
47
  require_newrelic
48
+
49
+ super
50
50
  end
51
51
 
52
52
  def require_newrelic
53
53
  lib = File.expand_path('../..', __FILE__)
54
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
54
+ $LOAD_PATH.reject! { |path| path.include?('newrelic_rpm') }
55
+ $LOAD_PATH.unshift(lib)
55
56
  Kernel.require NR_AGENT_GEM
56
57
  end
57
58
  end
@@ -13,6 +13,7 @@ require 'new_relic/traced_thread'
13
13
  require 'new_relic/coerce'
14
14
  require 'new_relic/agent/autostart'
15
15
  require 'new_relic/agent/harvester'
16
+ require 'new_relic/agent/health_check'
16
17
  require 'new_relic/agent/hostname'
17
18
  require 'new_relic/agent/new_relic_service'
18
19
  require 'new_relic/agent/pipe_service'
@@ -88,6 +89,7 @@ module NewRelic
88
89
  end
89
90
 
90
91
  def init_components
92
+ @health_check = HealthCheck.new
91
93
  @service = NewRelicService.new
92
94
  @events = EventListener.new
93
95
  @stats_engine = StatsEngine.new
@@ -139,6 +141,8 @@ module NewRelic
139
141
  # Holds all the methods defined on NewRelic::Agent::Agent
140
142
  # instances
141
143
  module InstanceMethods
144
+ # the agent control health check file generator
145
+ attr_reader :health_check
142
146
  # the statistics engine that holds all the timeslice data
143
147
  attr_reader :stats_engine
144
148
  # the transaction sampler that handles recording transactions
@@ -68,6 +68,7 @@ module NewRelic
68
68
  def handle_license_error(error)
69
69
  ::NewRelic::Agent.logger.error(error.message,
70
70
  'Visit newrelic.com to obtain a valid license key, or to upgrade your account.')
71
+ NewRelic::Agent.agent.health_check.update_status(NewRelic::Agent::HealthCheck::INVALID_LICENSE_KEY)
71
72
  disconnect
72
73
  end
73
74
 
@@ -191,6 +192,7 @@ module NewRelic
191
192
  @connected_pid = $$
192
193
  @connect_state = :connected
193
194
  signal_connected
195
+ NewRelic::Agent.agent.health_check.update_status(NewRelic::Agent::HealthCheck::HEALTHY)
194
196
  rescue NewRelic::Agent::ForceDisconnectException => e
195
197
  handle_force_disconnect(e)
196
198
  rescue NewRelic::Agent::LicenseException => e
@@ -198,6 +200,7 @@ module NewRelic
198
200
  rescue NewRelic::Agent::UnrecoverableAgentException => e
199
201
  handle_unrecoverable_agent_error(e)
200
202
  rescue StandardError, Timeout::Error, NewRelic::Agent::ServerConnectionException => e
203
+ NewRelic::Agent.agent.health_check.update_status(NewRelic::Agent::HealthCheck::FAILED_TO_CONNECT)
201
204
  retry if retry_from_error?(e, opts)
202
205
  rescue Exception => e
203
206
  ::NewRelic::Agent.logger.error('Exception of unexpected type during Agent#connect():', e)
@@ -119,6 +119,7 @@ module NewRelic
119
119
  rescue UnrecoverableServerException => e
120
120
  NewRelic::Agent.logger.warn("#{endpoint} data was rejected by remote service, discarding. Error: ", e)
121
121
  rescue ServerConnectionException => e
122
+ NewRelic::Agent.agent.health_check.update_status(NewRelic::Agent::HealthCheck::FAILED_TO_CONNECT)
122
123
  log_remote_unavailable(endpoint, e)
123
124
  container.merge!(payload)
124
125
  rescue => e
@@ -133,9 +134,11 @@ module NewRelic
133
134
  rescue ForceRestartException, ForceDisconnectException
134
135
  raise
135
136
  rescue UnrecoverableServerException => e
137
+ NewRelic::Agent.agent.health_check.update_status(NewRelic::Agent::HealthCheck::FAILED_TO_CONNECT)
136
138
  NewRelic::Agent.logger.warn('get_agent_commands message was rejected by remote service, discarding. ' \
137
139
  'Error: ', e)
138
140
  rescue ServerConnectionException => e
141
+ NewRelic::Agent.health_check.update_status(NewRelic::Agent::HealthCheck::FAILED_TO_CONNECT)
139
142
  log_remote_unavailable(:get_agent_commands, e)
140
143
  rescue => e
141
144
  NewRelic::Agent.logger.info('Error during check_for_and_handle_agent_commands, will retry later: ', e)
@@ -19,6 +19,9 @@ module NewRelic
19
19
  revert_to_default_configuration
20
20
 
21
21
  @started = nil
22
+
23
+ NewRelic::Agent.agent.health_check.update_status(NewRelic::Agent::HealthCheck::SHUTDOWN) if NewRelic::Agent.agent.health_check.healthy?
24
+
22
25
  Control.reset
23
26
  end
24
27
 
@@ -86,6 +86,7 @@ module NewRelic
86
86
  # is the worker thread that gathers data and talks to the
87
87
  # server.
88
88
  def handle_force_disconnect(error)
89
+ NewRelic::Agent.agent.health_check.update_status(NewRelic::Agent::HealthCheck::FORCED_DISCONNECT)
89
90
  ::NewRelic::Agent.logger.warn('Agent received a ForceDisconnectException from the server, disconnecting. ' \
90
91
  "(#{error.message})")
91
92
  disconnect
@@ -36,6 +36,9 @@ module NewRelic
36
36
  # setting up the worker thread and the exit handler to shut
37
37
  # down the agent
38
38
  def check_config_and_start_agent
39
+ # some health statuses, such as invalid license key, are ran before
40
+ # the agent officially starts
41
+ @health_check.create_and_run_health_check_loop
39
42
  return unless monitoring? && has_correct_license_key?
40
43
  return if using_forking_dispatcher?
41
44
 
@@ -129,6 +132,7 @@ module NewRelic
129
132
  if Agent.config[:monitor_mode]
130
133
  true
131
134
  else
135
+ NewRelic::Agent.agent.health_check.update_status(NewRelic::Agent::HealthCheck::AGENT_DISABLED)
132
136
  ::NewRelic::Agent.logger.warn('Agent configured not to send data in this environment.')
133
137
  false
134
138
  end
@@ -140,6 +144,7 @@ module NewRelic
140
144
  if Agent.config[:license_key] && Agent.config[:license_key].length > 0
141
145
  true
142
146
  else
147
+ NewRelic::Agent.agent.health_check.update_status(NewRelic::Agent::HealthCheck::MISSING_LICENSE_KEY)
143
148
  ::NewRelic::Agent.logger.warn('No license key found. ' +
144
149
  'This often means your newrelic.yml file was not found, or it lacks a section for the running ' \
145
150
  "environment, '#{NewRelic::Control.instance.env}'. You may also want to try linting your newrelic.yml " \
@@ -160,6 +165,7 @@ module NewRelic
160
165
  if key.length == 40
161
166
  true
162
167
  else
168
+ NewRelic::Agent.agent.health_check.update_status(NewRelic::Agent::HealthCheck::INVALID_LICENSE_KEY)
163
169
  ::NewRelic::Agent.logger.error("Invalid license key: #{key}")
164
170
  false
165
171
  end
@@ -180,6 +186,7 @@ module NewRelic
180
186
  end
181
187
 
182
188
  unless app_name_configured?
189
+ NewRelic::Agent.agent.health_check.update_status(NewRelic::Agent::HealthCheck::MISSING_APP_NAME)
183
190
  NewRelic::Agent.logger.error('No application name configured.',
184
191
  'The agent cannot start without at least one. Please check your ',
185
192
  'newrelic.yml and ensure that it is valid and has at least one ',
@@ -5,13 +5,64 @@
5
5
  module NewRelic
6
6
  module Agent
7
7
  module Aws
8
- def self.create_arn(service, resource, region)
9
- return unless NewRelic::Agent.config[:'cloud.aws.account_id']
8
+ CHARACTERS = %w[A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 2 3 4 5 6 7].freeze
9
+ HEX_MASK = '7fffffffff80'
10
10
 
11
- "arn:aws:#{service}:#{region}:#{NewRelic::Agent.config[:'cloud.aws.account_id']}:#{resource}"
11
+ def self.create_arn(service, resource, region, account_id)
12
+ # if any of the values are nil, we can't create an ARN
13
+ return unless service && resource && region && account_id
14
+
15
+ "arn:aws:#{service}:#{region}:#{account_id}:#{resource}"
12
16
  rescue => e
13
17
  NewRelic::Agent.logger.warn("Failed to create ARN: #{e}")
14
18
  end
19
+
20
+ def self.get_account_id(config)
21
+ # if it is set in the agent config, use that first
22
+ return NewRelic::Agent.config[:'cloud.aws.account_id'] if NewRelic::Agent.config[:'cloud.aws.account_id']
23
+
24
+ access_key_id = config.credentials.credentials.access_key_id if config&.credentials&.credentials&.respond_to?(:access_key_id)
25
+ return unless access_key_id
26
+
27
+ NewRelic::Agent::Aws.convert_access_key_to_account_id(access_key_id)
28
+ rescue => e
29
+ NewRelic::Agent.logger.debug("Failed to create account id: #{e}")
30
+ end
31
+
32
+ def self.convert_access_key_to_account_id(access_key)
33
+ decoded_key = Integer(decode_to_hex(access_key[4..-1]), 16)
34
+ mask = Integer(HEX_MASK, 16)
35
+ (decoded_key & mask) >> 7
36
+ end
37
+
38
+ def self.decode_to_hex(access_key)
39
+ bytes = access_key.delete('=').each_char.map { |c| CHARACTERS.index(c) }
40
+
41
+ bytes.each_slice(8).map do |section|
42
+ convert_section(section)
43
+ end.flatten[0...6].join
44
+ end
45
+
46
+ def self.convert_section(section)
47
+ buffer = 0
48
+ section.each do |chunk|
49
+ buffer = (buffer << 5) + chunk
50
+ end
51
+
52
+ chunk_count = (section.length * 5.0 / 8.0).floor
53
+
54
+ if section.length < 8
55
+ buffer >>= (5 - (chunk_count * 8)) % 5
56
+ end
57
+
58
+ decoded = []
59
+ chunk_count.times do |i|
60
+ shift = 8 * (chunk_count - 1 - i)
61
+ decoded << ((buffer >> shift) & 255).to_s(16)
62
+ end
63
+
64
+ decoded
65
+ end
15
66
  end
16
67
  end
17
68
  end
@@ -139,7 +139,7 @@ module NewRelic
139
139
  case Rails::VERSION::MAJOR
140
140
  when 3
141
141
  :rails3
142
- when 4..7
142
+ when 4..8
143
143
  :rails_notifications
144
144
  else
145
145
  ::NewRelic::Agent.logger.warn("Detected untested Rails version #{Rails::VERSION::STRING}")
@@ -646,7 +646,7 @@ module NewRelic
646
646
  :public => true,
647
647
  :type => Boolean,
648
648
  :allowed_from_server => true,
649
- :description => '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`](#slow_sql-explain_enabled) is not set separately.'
649
+ :description => "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`](#slow_sql-explain_enabled) isn't set separately."
650
650
  },
651
651
  :'transaction_tracer.explain_threshold' => {
652
652
  :default => 0.5,
@@ -858,7 +858,7 @@ module NewRelic
858
858
  :description => <<~DESCRIPTION
859
859
  Sets the minimum level a log event must have to be forwarded to New Relic.
860
860
 
861
- This is based on the integer values of Ruby's `Logger::Severity` constants: https://github.com/ruby/ruby/blob/master/lib/logger/severity.rb
861
+ This is based on the integer values of [Ruby's `Logger::Severity` constants](https://github.com/ruby/logger/blob/113b82a06b3076b93a71cd467e1605b23afb3088/lib/logger/severity.rb).
862
862
 
863
863
  The intention is to forward logs with the level given to the configuration, as well as any logs with a higher level of severity.
864
864
 
@@ -1310,6 +1310,7 @@ module NewRelic
1310
1310
  :default => false,
1311
1311
  :public => true,
1312
1312
  :type => Boolean,
1313
+ :aliases => %i[disable_active_job],
1313
1314
  :allowed_from_server => false,
1314
1315
  :description => 'If `true`, disables Active Job instrumentation.'
1315
1316
  },
@@ -1552,6 +1553,15 @@ module NewRelic
1552
1553
  :allowed_from_server => false,
1553
1554
  :description => 'Controls auto-instrumentation of bunny at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1554
1555
  },
1556
+ :'instrumentation.aws_sdk_firehose' => {
1557
+ :default => 'auto',
1558
+ :documentation_default => 'auto',
1559
+ :public => true,
1560
+ :type => String,
1561
+ :dynamic_name => true,
1562
+ :allowed_from_server => false,
1563
+ :description => 'Controls auto-instrumentation of the aws-sdk-firehose library at start-up. May be one of `auto`, `prepend`, `chain`, `disabled`.'
1564
+ },
1555
1565
  :'instrumentation.aws_sdk_lambda' => {
1556
1566
  :default => 'auto',
1557
1567
  :documentation_default => 'auto',
@@ -1561,6 +1571,15 @@ module NewRelic
1561
1571
  :allowed_from_server => false,
1562
1572
  :description => 'Controls auto-instrumentation of the aws_sdk_lambda library at start-up. May be one of `auto`, `prepend`, `chain`, `disabled`.'
1563
1573
  },
1574
+ :'instrumentation.aws_sdk_kinesis' => {
1575
+ :default => 'auto',
1576
+ :documentation_default => 'auto',
1577
+ :public => true,
1578
+ :type => String,
1579
+ :dynamic_name => true,
1580
+ :allowed_from_server => false,
1581
+ :description => 'Controls auto-instrumentation of the aws-sdk-kinesis library at start-up. May be one of `auto`, `prepend`, `chain`, `disabled`.'
1582
+ },
1564
1583
  :'instrumentation.ruby_kafka' => {
1565
1584
  :default => 'auto',
1566
1585
  :public => true,
@@ -1911,7 +1930,7 @@ module NewRelic
1911
1930
  :description => <<~DESCRIPTION
1912
1931
  An array of strings to specify which keys inside a Stripe event's `user_data` hash should be reported
1913
1932
  to New Relic. Each string in this array will be turned into a regular expression via `Regexp.new` to
1914
- permit advanced matching. Setting the value to `["."]` will report all `user_data`.
1933
+ enable advanced matching. Setting the value to `["."]` will report all `user_data`.
1915
1934
  DESCRIPTION
1916
1935
  },
1917
1936
  :'stripe.user_data.exclude' => {
@@ -1924,8 +1943,8 @@ module NewRelic
1924
1943
  :description => <<~DESCRIPTION
1925
1944
  An array of strings to specify which keys and/or values inside a Stripe event's `user_data` hash should
1926
1945
  not be reported to New Relic. Each string in this array will be turned into a regular expression via
1927
- `Regexp.new` to permit advanced matching. For each hash pair, if either the key or value is matched the
1928
- pair will not be reported. By default, no `user_data` is reported. Use this option only if the
1946
+ `Regexp.new` to permit advanced matching. For each hash pair, if either the key or value is matched the pair
1947
+ isn't reported. By default, no `user_data` is reported. Use this option only if the
1929
1948
  `stripe.user_data.include` option is also used.
1930
1949
  DESCRIPTION
1931
1950
  },
@@ -2069,7 +2088,7 @@ module NewRelic
2069
2088
  :transform => proc { |bool| NewRelic::Agent::ServerlessHandler.env_var_set? || bool },
2070
2089
  :description => 'If `true`, the agent will operate in a streamlined mode suitable for use with short-lived ' \
2071
2090
  'serverless functions. NOTE: Only AWS Lambda functions are supported currently and this ' \
2072
- "option is not intended for use without [New Relic's Ruby Lambda layer](https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/get-started/monitoring-aws-lambda-serverless-monitoring/) offering."
2091
+ "option isn't intended for use without [New Relic's Ruby Lambda layer](https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/get-started/monitoring-aws-lambda-serverless-monitoring/) offering."
2073
2092
  },
2074
2093
  # Sidekiq
2075
2094
  :'sidekiq.args.include' => {
@@ -2177,7 +2196,7 @@ module NewRelic
2177
2196
  :public => true,
2178
2197
  :type => Boolean,
2179
2198
  :allowed_from_server => false,
2180
- :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).'
2199
+ :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).'
2181
2200
  },
2182
2201
  :'strip_exception_messages.allowed_classes' => {
2183
2202
  :default => '',
@@ -2187,6 +2206,28 @@ module NewRelic
2187
2206
  :transform => DefaultSource.method(:convert_to_constant_list),
2188
2207
  :description => 'Specify a list of exceptions you do not want the agent to strip when [strip_exception_messages](#strip_exception_messages-enabled) is `true`. Separate exceptions with a comma. For example, `"ImportantException,PreserveMessageException"`.'
2189
2208
  },
2209
+ # Agent Control
2210
+ :'agent_control.enabled' => {
2211
+ :default => false,
2212
+ :public => false,
2213
+ :type => Boolean,
2214
+ :allowed_from_server => false,
2215
+ :description => 'Boolean value that denotes whether Agent Control functionality should be enabled. At the moment, this functionality is limited to whether agent health should be reported. This configuration will be set using an environment variable by Agent Control, or one of its components, prior to agent startup.'
2216
+ },
2217
+ :'agent_control.health.delivery_location' => {
2218
+ :default => '/newrelic/apm/health',
2219
+ :public => false,
2220
+ :type => String,
2221
+ :allowed_from_server => false,
2222
+ :description => 'A `file:` URI that specifies the fully qualified directory path for health file(s) to be written to. This defaults to: `file:///newrelic/apm/health`. This configuration will be set using an environment variable by Agent Control, or one of its components, prior to agent startup.'
2223
+ },
2224
+ :'agent_control.health.frequency' => {
2225
+ :default => 5,
2226
+ :public => false,
2227
+ :type => Integer,
2228
+ :allowed_from_server => false,
2229
+ :description => 'The interval, in seconds, of how often the health file(s) will be written to. This configuration will be set using an environment variable by Agent Control, or one of its components, prior to agent startup.'
2230
+ },
2190
2231
  # Thread profiler
2191
2232
  :'thread_profiler.enabled' => {
2192
2233
  :default => DefaultSource.thread_profiler_enabled,
@@ -2689,7 +2730,7 @@ module NewRelic
2689
2730
  :public => true,
2690
2731
  :type => Boolean,
2691
2732
  :allowed_from_server => false,
2692
- :description => "If `true`, the security agent is loaded (the agent performs a Ruby 'require')"
2733
+ :description => "If `true`, the security agent is loaded (a Ruby 'require' is performed)"
2693
2734
  },
2694
2735
  :'security.enabled' => {
2695
2736
  :default => false,
@@ -2857,7 +2898,7 @@ module NewRelic
2857
2898
  :type => Integer,
2858
2899
  :external => true,
2859
2900
  :allowed_from_server => true,
2860
- :description => 'Specifies the length of time (in minutes) that the IAST scan will run.'
2901
+ :description => 'Indicates the duration (in minutes) for which the IAST scan will be performed.'
2861
2902
  },
2862
2903
  :'security.scan_schedule.schedule' => {
2863
2904
  :default => '',
@@ -2874,7 +2915,7 @@ module NewRelic
2874
2915
  :public => true,
2875
2916
  :type => Boolean,
2876
2917
  :allowed_from_server => false,
2877
- :description => '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.'
2918
+ :description => '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.'
2878
2919
  },
2879
2920
  :'security.scan_controllers.iast_scan_request_rate_limit' => {
2880
2921
  :default => 3600,
@@ -36,6 +36,7 @@ module NewRelic
36
36
  erb_file = process_erb(raw_file)
37
37
  config = process_yaml(erb_file, env, config, @file_path)
38
38
  rescue ScriptError, StandardError => e
39
+ NewRelic::Agent.agent.health_check.update_status(NewRelic::Agent::HealthCheck::FAILED_TO_PARSE_CONFIG)
39
40
  log_failure("Failed to read or parse configuration file at #{path}", e)
40
41
  end
41
42
 
@@ -99,7 +100,11 @@ module NewRelic
99
100
  file.gsub!(/^\s*#.*$/, '#')
100
101
  ERB.new(file).result(binding)
101
102
  rescue ScriptError, StandardError => e
102
- log_failure('Failed ERB processing configuration file. This is typically caused by a Ruby error in <% %> templating blocks in your newrelic.yml file.', e)
103
+ NewRelic::Agent.agent.health_check.update_status(NewRelic::Agent::HealthCheck::FAILED_TO_PARSE_CONFIG)
104
+ message = 'Failed ERB processing configuration file. This is typically caused by a Ruby error in <% %> templating blocks in your newrelic.yml file.'
105
+ failure_array = [message, e]
106
+ failure_array << e.backtrace[0] if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4.0')
107
+ log_failure(*failure_array)
103
108
  nil
104
109
  end
105
110
  end
@@ -277,9 +277,11 @@ module NewRelic
277
277
  MYSQL_PREFIX = 'mysql'.freeze
278
278
  MYSQL2_PREFIX = 'mysql2'.freeze
279
279
  SQLITE_PREFIX = 'sqlite'.freeze
280
+ TRILOGY_PREFIX = 'trilogy'.freeze
281
+ REDSHIFT_PREFIX = 'redshift'.freeze
280
282
 
281
283
  def symbolized_adapter(adapter)
282
- if adapter.start_with?(POSTGRES_PREFIX) || adapter == POSTGIS_PREFIX
284
+ if adapter.start_with?(POSTGRES_PREFIX) || adapter == POSTGIS_PREFIX || adapter == REDSHIFT_PREFIX
283
285
  :postgres
284
286
  elsif adapter == MYSQL_PREFIX
285
287
  :mysql
@@ -289,6 +291,8 @@ module NewRelic
289
291
  :mysql2
290
292
  elsif adapter.start_with?(SQLITE_PREFIX)
291
293
  :sqlite
294
+ elsif adapter == TRILOGY_PREFIX
295
+ :trilogy
292
296
  else
293
297
  adapter.to_sym
294
298
  end
@@ -45,7 +45,7 @@ module NewRelic
45
45
  record_api_supportability_metric(:insert_distributed_trace_headers)
46
46
 
47
47
  unless Agent.config[:'distributed_tracing.enabled']
48
- NewRelic::Agent.logger.warn('Not configured to insert distributed trace headers')
48
+ NewRelic::Agent.logger.debug('Not configured to insert distributed trace headers')
49
49
  return nil
50
50
  end
51
51
 
@@ -99,7 +99,7 @@ module NewRelic
99
99
  record_api_supportability_metric(:accept_distributed_trace_headers)
100
100
 
101
101
  unless Agent.config[:'distributed_tracing.enabled']
102
- NewRelic::Agent.logger.warn('Not configured to accept distributed trace headers')
102
+ NewRelic::Agent.logger.debug('Not configured to accept distributed trace headers')
103
103
  return nil
104
104
  end
105
105