newrelic_rpm 9.14.0 → 9.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +101 -5
- data/CONTRIBUTING.md +2 -2
- data/lib/boot/strap.rb +4 -3
- data/lib/new_relic/agent/agent.rb +4 -0
- data/lib/new_relic/agent/agent_helpers/connect.rb +3 -0
- data/lib/new_relic/agent/agent_helpers/harvest.rb +3 -0
- data/lib/new_relic/agent/agent_helpers/shutdown.rb +3 -0
- data/lib/new_relic/agent/agent_helpers/start_worker_thread.rb +1 -0
- data/lib/new_relic/agent/agent_helpers/startup.rb +7 -0
- data/lib/new_relic/agent/aws.rb +6 -0
- data/lib/new_relic/agent/configuration/default_source.rb +258 -35
- data/lib/new_relic/agent/configuration/manager.rb +1 -1
- data/lib/new_relic/agent/configuration/yaml_source.rb +6 -1
- data/lib/new_relic/agent/database.rb +41 -1
- data/lib/new_relic/agent/distributed_tracing.rb +2 -2
- data/lib/new_relic/agent/health_check.rb +136 -0
- data/lib/new_relic/agent/instrumentation/active_record.rb +1 -8
- data/lib/new_relic/agent/instrumentation/active_record_helper.rb +5 -1
- data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +9 -16
- data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger.rb +0 -2
- data/lib/new_relic/agent/instrumentation/active_support_logger.rb +0 -2
- data/lib/new_relic/agent/instrumentation/async_http.rb +1 -2
- data/lib/new_relic/agent/instrumentation/aws_sdk_firehose/chain.rb +21 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_firehose/instrumentation.rb +66 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_firehose/prepend.rb +15 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_firehose.rb +22 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_kinesis/chain.rb +21 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_kinesis/instrumentation.rb +91 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_kinesis/prepend.rb +15 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_kinesis.rb +22 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_lambda/chain.rb +33 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_lambda/instrumentation.rb +93 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_lambda/prepend.rb +23 -0
- data/lib/new_relic/agent/instrumentation/aws_sdk_lambda.rb +23 -0
- data/lib/new_relic/agent/instrumentation/aws_sqs.rb +0 -2
- data/lib/new_relic/agent/instrumentation/bunny.rb +3 -4
- data/lib/new_relic/agent/instrumentation/concurrent_ruby.rb +0 -2
- data/lib/new_relic/agent/instrumentation/curb.rb +3 -4
- data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +0 -4
- data/lib/new_relic/agent/instrumentation/dynamodb/instrumentation.rb +3 -4
- data/lib/new_relic/agent/instrumentation/dynamodb.rb +0 -2
- data/lib/new_relic/agent/instrumentation/elasticsearch.rb +0 -2
- data/lib/new_relic/agent/instrumentation/ethon.rb +0 -4
- data/lib/new_relic/agent/instrumentation/fiber.rb +0 -2
- data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +0 -3
- data/lib/new_relic/agent/instrumentation/grape.rb +1 -3
- data/lib/new_relic/agent/instrumentation/httpclient.rb +0 -1
- data/lib/new_relic/agent/instrumentation/httprb.rb +0 -1
- data/lib/new_relic/agent/instrumentation/httpx.rb +0 -4
- data/lib/new_relic/agent/instrumentation/logger.rb +1 -3
- data/lib/new_relic/agent/instrumentation/logstasher.rb +0 -2
- data/lib/new_relic/agent/instrumentation/memcache.rb +0 -1
- data/lib/new_relic/agent/instrumentation/opensearch.rb +0 -2
- data/lib/new_relic/agent/instrumentation/padrino.rb +3 -3
- data/lib/new_relic/agent/instrumentation/rake.rb +0 -1
- data/lib/new_relic/agent/instrumentation/rdkafka/chain.rb +2 -1
- data/lib/new_relic/agent/instrumentation/rdkafka/prepend.rb +2 -1
- data/lib/new_relic/agent/instrumentation/rdkafka.rb +0 -2
- data/lib/new_relic/agent/instrumentation/redis.rb +0 -1
- data/lib/new_relic/agent/instrumentation/resque.rb +7 -5
- data/lib/new_relic/agent/instrumentation/roda.rb +4 -4
- data/lib/new_relic/agent/instrumentation/ruby_kafka/prepend.rb +14 -4
- data/lib/new_relic/agent/instrumentation/ruby_kafka.rb +0 -2
- data/lib/new_relic/agent/instrumentation/sidekiq/extensions/delayed_class.rb +1 -1
- data/lib/new_relic/agent/instrumentation/sinatra.rb +3 -6
- data/lib/new_relic/agent/instrumentation/thread.rb +0 -2
- data/lib/new_relic/agent/instrumentation/tilt.rb +0 -4
- data/lib/new_relic/agent/instrumentation/typhoeus.rb +0 -1
- data/lib/new_relic/agent/instrumentation/view_component/instrumentation.rb +11 -8
- data/lib/new_relic/agent/instrumentation/view_component.rb +0 -2
- data/lib/new_relic/agent/local_log_decorator.rb +12 -2
- data/lib/new_relic/agent/log_event_aggregator.rb +28 -2
- data/lib/new_relic/agent/new_relic_service.rb +8 -2
- data/lib/new_relic/agent/span_event_primitive.rb +4 -2
- data/lib/new_relic/agent/threading/backtrace_node.rb +10 -1
- data/lib/new_relic/agent/transaction/message_broker_segment.rb +3 -0
- data/lib/new_relic/agent.rb +2 -2
- data/lib/new_relic/control/frameworks/rails4.rb +1 -5
- data/lib/new_relic/dependency_detection.rb +11 -13
- data/lib/new_relic/environment_report.rb +1 -5
- data/lib/new_relic/helper.rb +15 -0
- data/lib/new_relic/language_support.rb +1 -5
- data/lib/new_relic/version.rb +1 -1
- data/lib/sequel/extensions/new_relic_instrumentation.rb +1 -1
- data/lib/tasks/instrumentation_generator/templates/dependency_detection.tt +9 -6
- data/newrelic.yml +135 -54
- data/test/agent_helper.rb +8 -1
- metadata +16 -6
@@ -455,6 +455,8 @@ module NewRelic
|
|
455
455
|
end
|
456
456
|
|
457
457
|
def handle_error_response(response, endpoint)
|
458
|
+
NewRelic::Agent.agent.health_check.update_status(NewRelic::Agent::HealthCheck::HTTP_ERROR, [response.code, endpoint])
|
459
|
+
|
458
460
|
case response
|
459
461
|
when Net::HTTPRequestTimeOut,
|
460
462
|
Net::HTTPTooManyRequests,
|
@@ -637,9 +639,13 @@ module NewRelic
|
|
637
639
|
def send_request(opts)
|
638
640
|
request = prep_request(opts)
|
639
641
|
response = relay_request(request, opts)
|
640
|
-
return response if response.is_a?(Net::HTTPSuccess) || response.is_a?(Net::HTTPAccepted)
|
641
642
|
|
642
|
-
|
643
|
+
if response.is_a?(Net::HTTPSuccess) || response.is_a?(Net::HTTPAccepted)
|
644
|
+
NewRelic::Agent.agent.health_check.update_status(NewRelic::Agent::HealthCheck::HEALTHY)
|
645
|
+
response
|
646
|
+
else
|
647
|
+
handle_error_response(response, opts[:endpoint])
|
648
|
+
end
|
643
649
|
end
|
644
650
|
|
645
651
|
def log_response(response)
|
@@ -52,6 +52,8 @@ module NewRelic
|
|
52
52
|
DATASTORE_CATEGORY = 'datastore'
|
53
53
|
CLIENT = 'client'
|
54
54
|
|
55
|
+
DB_STATEMENT_MAX_BYTES = 4096
|
56
|
+
|
55
57
|
# Builds a Hash of error attributes as well as the Span ID when
|
56
58
|
# an error is present. Otherwise, returns nil when no error present.
|
57
59
|
def error_attributes(segment)
|
@@ -114,9 +116,9 @@ module NewRelic
|
|
114
116
|
agent_attributes[DB_SYSTEM_KEY] = segment.product if allowed?(DB_SYSTEM_KEY)
|
115
117
|
|
116
118
|
if segment.sql_statement && allowed?(DB_STATEMENT_KEY)
|
117
|
-
agent_attributes[DB_STATEMENT_KEY] = truncate(segment.sql_statement.safe_sql,
|
119
|
+
agent_attributes[DB_STATEMENT_KEY] = truncate(segment.sql_statement.safe_sql, DB_STATEMENT_MAX_BYTES)
|
118
120
|
elsif segment.nosql_statement && allowed?(DB_STATEMENT_KEY)
|
119
|
-
agent_attributes[DB_STATEMENT_KEY] = truncate(segment.nosql_statement,
|
121
|
+
agent_attributes[DB_STATEMENT_KEY] = truncate(segment.nosql_statement, DB_STATEMENT_MAX_BYTES)
|
120
122
|
end
|
121
123
|
|
122
124
|
[intrinsics, custom_attributes(segment), agent_attributes.merge(agent_attributes(segment))]
|
@@ -125,7 +125,16 @@ module NewRelic
|
|
125
125
|
|
126
126
|
# Returns [filename, method, line number]
|
127
127
|
def parse_backtrace_frame(frame)
|
128
|
-
|
128
|
+
# TODO: OLD RUBIES - Ruby 3.3
|
129
|
+
# The (?:`|') non-capturing group can be removed when the agent
|
130
|
+
# drops support for Ruby 3.3
|
131
|
+
# This group is used to capture the pre-Ruby 3.4.0 backtrace syntax.
|
132
|
+
# Example frame:
|
133
|
+
# Ruby 3.3.0 and below
|
134
|
+
# "irb.rb:69:in `catch'"
|
135
|
+
# Ruby 3.4.0+
|
136
|
+
# "irb.rb:69:in 'Kernel#catch'"
|
137
|
+
frame =~ /([^:]*)(\:(\d+))?\:in (?:`|')(.*)'/
|
129
138
|
[$1, $4, $3] # sic
|
130
139
|
end
|
131
140
|
end
|
@@ -15,6 +15,7 @@ module NewRelic
|
|
15
15
|
PRODUCE = 'Produce'.freeze
|
16
16
|
QUEUE = 'Queue'.freeze
|
17
17
|
PURGE = 'Purge'.freeze
|
18
|
+
STREAM = 'Stream'.freeze
|
18
19
|
TEMP = 'Temp'.freeze
|
19
20
|
TOPIC = 'Topic'.freeze
|
20
21
|
UNKNOWN = 'Unknown'.freeze
|
@@ -22,6 +23,7 @@ module NewRelic
|
|
22
23
|
DESTINATION_TYPES = [
|
23
24
|
:exchange,
|
24
25
|
:queue,
|
26
|
+
:stream,
|
25
27
|
:topic,
|
26
28
|
:temporary_queue,
|
27
29
|
:temporary_topic,
|
@@ -37,6 +39,7 @@ module NewRelic
|
|
37
39
|
TYPES = {
|
38
40
|
exchange: EXCHANGE,
|
39
41
|
temporary_queue: QUEUE,
|
42
|
+
stream: STREAM,
|
40
43
|
queue: QUEUE,
|
41
44
|
temporary_topic: TOPIC,
|
42
45
|
topic: TOPIC,
|
data/lib/new_relic/agent.rb
CHANGED
@@ -132,8 +132,8 @@ module NewRelic
|
|
132
132
|
def agent # :nodoc:
|
133
133
|
return @agent if @agent
|
134
134
|
|
135
|
-
NewRelic::Agent.logger.
|
136
|
-
NewRelic::Agent.logger.
|
135
|
+
NewRelic::Agent.logger.debug("Agent unavailable as it hasn't been started.")
|
136
|
+
NewRelic::Agent.logger.debug(caller.join("\n"))
|
137
137
|
nil
|
138
138
|
end
|
139
139
|
|
@@ -9,11 +9,7 @@ module NewRelic
|
|
9
9
|
module Frameworks
|
10
10
|
class Rails4 < NewRelic::Control::Frameworks::Rails3
|
11
11
|
def rails_gem_list
|
12
|
-
|
13
|
-
Bundler.rubygems.installed_specs.map { |gem| "#{gem.name} (#{gem.version})" }
|
14
|
-
else
|
15
|
-
Bundler.rubygems.all_specs.map { |gem| "#{gem.name} (#{gem.version})" }
|
16
|
-
end
|
12
|
+
NewRelic::Helper.rubygems_specs.map { |gem| "#{gem.name} (#{gem.version})" }
|
17
13
|
end
|
18
14
|
|
19
15
|
def append_plugin_list
|
@@ -25,11 +25,9 @@ module DependencyDetection
|
|
25
25
|
|
26
26
|
def detect!
|
27
27
|
@items.each do |item|
|
28
|
-
if item.
|
29
|
-
|
30
|
-
|
31
|
-
item.configure_as_unsatisfied unless item.disabled_configured?
|
32
|
-
end
|
28
|
+
next if item.executed || item.disabled_configured?
|
29
|
+
|
30
|
+
item.dependencies_satisfied? ? item.execute : item.configure_as_unsatisfied
|
33
31
|
end
|
34
32
|
end
|
35
33
|
|
@@ -65,6 +63,13 @@ module DependencyDetection
|
|
65
63
|
end
|
66
64
|
|
67
65
|
def configure_as_unsatisfied
|
66
|
+
# TODO: currently using :unsatisfied for Padrino will clobber the value
|
67
|
+
# already set for Sinatra, so skip Padrino and circle back with a
|
68
|
+
# new Padrino specific solution in the future.
|
69
|
+
#
|
70
|
+
# https://github.com/newrelic/newrelic-ruby-agent/issues/2912
|
71
|
+
return if name == :padrino
|
72
|
+
|
68
73
|
NewRelic::Agent.config.instance_variable_get(:@cache)[config_key] = :unsatisfied
|
69
74
|
end
|
70
75
|
|
@@ -139,8 +144,6 @@ module DependencyDetection
|
|
139
144
|
!(disabled_configured? || deprecated_disabled_configured?)
|
140
145
|
end
|
141
146
|
|
142
|
-
# TODO: MAJOR VERSION
|
143
|
-
# will only return true if a disabled key is found and is truthy
|
144
147
|
def deprecated_disabled_configured?
|
145
148
|
return false if self.name.nil?
|
146
149
|
|
@@ -148,12 +151,7 @@ module DependencyDetection
|
|
148
151
|
return false unless ::NewRelic::Agent.config[key] == true
|
149
152
|
|
150
153
|
::NewRelic::Agent.logger.debug("Not installing #{self.name} instrumentation because of configuration #{key}")
|
151
|
-
|
152
|
-
"[DEPRECATED] configuration #{key} for #{self.name} will be removed in the next major release. " \
|
153
|
-
"Use `#{config_key}` with one of `#{VALID_CONFIG_VALUES.map(&:to_s).inspect}`"
|
154
|
-
)
|
155
|
-
|
156
|
-
return true
|
154
|
+
true
|
157
155
|
end
|
158
156
|
|
159
157
|
def config_key
|
@@ -44,11 +44,7 @@ module NewRelic
|
|
44
44
|
####################################
|
45
45
|
report_on('Gems') do
|
46
46
|
begin
|
47
|
-
|
48
|
-
Bundler.rubygems.installed_specs.map { |gem| "#{gem.name}(#{gem.version})" }
|
49
|
-
else
|
50
|
-
Bundler.rubygems.all_specs.map { |gem| "#{gem.name}(#{gem.version})" }
|
51
|
-
end
|
47
|
+
NewRelic::Helper.rubygems_specs.map { |gem| "#{gem.name}(#{gem.version})" }
|
52
48
|
rescue
|
53
49
|
# There are certain rubygem, bundler, rails combinations (e.g. gem
|
54
50
|
# 1.6.2, rails 2.3, bundler 1.2.3) where the code above throws an error
|
data/lib/new_relic/helper.rb
CHANGED
@@ -82,5 +82,20 @@ module NewRelic
|
|
82
82
|
File.exist?(executable_path) && File.file?(executable_path) && File.executable?(executable_path)
|
83
83
|
end
|
84
84
|
end
|
85
|
+
|
86
|
+
# Bundler version 2.5.12 deprecated all_specs and added installed_specs.
|
87
|
+
# To support newer Bundler versions, try to use installed_specs first,
|
88
|
+
# then fall back to all_specs.
|
89
|
+
# All callers expect this to be an array, so return an array if Bundler isn't defined
|
90
|
+
# @api private
|
91
|
+
def rubygems_specs
|
92
|
+
return [] unless defined?(Bundler)
|
93
|
+
|
94
|
+
if Bundler.rubygems.respond_to?(:installed_specs)
|
95
|
+
Bundler.rubygems.installed_specs
|
96
|
+
else
|
97
|
+
Bundler.rubygems.all_specs
|
98
|
+
end
|
99
|
+
end
|
85
100
|
end
|
86
101
|
end
|
@@ -90,11 +90,7 @@ module NewRelic
|
|
90
90
|
def bundled_gem?(gem_name)
|
91
91
|
return false unless defined?(Bundler)
|
92
92
|
|
93
|
-
|
94
|
-
Bundler.rubygems.installed_specs.map(&:name).include?(gem_name)
|
95
|
-
else
|
96
|
-
Bundler.rubygems.all_specs.map(&:name).include?(gem_name)
|
97
|
-
end
|
93
|
+
NewRelic::Helper.rubygems_specs.map(&:name).include?(gem_name)
|
98
94
|
rescue => e
|
99
95
|
::NewRelic::Agent.logger.info("Could not determine if third party #{gem_name} gem is installed", e)
|
100
96
|
false
|
data/lib/new_relic/version.rb
CHANGED
@@ -79,7 +79,7 @@ module Sequel
|
|
79
79
|
|
80
80
|
THREAD_SAFE_CONNECTION_POOL_CLASSES = [
|
81
81
|
(defined?(::Sequel::ThreadedConnectionPool) && ::Sequel::ThreadedConnectionPool),
|
82
|
-
(defined?(::Sequel::TimedQueueConnectionPool) && RUBY_VERSION >= '3.
|
82
|
+
(defined?(::Sequel::TimedQueueConnectionPool) && RUBY_VERSION >= '3.2' && ::Sequel::TimedQueueConnectionPool)
|
83
83
|
].compact.freeze
|
84
84
|
|
85
85
|
def explainer_for(sql)
|
@@ -2,12 +2,8 @@
|
|
2
2
|
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
3
3
|
# frozen_string_literal: true
|
4
4
|
|
5
|
-
require_relative '<%= @snake_name.downcase %>/instrumentation'
|
6
|
-
require_relative '<%= @snake_name.downcase %>/chain'
|
7
|
-
require_relative '<%= @snake_name.downcase %>/prepend'
|
8
|
-
|
9
5
|
DependencyDetection.defer do
|
10
|
-
named :<%= @
|
6
|
+
named :<%= @snake_name %>
|
11
7
|
|
12
8
|
depends_on do
|
13
9
|
# The class that needs to be defined to prepend/chain onto. This can be used
|
@@ -18,11 +14,18 @@ DependencyDetection.defer do
|
|
18
14
|
end
|
19
15
|
|
20
16
|
executes do
|
21
|
-
|
17
|
+
require_relative '<%= @snake_name.downcase %>/instrumentation'
|
22
18
|
|
19
|
+
# prepend_instrument and chain_instrument call extract_supportability_name
|
20
|
+
# to get the library name for supportability metrics and info-level logging.
|
21
|
+
# This is done by spliting on the 2nd to last spot of the instrumented
|
22
|
+
# module. If this isn't how we want the name to appear, pass in the desired
|
23
|
+
# name as a third argument.
|
23
24
|
if use_prepend?
|
25
|
+
require_relative '<%= @snake_name.downcase %>/prepend'
|
24
26
|
prepend_instrument <%= @class_name %>, NewRelic::Agent::Instrumentation::<%= @class_name %>::Prepend
|
25
27
|
else
|
28
|
+
require_relative '<%= @snake_name.downcase %>/chain'
|
26
29
|
chain_instrument NewRelic::Agent::Instrumentation::<%= @class_name %>::Chain
|
27
30
|
end
|
28
31
|
end
|
data/newrelic.yml
CHANGED
@@ -65,9 +65,16 @@ common: &default_settings
|
|
65
65
|
# If true, the agent captures log records emitted by your application.
|
66
66
|
# application_logging.forwarding.enabled: true
|
67
67
|
|
68
|
+
# If true, the agent attaches labels to log records.
|
69
|
+
# application_logging.forwarding.labels.enabled: false
|
70
|
+
|
71
|
+
# A case-insensitive array or comma-delimited string containing the labels to
|
72
|
+
# exclude from log records.
|
73
|
+
# application_logging.forwarding.labels.exclude: []
|
74
|
+
|
68
75
|
# Sets the minimum level a log event must have to be forwarded to New Relic.
|
69
76
|
# This is based on the integer values of Ruby's Logger::Severity constants:
|
70
|
-
# https://github.com/ruby/
|
77
|
+
# https://github.com/ruby/logger/blob/113b82a06b3076b93a71cd467e1605b23afb3088/lib/logger/severity.rb
|
71
78
|
# The intention is to forward logs with the level given to the configuration, as
|
72
79
|
# well as any logs with a higher level of severity.
|
73
80
|
# For example, setting this value to "debug" will forward all log events to New
|
@@ -114,17 +121,15 @@ common: &default_settings
|
|
114
121
|
# audit_log.path: log/newrelic_audit.log
|
115
122
|
|
116
123
|
# An array of CLASS#METHOD (for instance methods) and/or CLASS.METHOD (for class
|
117
|
-
# methods) strings representing Ruby methods
|
118
|
-
# custom instrumentation to
|
119
|
-
# that defines the methods.
|
120
|
-
#
|
124
|
+
# methods) strings representing Ruby methods that the agent can automatically
|
125
|
+
# add custom instrumentation to. This doesn't require any modifications of the
|
126
|
+
# source code that defines the methods.
|
121
127
|
# Use fully qualified class names (using the :: delimiter) that include any
|
122
128
|
# module or class namespacing.
|
123
|
-
#
|
124
129
|
# Here is some Ruby source code that defines a render_png instance method for an
|
125
130
|
# Image class and a notify class method for a User class, both within a
|
126
131
|
# MyCompany module namespace:
|
127
|
-
#
|
132
|
+
#
|
128
133
|
# module MyCompany
|
129
134
|
# class Image
|
130
135
|
# def render_png
|
@@ -138,26 +143,29 @@ common: &default_settings
|
|
138
143
|
# end
|
139
144
|
# end
|
140
145
|
# end
|
141
|
-
#
|
146
|
+
#
|
142
147
|
# Given that source code, the newrelic.yml config file might request
|
143
148
|
# instrumentation for both of these methods like so:
|
144
|
-
#
|
149
|
+
#
|
145
150
|
# automatic_custom_instrumentation_method_list:
|
146
151
|
# - MyCompany::Image#render_png
|
147
152
|
# - MyCompany::User.notify
|
148
153
|
#
|
149
154
|
# That configuration example uses YAML array syntax to specify both methods.
|
150
|
-
# Alternatively, a comma-delimited string
|
151
|
-
#
|
152
|
-
# automatic_custom_instrumentation_method_list: 'MyCompany::Image#render_png,
|
153
|
-
#
|
155
|
+
# Alternatively, you can use a comma-delimited string:
|
156
|
+
#
|
157
|
+
# automatic_custom_instrumentation_method_list: 'MyCompany::Image#render_png,
|
158
|
+
# MyCompany::User.notify'
|
159
|
+
#
|
154
160
|
# Whitespace around the comma(s) in the list is optional. When configuring the
|
155
161
|
# agent with a list of methods via the
|
156
162
|
# NEW_RELIC_AUTOMATIC_CUSTOM_INSTRUMENTATION_METHOD_LIST environment variable,
|
157
|
-
# this comma-delimited string format
|
158
|
-
#
|
159
|
-
# export
|
160
|
-
#
|
163
|
+
# use this comma-delimited string format:
|
164
|
+
#
|
165
|
+
# export
|
166
|
+
# NEW_RELIC_AUTOMATIC_CUSTOM_INSTRUMENTATION_METHOD_LIST='MyCompany::Image#render_png,
|
167
|
+
# MyCompany::User.notify'
|
168
|
+
#
|
161
169
|
# automatic_custom_instrumentation_method_list: []
|
162
170
|
|
163
171
|
# Specify a list of constants that should prevent the agent from starting
|
@@ -197,9 +205,8 @@ common: &default_settings
|
|
197
205
|
# monitoring scripts. For now, auto-injection only works with Rails 5.2+.
|
198
206
|
# browser_monitoring.content_security_policy_nonce: true
|
199
207
|
|
200
|
-
# Manual override for the path to your local CA bundle. This CA bundle
|
201
|
-
#
|
202
|
-
# service.
|
208
|
+
# Manual override for the path to your local CA bundle. This CA bundle validates
|
209
|
+
# the SSL certificate presented by New Relic's data collection service.
|
203
210
|
# ca_bundle_path: nil
|
204
211
|
|
205
212
|
# Enable or disable the capture of memcache keys from transaction traces.
|
@@ -216,6 +223,9 @@ common: &default_settings
|
|
216
223
|
# If true, the agent will clear Tracer::State in Agent.drop_buffered_data.
|
217
224
|
# clear_transaction_state_after_fork: false
|
218
225
|
|
226
|
+
# The AWS account ID for the AWS account associated with this app
|
227
|
+
# cloud.aws.account_id: nil
|
228
|
+
|
219
229
|
# If true, the agent will report source code level metrics for traced methods.
|
220
230
|
# See:
|
221
231
|
# https://docs.newrelic.com/docs/apm/agents/ruby-agent/features/ruby-codestream-integration/
|
@@ -312,18 +322,6 @@ common: &default_settings
|
|
312
322
|
# If true, disables agent middleware for Sinatra. This middleware is responsible
|
313
323
|
# for advanced feature support such as cross application tracing, page load
|
314
324
|
# timing, and error collection.
|
315
|
-
# Cross application tracing is deprecated in favor of distributed tracing.
|
316
|
-
# Distributed tracing is on by default for Ruby agent versions 8.0.0 and above.
|
317
|
-
# Middlewares are not required to support distributed tracing.
|
318
|
-
# To continue using cross application tracing, update the following options in
|
319
|
-
# your newrelic.yml configuration file:
|
320
|
-
# ``yaml
|
321
|
-
# # newrelic.yml
|
322
|
-
# cross_application_tracer:
|
323
|
-
# enabled: true
|
324
|
-
# distributed_tracing:
|
325
|
-
# enabled: false
|
326
|
-
# ``
|
327
325
|
# disable_sinatra_auto_middleware: false
|
328
326
|
|
329
327
|
# If true, disables view instrumentation.
|
@@ -455,6 +453,18 @@ common: &default_settings
|
|
455
453
|
# prepend, chain, disabled.
|
456
454
|
# instrumentation.async_http: auto
|
457
455
|
|
456
|
+
# Controls auto-instrumentation of the aws-sdk-firehose library at start-up. May
|
457
|
+
# be one of auto, prepend, chain, disabled.
|
458
|
+
# instrumentation.aws_sdk_firehose: auto
|
459
|
+
|
460
|
+
# Controls auto-instrumentation of the aws-sdk-kinesis library at start-up. May
|
461
|
+
# be one of auto, prepend, chain, disabled.
|
462
|
+
# instrumentation.aws_sdk_kinesis: auto
|
463
|
+
|
464
|
+
# Controls auto-instrumentation of the aws_sdk_lambda library at start-up. May
|
465
|
+
# be one of auto, prepend, chain, disabled.
|
466
|
+
# instrumentation.aws_sdk_lambda: auto
|
467
|
+
|
458
468
|
# Controls auto-instrumentation of the aws-sdk-sqs library at start-up. May be
|
459
469
|
# one of: auto, prepend, chain, disabled.
|
460
470
|
# instrumentation.aws_sqs: auto
|
@@ -719,8 +729,8 @@ common: &default_settings
|
|
719
729
|
|
720
730
|
# If true, the agent will operate in a streamlined mode suitable for use with
|
721
731
|
# short-lived serverless functions. NOTE: Only AWS Lambda functions are
|
722
|
-
# supported currently and this option
|
723
|
-
#
|
732
|
+
# supported currently and this option isn't intended for use without New Relic's
|
733
|
+
# Ruby Lambda layer offering.
|
724
734
|
# serverless_mode.enabled: false
|
725
735
|
|
726
736
|
# An array of strings that will collectively serve as a denylist for filtering
|
@@ -791,7 +801,7 @@ common: &default_settings
|
|
791
801
|
# strip_exception_messages.allowed_classes: ""
|
792
802
|
|
793
803
|
# If true, the agent strips messages from all exceptions except those in the
|
794
|
-
#
|
804
|
+
# allowed classes list. Enabled automatically in high security mode.
|
795
805
|
# strip_exception_messages.enabled: false
|
796
806
|
|
797
807
|
# An array of strings to specify which keys and/or values inside a Stripe
|
@@ -799,17 +809,17 @@ common: &default_settings
|
|
799
809
|
# not be reported to New Relic. Each string in this array will be turned into a
|
800
810
|
# regular expression via
|
801
811
|
# Regexp.new to permit advanced matching. For each hash pair, if either the key
|
802
|
-
# or value is matched the
|
803
|
-
#
|
804
|
-
#
|
805
|
-
#
|
812
|
+
# or value is matched the pair
|
813
|
+
# isn't reported. By default, no user_data is reported. Use this option only if
|
814
|
+
# the
|
815
|
+
# stripe.user_data.include option is also used.
|
806
816
|
# stripe.user_data.exclude: []
|
807
817
|
|
808
818
|
# An array of strings to specify which keys inside a Stripe event's user_data
|
809
819
|
# hash should be reported
|
810
820
|
# to New Relic. Each string in this array will be turned into a regular
|
811
821
|
# expression via Regexp.new to
|
812
|
-
#
|
822
|
+
# enable advanced matching. Setting the value to ["."] will report all
|
813
823
|
# user_data.
|
814
824
|
# stripe.user_data.include: []
|
815
825
|
|
@@ -873,7 +883,7 @@ common: &default_settings
|
|
873
883
|
|
874
884
|
# If true, enables the collection of explain plans in transaction traces. This
|
875
885
|
# setting will also apply to explain plans in slow SQL traces if
|
876
|
-
# slow_sql.explain_enabled
|
886
|
+
# slow_sql.explain_enabled isn't set separately.
|
877
887
|
# transaction_tracer.explain_enabled: true
|
878
888
|
|
879
889
|
# Threshold (in seconds) above which the agent will collect explain plans.
|
@@ -947,33 +957,104 @@ common: &default_settings
|
|
947
957
|
# NOTE: All "security.*" configuration parameters are related only to the
|
948
958
|
# security agent, and all other configuration parameters that may
|
949
959
|
# have "security" in the name somewhere are related to the APM agent.
|
950
|
-
|
960
|
+
|
951
961
|
# If true, the security agent is loaded (a Ruby 'require' is performed)
|
952
962
|
# security.agent.enabled: false
|
953
963
|
|
954
964
|
# The port the application is listening on. This setting is mandatory for
|
955
|
-
# Passenger servers.
|
965
|
+
# Passenger servers. The agent detects other servers by default.
|
956
966
|
# security.application_info.port: nil
|
957
967
|
|
958
|
-
# If true,
|
959
|
-
# security.
|
968
|
+
# If true, the security agent is started (the agent runs in its event loop)
|
969
|
+
# security.enabled: false
|
960
970
|
|
961
|
-
#
|
962
|
-
#
|
971
|
+
# Defines API paths the security agent should ignore in IAST scans. Accepts an
|
972
|
+
# array of regex patterns matching the URI to ignore. The regex pattern should
|
973
|
+
# find a complete match for the URL without the endpoint. For example,
|
974
|
+
# [".*account.*"], [".*/\api\/v1\/.*?\/login"]
|
975
|
+
# security.exclude_from_iast_scan.api: []
|
963
976
|
|
964
|
-
#
|
965
|
-
#
|
977
|
+
# An array of HTTP request body keys the security agent should ignore in IAST
|
978
|
+
# scans.
|
979
|
+
# security.exclude_from_iast_scan.http_request_parameters.body: []
|
966
980
|
|
967
|
-
#
|
968
|
-
#
|
981
|
+
# An array of HTTP request headers the security agent should ignore in IAST
|
982
|
+
# scans. The array should specify a list of patterns matching the headers to
|
983
|
+
# ignore.
|
984
|
+
# security.exclude_from_iast_scan.http_request_parameters.header: []
|
985
|
+
|
986
|
+
# An array of HTTP request query parameters the security agent should ignore in
|
987
|
+
# IAST scans. The array should specify a list of patterns matching the HTTP
|
988
|
+
# request query parameters to ignore.
|
989
|
+
# security.exclude_from_iast_scan.http_request_parameters.query: []
|
990
|
+
|
991
|
+
# If true, disables system command injection detection in IAST scans.
|
992
|
+
# security.exclude_from_iast_scan.iast_detection_category.command_injection: false
|
993
|
+
|
994
|
+
# If true, disables the detection of low-severity insecure settings. For
|
995
|
+
# example, hash, crypto, cookie, random generators, trust boundary).
|
996
|
+
# security.exclude_from_iast_scan.iast_detection_category.insecure_settings: false
|
997
|
+
|
998
|
+
# If true, disables file operation-related IAST detections (File Access &
|
999
|
+
# Application integrity violation)
|
1000
|
+
# security.exclude_from_iast_scan.iast_detection_category.invalid_file_access: false
|
1001
|
+
|
1002
|
+
# If true, disables Javascript injection detection in IAST scans.
|
1003
|
+
# security.exclude_from_iast_scan.iast_detection_category.javascript_injection: false
|
1004
|
+
|
1005
|
+
# If true, disables LDAP injection detection in IAST scans.
|
1006
|
+
# security.exclude_from_iast_scan.iast_detection_category.ldap_injection: false
|
1007
|
+
|
1008
|
+
# If true, disables NOSQL injection detection in IAST scans.
|
1009
|
+
# security.exclude_from_iast_scan.iast_detection_category.nosql_injection: false
|
1010
|
+
|
1011
|
+
# If true, disables Reflected Cross-Site Scripting (RXSS) detection in IAST
|
1012
|
+
# scans.
|
1013
|
+
# security.exclude_from_iast_scan.iast_detection_category.rxss: false
|
1014
|
+
|
1015
|
+
# If true, disables SQL injection detection in IAST scans.
|
1016
|
+
# security.exclude_from_iast_scan.iast_detection_category.sql_injection: false
|
1017
|
+
|
1018
|
+
# If true, disables Sever-Side Request Forgery (SSRF) detection in IAST scans.
|
1019
|
+
# security.exclude_from_iast_scan.iast_detection_category.ssrf: false
|
1020
|
+
|
1021
|
+
# If true, disables XPATH injection detection in IAST scans.
|
1022
|
+
# security.exclude_from_iast_scan.iast_detection_category.xpath_injection: false
|
1023
|
+
|
1024
|
+
# A unique test identifier when runnning IAST in a CI/CD environment to
|
1025
|
+
# differentiate between different test runs. For example, a build number.
|
1026
|
+
# security.iast_test_identifier: nil
|
969
1027
|
|
970
1028
|
# Defines the mode for the security agent to operate in. Currently only IAST is
|
971
1029
|
# supported
|
972
1030
|
# security.mode: IAST
|
973
1031
|
|
974
|
-
#
|
975
|
-
# default value is
|
976
|
-
# security.
|
1032
|
+
# Sets the maximum number of HTTP requests allowed for the IAST scan per minute.
|
1033
|
+
# Any Integer between 12 and 3600 is valid. The default value is 3600.
|
1034
|
+
# security.scan_controllers.iast_scan_request_rate_limit: 3600
|
1035
|
+
|
1036
|
+
# If true, enables the sending of HTTP responses bodies. Disabling this also
|
1037
|
+
# disables Reflected Cross-Site Scripting (RXSS) vulnerability detection.
|
1038
|
+
# security.scan_controllers.report_http_response_body: true
|
1039
|
+
|
1040
|
+
# The number of application instances for a specific entity to perform IAST
|
1041
|
+
# analysis on.
|
1042
|
+
# security.scan_controllers.scan_instance_count: 0
|
1043
|
+
|
1044
|
+
# If true, allows IAST to continuously gather trace data in the background. The
|
1045
|
+
# security agent uses collected data to perform an IAST scan at the scheduled
|
1046
|
+
# time.
|
1047
|
+
# security.scan_schedule.always_sample_traces: false
|
1048
|
+
|
1049
|
+
# Specifies the delay time (in minutes) before the IAST scan begins after the
|
1050
|
+
# application starts.
|
1051
|
+
# security.scan_schedule.delay: 0
|
1052
|
+
|
1053
|
+
# Indicates the duration (in minutes) for which the IAST scan will be performed.
|
1054
|
+
# security.scan_schedule.duration: 0
|
1055
|
+
|
1056
|
+
# Specifies a cron expression that sets when the IAST scan should run.
|
1057
|
+
# security.scan_schedule.schedule: ""
|
977
1058
|
|
978
1059
|
# Defines the endpoint URL for posting security-related data
|
979
1060
|
# security.validator_service_url: wss://csec.nr-data.net
|
data/test/agent_helper.rb
CHANGED
@@ -112,7 +112,14 @@ def assert_log_contains(log, message)
|
|
112
112
|
lines = log.array
|
113
113
|
|
114
114
|
assert (lines.any? { |line| line.match(message) }),
|
115
|
-
"Could not find message. Log contained: #{lines.join("\n")}"
|
115
|
+
"Could not find message: '#{message.inspect}'. Log contained: #{lines.join("\n")}"
|
116
|
+
end
|
117
|
+
|
118
|
+
def refute_log_contains(log, message)
|
119
|
+
lines = log.array
|
120
|
+
|
121
|
+
refute (lines.any? { |line| line.match(message) }),
|
122
|
+
"Found message: '#{message.inspect}'. Log contained: #{lines.join("\n")}"
|
116
123
|
end
|
117
124
|
|
118
125
|
def assert_audit_log_contains(audit_log_contents, needle)
|
metadata
CHANGED
@@ -1,17 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: newrelic_rpm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.
|
4
|
+
version: 9.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tanna McClure
|
8
8
|
- Kayla Reopelle
|
9
9
|
- James Bunch
|
10
10
|
- Hannah Ramadan
|
11
|
-
autorequire:
|
12
11
|
bindir: bin
|
13
12
|
cert_chain: []
|
14
|
-
date:
|
13
|
+
date: 2025-01-29 00:00:00.000000000 Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
16
|
name: bundler
|
@@ -344,6 +343,7 @@ files:
|
|
344
343
|
- lib/new_relic/agent/external.rb
|
345
344
|
- lib/new_relic/agent/guid_generator.rb
|
346
345
|
- lib/new_relic/agent/harvester.rb
|
346
|
+
- lib/new_relic/agent/health_check.rb
|
347
347
|
- lib/new_relic/agent/heap.rb
|
348
348
|
- lib/new_relic/agent/hostname.rb
|
349
349
|
- lib/new_relic/agent/http_clients/abstract.rb
|
@@ -392,6 +392,18 @@ files:
|
|
392
392
|
- lib/new_relic/agent/instrumentation/async_http/chain.rb
|
393
393
|
- lib/new_relic/agent/instrumentation/async_http/instrumentation.rb
|
394
394
|
- lib/new_relic/agent/instrumentation/async_http/prepend.rb
|
395
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_firehose.rb
|
396
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_firehose/chain.rb
|
397
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_firehose/instrumentation.rb
|
398
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_firehose/prepend.rb
|
399
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_kinesis.rb
|
400
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_kinesis/chain.rb
|
401
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_kinesis/instrumentation.rb
|
402
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_kinesis/prepend.rb
|
403
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_lambda.rb
|
404
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_lambda/chain.rb
|
405
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_lambda/instrumentation.rb
|
406
|
+
- lib/new_relic/agent/instrumentation/aws_sdk_lambda/prepend.rb
|
395
407
|
- lib/new_relic/agent/instrumentation/aws_sqs.rb
|
396
408
|
- lib/new_relic/agent/instrumentation/aws_sqs/chain.rb
|
397
409
|
- lib/new_relic/agent/instrumentation/aws_sqs/instrumentation.rb
|
@@ -763,7 +775,6 @@ metadata:
|
|
763
775
|
documentation_uri: https://docs.newrelic.com/docs/agents/ruby-agent
|
764
776
|
source_code_uri: https://github.com/newrelic/newrelic-ruby-agent
|
765
777
|
homepage_uri: https://newrelic.com/ruby
|
766
|
-
post_install_message:
|
767
778
|
rdoc_options: []
|
768
779
|
require_paths:
|
769
780
|
- lib
|
@@ -778,8 +789,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
778
789
|
- !ruby/object:Gem::Version
|
779
790
|
version: 1.3.1
|
780
791
|
requirements: []
|
781
|
-
rubygems_version: 3.
|
782
|
-
signing_key:
|
792
|
+
rubygems_version: 3.6.2
|
783
793
|
specification_version: 4
|
784
794
|
summary: New Relic Ruby Agent
|
785
795
|
test_files: []
|