newrelic_rpm 8.0.0 → 8.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea3d77f1e8feb27c92b40dbd4d1732c5c068c786a99ab3f9cd76573ed6a201a1
4
- data.tar.gz: a825501f60da5aa176ac391cc4acd91192b57736f476b477eae29efec1ca7e53
3
+ metadata.gz: 8fab89acaea13ee0c348b26ff7d94118b358e9ac3ea6a48c4c231a1e0821d534
4
+ data.tar.gz: b434c14af26d097547b16601384c045a9b7b119261b17c58b2727b36ff05cf52
5
5
  SHA512:
6
- metadata.gz: 4019cf2596a500dd0b0ffb0c316d5f68bcef00ffd114a480045ad8e3cee708002211da40a3240f0db1b924be06b4656d0e2964818cbce4cc86427436684f0c22
7
- data.tar.gz: 8b0849f1c3c8ff8b770e83fb67dc77d5ccf0e3f4302c7d77359764c967bec4e2ee1064207a499e0a6a8acf17f25e60a07c974133ade3b14c4866af26ea306052
6
+ metadata.gz: 9c568e526ec679b12cc06e3a9ed40b592665774775baf016b9be0374bea32518529c82eef199bc6369ff394c84732b0b6d7e8919f63097eb39343cde30cbca26
7
+ data.tar.gz: dde7b7c0d46c2b918d5b97f9e08eadbb1a0f1bccfcd52454600fb7fa17ea4de450c856f99ab87f2d030694ede1779b8224f8ff4c757f4755b9bd3213c181ee97
data/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # New Relic Ruby Agent Release Notes #
2
2
 
3
+ ## v8.1.0
4
+
5
+ * **Instrumentation for Ruby standard library Logger**
6
+
7
+ The agent will now automatically instrument Logger, recording number of lines and size of logging output, with breakdown by severity.
8
+
9
+ * **Bugfix for Padrino instrumentation**
10
+
11
+ A bug was introduced to the way the agent installs padrino instrumentation in 7.0.0. This release fixes the issues with the padrino instrumentation. Thanks to @sriedel for bringing this issue to our attention.
12
+
13
+ * **Bugfix: Stop deadlocks between New Relic thread and Delayed Job sampling thread**
14
+
15
+ Running the agent's polling queries for the DelayedJobSampler within the same ActiveRecord connection decreases the frequency of deadlocks in development environments. Thanks @jdelStrother for bringing this to our attention and providing excellent sample code to speed up development!
16
+
17
+ * **Bugfix: Allow Net::HTTP request to IPv6 addresses**
18
+
19
+ The agent will no longer raise an `URI::InvalidURIError` error if an IPv6 address is passed to Net::HTTP. Thank you @tristinbarnett and @tabathadelane for crafting a solution!
20
+
21
+ * **Bugfix: Allow integers to be passed to error_collector.ignore_status_codes configuration**
22
+
23
+ Integers not wrapped in quotation marks can be passed to `error_collector.ignore_status_codes` in the `newrelic.yml` file. Our thanks goes to @elaguerta and @brammerl for resolving this issue!
24
+
25
+
3
26
  ## v8.0.0
4
27
 
5
28
  * **`add_method_tracer` refactored to use prepend over alias_method chaining**
data/README.md CHANGED
@@ -23,6 +23,8 @@ Environments" section below.
23
23
 
24
24
  ## Installing and Using
25
25
 
26
+ The latest released gem for the Ruby Agent can be found at [Rubygems.org](https://rubygems.org/gems/newrelic_rpm)
27
+
26
28
  ### Quick Start
27
29
 
28
30
  #### With Bundler
@@ -133,6 +135,6 @@ The New Relic Ruby agent also uses source code from third-party libraries. Full
133
135
 
134
136
  Thank you, and may your application scale to infinity plus one.
135
137
 
136
- Lew Cirne, Founder and CEO
138
+ Lew Cirne, Founder
137
139
 
138
140
  New Relic, Inc.
@@ -354,7 +354,7 @@ module NewRelic
354
354
  :entity_guid => {
355
355
  :default => nil,
356
356
  :allow_nil => true,
357
- :public => true,
357
+ :public => false,
358
358
  :type => String,
359
359
  :allowed_from_server => true,
360
360
  :description => 'The [Entity GUID](/attribute-dictionary/span/entityguid) for the entity running this agent.'
@@ -535,7 +535,7 @@ module NewRelic
535
535
  :type => Float,
536
536
  :allowed_from_server => true,
537
537
  :deprecated => true,
538
- :description => 'Deprecated. For agent versions 3.5.0 or higher, [set your Apdex T via the New Relic UI](/docs/apm/new-relic-apm/apdex/changing-your-apdex-settings).'
538
+ :description => 'For agent versions 3.5.0 or higher, [set your Apdex T via the New Relic UI](/docs/apm/new-relic-apm/apdex/changing-your-apdex-settings).'
539
539
  },
540
540
  :'strip_exception_messages.enabled' => {
541
541
  :default => value_of(:high_security),
@@ -999,6 +999,14 @@ module NewRelic
999
999
  :allowed_from_server => false,
1000
1000
  :description => 'Controls auto-instrumentation of dalli gem for Memcache at start up. May be one of [auto|prepend|chain|disabled].'
1001
1001
  },
1002
+ :'instrumentation.logger' => {
1003
+ :default => "auto",
1004
+ :public => true,
1005
+ :type => String,
1006
+ :dynamic_name => true,
1007
+ :allowed_from_server => false,
1008
+ :description => 'Controls auto-instrumentation of Ruby standard library Logger at start up. May be one of [auto|prepend|chain|disabled].'
1009
+ },
1002
1010
  :disable_data_mapper => {
1003
1011
  :default => false,
1004
1012
  :public => true,
@@ -1152,7 +1160,7 @@ module NewRelic
1152
1160
  :type => Boolean,
1153
1161
  :deprecated => true,
1154
1162
  :allowed_from_server => false,
1155
- :description => 'Deprecated; use [`transaction_tracer.attributes.enabled`](#transaction_tracer-attributes-enabled) instead.'
1163
+ :description => 'Use [`transaction_tracer.attributes.enabled`](#transaction_tracer-attributes-enabled) instead.'
1156
1164
  },
1157
1165
  :'transaction_tracer.explain_threshold' => {
1158
1166
  :default => 0.5,
@@ -1195,7 +1203,7 @@ module NewRelic
1195
1203
  :type => Boolean,
1196
1204
  :allowed_from_server => false,
1197
1205
  :deprecated => true,
1198
- :description => 'Deprecated; use [`disable_sequel_instrumentation`](#disable_sequel_instrumentation) instead.'
1206
+ :description => 'Use [`disable_sequel_instrumentation`](#disable_sequel_instrumentation) instead.'
1199
1207
  },
1200
1208
  :disable_mongo => {
1201
1209
  :default => false,
@@ -1291,7 +1299,7 @@ module NewRelic
1291
1299
  :type => Boolean,
1292
1300
  :deprecated => true,
1293
1301
  :allowed_from_server => false,
1294
- :description => 'Deprecated; use [`error_collector.attributes.enabled`](#error_collector-attributes-enabled) instead.'
1302
+ :description => 'Use [`error_collector.attributes.enabled`](#error_collector-attributes-enabled) instead.'
1295
1303
  },
1296
1304
  :'error_collector.ignore_errors' => {
1297
1305
  :default => 'ActionController::RoutingError,Sinatra::NotFound',
@@ -1299,7 +1307,7 @@ module NewRelic
1299
1307
  :type => String,
1300
1308
  :allowed_from_server => true,
1301
1309
  :dynamic_name => true,
1302
- :description => 'DEPRECATED; use `error_collector.ignore_classes` instead. Specify a comma-delimited list of error classes that the agent should ignore.'
1310
+ :description => 'Use `error_collector.ignore_classes` instead. Specify a comma-delimited list of error classes that the agent should ignore.'
1303
1311
  },
1304
1312
  :'error_collector.ignore_classes' => {
1305
1313
  :default => [],
@@ -1426,7 +1434,7 @@ module NewRelic
1426
1434
  :type => Boolean,
1427
1435
  :deprecated => true,
1428
1436
  :allowed_from_server => false,
1429
- :description => 'Deprecated; use [`browser_monitoring.attributes.enabled`](#browser_monitoring-attributes-enabled) instead.'
1437
+ :description => 'Use [`browser_monitoring.attributes.enabled`](#browser_monitoring-attributes-enabled) instead.'
1430
1438
  },
1431
1439
  :'browser_monitoring.loader' => {
1432
1440
  :default => DefaultSource.browser_monitoring_loader,
@@ -1554,7 +1562,7 @@ module NewRelic
1554
1562
  :type => Boolean,
1555
1563
  :deprecated => true,
1556
1564
  :allowed_from_server => false,
1557
- :description => 'Deprecated; use [`transaction_events.attributes.enabled`](#transaction_events-attributes-enabled) instead.'
1565
+ :description => 'Use [`transaction_events.attributes.enabled`](#transaction_events-attributes-enabled) instead.'
1558
1566
  },
1559
1567
  :restart_thread_in_children => {
1560
1568
  :default => true,
@@ -29,7 +29,8 @@ module NewRelic
29
29
  def load_from_config(setting, value = nil)
30
30
  errors = nil
31
31
  new_value = value || fetch_agent_config(setting.to_sym)
32
- return if new_value.nil? || new_value.empty?
32
+
33
+ return if new_value.nil? || (new_value.respond_to?(:empty?) && new_value.empty?)
33
34
 
34
35
  case setting.to_sym
35
36
  when :ignore_errors, :ignore_classes
@@ -50,7 +51,7 @@ module NewRelic
50
51
  end
51
52
 
52
53
  def ignore?(ex, status_code = nil)
53
- @ignore_classes.include?(ex.class.name) ||
54
+ @ignore_classes.include?(ex.class.name) ||
54
55
  (@ignore_messages.keys.include?(ex.class.name) &&
55
56
  @ignore_messages[ex.class.name].any? { |m| ex.message.include?(m) }) ||
56
57
  @ignore_status_codes.include?(status_code.to_i)
@@ -145,7 +146,14 @@ module NewRelic
145
146
  end
146
147
 
147
148
  def parse_status_codes(codes)
148
- code_list = codes.is_a?(String) ? codes.split(',') : codes
149
+ code_list = case codes
150
+ when String
151
+ codes.split(',')
152
+ when Integer
153
+ [codes]
154
+ else
155
+ codes
156
+ end
149
157
  result = []
150
158
  code_list.each do |code|
151
159
  result << code && next if code.is_a?(Integer)
@@ -4,6 +4,7 @@
4
4
  # frozen_string_literal: true
5
5
 
6
6
  require_relative 'abstract'
7
+ require 'resolv'
7
8
 
8
9
  module NewRelic
9
10
  module Agent
@@ -61,9 +62,14 @@ module NewRelic
61
62
  when /^https?:\/\//
62
63
  ::NewRelic::Agent::HTTPClients::URIUtil.parse_and_normalize_url(@request.path)
63
64
  else
65
+ connection_address = @connection.address
66
+ if (connection_address =~ Resolv::IPv6::Regex)
67
+ connection_address = "[#{connection_address}]"
68
+ end
69
+
64
70
  scheme = @connection.use_ssl? ? 'https' : 'http'
65
71
  ::NewRelic::Agent::HTTPClients::URIUtil.parse_and_normalize_url(
66
- "#{scheme}://#{@connection.address}:#{@connection.port}#{@request.path}"
72
+ "#{scheme}://#{connection_address}:#{@connection.port}#{@request.path}"
67
73
  )
68
74
  end
69
75
  end
@@ -16,10 +16,11 @@ module NewRelic
16
16
  when self.class.respond_to?(:default_name) then self.class.default_name
17
17
  end
18
18
  NewRelic::DelayedJobInjection.worker_name = worker_name
19
-
19
+
20
+ # TODO: Refactor the last line of this condition so that it can be evaluated in both prepend and chain instrumentation
20
21
  if defined?(::Delayed::Job) && ::Delayed::Job.method_defined?(:invoke_job) &&
21
- !(::Delayed::Job.method_defined?(:invoke_job_without_new_relic) )
22
-
22
+ !(::Delayed::Job.method_defined?(:invoke_job_without_new_relic))
23
+
23
24
  ::NewRelic::Agent.logger.info 'Installing DelayedJob instrumentation [part 2/2]'
24
25
  install_newrelic_job_tracer
25
26
  NewRelic::Control.instance.init_plugin :dispatcher => :delayed_job
@@ -27,7 +28,6 @@ module NewRelic
27
28
  NewRelic::Agent.logger.warn("Did not find a Delayed::Job class responding to invoke_job, aborting DJ instrumentation")
28
29
  end
29
30
  end
30
-
31
31
  end
32
32
 
33
33
  module DelayedJobTracer
@@ -0,0 +1,21 @@
1
+ # encoding: utf-8
2
+ # This file is distributed under New Relic's license terms.
3
+ # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
4
+
5
+ module NewRelic::Agent::Instrumentation
6
+ module Logger
7
+ def self.instrument!
8
+ ::Logger.class_eval do
9
+ include NewRelic::Agent::Instrumentation::Logger
10
+
11
+ alias_method :format_message_without_new_relic, :format_message
12
+
13
+ def format_message(severity, datetime, progname, msg)
14
+ format_message_with_tracing(severity, datetime, progname, msg) do
15
+ format_message_without_new_relic(severity, datetime, progname, msg)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,59 @@
1
+ # encoding: utf-8
2
+ # This file is distributed under New Relic's license terms.
3
+ # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
4
+
5
+ module NewRelic
6
+ module Agent
7
+ module Instrumentation
8
+ module Logger
9
+ def skip_instrumenting?
10
+ defined?(@skip_instrumenting) && @skip_instrumenting
11
+ end
12
+
13
+ def mark_skip_instrumenting
14
+ @skip_instrumenting = true
15
+ end
16
+
17
+ def clear_skip_instrumenting
18
+ @skip_instrumenting = false
19
+ end
20
+
21
+ LINES = "Logging/lines".freeze
22
+ SIZE = "Logging/size".freeze
23
+
24
+ def line_metric_name_by_severity(severity)
25
+ @line_metrics ||= {}
26
+ @line_metrics[severity] ||= "Logging/lines/#{severity}".freeze
27
+ end
28
+
29
+ def size_metric_name_by_severity(severity)
30
+ @size_metrics ||= {}
31
+ @size_metrics[severity] ||= "Logging/size/#{severity}".freeze
32
+ end
33
+
34
+
35
+ def format_message_with_tracing(severity, datetime, progname, msg)
36
+ formatted_message = yield
37
+ return formatted_message if skip_instrumenting?
38
+
39
+ begin
40
+ # It's critical we don't instrument logging from metric recording
41
+ # methods within NewRelic::Agent, or we'll stack overflow!!
42
+ mark_skip_instrumenting
43
+
44
+ NewRelic::Agent.increment_metric(LINES)
45
+ NewRelic::Agent.increment_metric(line_metric_name_by_severity(severity))
46
+
47
+ size = formatted_message.nil? ? 0 : formatted_message.bytesize
48
+ NewRelic::Agent.record_metric(SIZE, size)
49
+ NewRelic::Agent.record_metric(size_metric_name_by_severity(severity), size)
50
+
51
+ return formatted_message
52
+ ensure
53
+ clear_skip_instrumenting
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,13 @@
1
+ # encoding: utf-8
2
+ # This file is distributed under New Relic's license terms.
3
+ # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
4
+
5
+ module NewRelic::Agent::Instrumentation
6
+ module Logger::Prepend
7
+ include NewRelic::Agent::Instrumentation::Logger
8
+
9
+ def format_message(severity, datetime, progname, msg)
10
+ format_message_with_tracing(severity, datetime, progname, msg) { super }
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,25 @@
1
+ # encoding: utf-8
2
+ # This file is distributed under New Relic's license terms.
3
+ # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
4
+
5
+ require_relative 'logger/instrumentation'
6
+ require_relative 'logger/chain'
7
+ require_relative 'logger/prepend'
8
+
9
+ DependencyDetection.defer do
10
+ named :logger
11
+
12
+ depends_on { defined?(::Logger) }
13
+
14
+ executes do
15
+ ::NewRelic::Agent.logger.info "Installing Logger instrumentation"
16
+ end
17
+
18
+ executes do
19
+ if use_prepend?
20
+ prepend_instrument ::Logger, NewRelic::Agent::Instrumentation::Logger::Prepend
21
+ else
22
+ chain_instrument NewRelic::Agent::Instrumentation::Logger
23
+ end
24
+ end
25
+ end
@@ -2,30 +2,34 @@
2
2
  # This file is distributed under New Relic's license terms.
3
3
  # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
4
4
 
5
- module NewRelic::Agent::Instrumentation
6
- module Padrino
7
- module Chain
8
- def self.instrument!
9
- ::Padrino::Routing::InstanceMethods.module_eval do
10
- include NewRelic::Agent::Instrumentation::Sinatra
5
+ module NewRelic
6
+ module Agent
7
+ module Instrumentation
8
+ module PadrinoTracer
9
+ module Chain
10
+ def self.instrument!
11
+ ::Padrino::Routing::InstanceMethods.module_eval do
12
+ include NewRelic::Agent::Instrumentation::Sinatra
11
13
 
12
- def dispatch_with_newrelic
13
- dispatch_with_tracing { dispatch_without_newrelic }
14
- end
14
+ def dispatch_with_newrelic
15
+ dispatch_with_tracing { dispatch_without_newrelic }
16
+ end
15
17
 
16
- alias dispatch_without_newrelic dispatch!
17
- alias dispatch! dispatch_with_newrelic
18
+ alias dispatch_without_newrelic dispatch!
19
+ alias dispatch! dispatch_with_newrelic
18
20
 
19
- # Padrino 0.13 mustermann routing
20
- if private_method_defined?(:invoke_route)
21
- include NewRelic::Agent::Instrumentation::Padrino
21
+ # Padrino 0.13 mustermann routing
22
+ if private_method_defined?(:invoke_route)
23
+ include NewRelic::Agent::Instrumentation::Padrino
22
24
 
23
- def invoke_route_with_newrelic(*args, &block)
24
- invoke_route_with_tracing(*args) { invoke_route_without_newrelic(*args, &block) }
25
- end
25
+ def invoke_route_with_newrelic(*args, &block)
26
+ invoke_route_with_tracing(*args) { invoke_route_without_newrelic(*args, &block) }
27
+ end
26
28
 
27
- alias invoke_route_without_newrelic invoke_route
28
- alias invoke_route invoke_route_with_newrelic
29
+ alias invoke_route_without_newrelic invoke_route
30
+ alias invoke_route invoke_route_with_newrelic
31
+ end
32
+ end
29
33
  end
30
34
  end
31
35
  end
@@ -3,7 +3,7 @@
3
3
  # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
4
4
 
5
5
  module NewRelic::Agent::Instrumentation
6
- module Padrino
6
+ module PadrinoTracer
7
7
  module Prepend
8
8
  include NewRelic::Agent::Instrumentation::Sinatra
9
9
  include NewRelic::Agent::Instrumentation::Padrino
@@ -24,12 +24,14 @@ DependencyDetection.defer do
24
24
  executes do
25
25
  ::NewRelic::Agent.logger.info 'Installing Padrino instrumentation'
26
26
  if use_prepend?
27
- prepend_instrument ::Padrino::Routing::InstanceMethods, NewRelic::Agent::Instrumentation::Padrino::Prepend
27
+ prepend_instrument ::Padrino::Application, NewRelic::Agent::Instrumentation::PadrinoTracer::Prepend
28
28
  else
29
- chain_instrument NewRelic::Agent::Instrumentation::Padrino::Chain
29
+ chain_instrument NewRelic::Agent::Instrumentation::PadrinoTracer::Chain
30
30
  end
31
31
  end
32
32
  end
33
33
 
34
34
 
35
35
 
36
+
37
+
@@ -320,20 +320,25 @@ module NewRelic
320
320
 
321
321
  instance_exec(&code_header) if code_header.kind_of?(Proc)
322
322
 
323
+ # NOTE: Calling ::NewRelic::Agent::MethodTracer.trace_execution_scoped and
324
+ # .trace_execution_unscoped below relies on the fact that MethodTracer is included
325
+ # in Module on agent startup. If/when this changes, these methods should be
326
+ # explicitly namespaced and extended in MethodTracer.
327
+
323
328
  # If tracing multiple metrics on this method, nest one unscoped trace inside the scoped trace.
324
329
  begin
325
330
  if scoped_metric_eval
326
- self.class.trace_execution_scoped(scoped_metric_eval, metric: record_metrics, internal: true) do
331
+ ::NewRelic::Agent::MethodTracer.trace_execution_scoped(scoped_metric_eval, metric: record_metrics, internal: true) do
327
332
  if unscoped_metrics_eval.empty?
328
333
  super(*args, &block)
329
334
  else
330
- self.class.trace_execution_unscoped(unscoped_metrics_eval, internal: true) do
335
+ ::NewRelic::Agent::MethodTracer.trace_execution_unscoped(unscoped_metrics_eval, internal: true) do
331
336
  super(*args, &block)
332
337
  end
333
338
  end
334
339
  end
335
340
  elsif !unscoped_metrics_eval.empty?
336
- self.class.trace_execution_unscoped(unscoped_metrics_eval, internal: true) do
341
+ ::NewRelic::Agent::MethodTracer.trace_execution_unscoped(unscoped_metrics_eval, internal: true) do
337
342
  super(*args, &block)
338
343
  end
339
344
  end
@@ -426,28 +426,21 @@ module NewRelic
426
426
  size = data.size
427
427
 
428
428
  # Preconnect needs to always use the configured collector host, not the redirect host
429
- # endpoint_specific_collector = (method == :preconnect) ? @configured_collector : @collector
430
-
431
- # This is a temporary workaround due to errors occurring on the staging collector. The prod collector does not have the same issue.
432
- # The staging collector does not respond correctly when using the configured collector host for preconnect, so must use the redirect host
433
- # Once this issue is resolved on the staging collector, use the original line that is commented out above.
434
- endpoint_specific_collector = if method == :preconnect && (@configured_collector && @configured_collector.name != 'staging-collector.newrelic.com')
435
- ::NewRelic::Agent.logger.debug "Using configured collector for preconnect: #{@configured_collector}"
436
- @configured_collector
437
- else
438
- ::NewRelic::Agent.logger.debug "Using redirect host for collector: #{@collector}"
439
- @collector
440
- end
429
+ # We reset it here so we are always using the configured collector during our creation of the new connection
430
+ # and we also don't want to keep the previous redirect host around anymore
431
+ if method == :preconnect
432
+ @collector = @configured_collector
433
+ end
441
434
 
442
435
  uri = remote_method_uri(method)
443
- full_uri = "#{endpoint_specific_collector}#{uri}"
436
+ full_uri = "#{@collector}#{uri}"
444
437
 
445
438
  @audit_logger.log_request(full_uri, payload, @marshaller)
446
439
  request_send_ts = Process.clock_gettime(Process::CLOCK_MONOTONIC)
447
440
  response = send_request(:data => data,
448
441
  :uri => uri,
449
442
  :encoding => encoding,
450
- :collector => endpoint_specific_collector,
443
+ :collector => @collector,
451
444
  :endpoint => method)
452
445
  response_check_ts = Process.clock_gettime(Process::CLOCK_MONOTONIC)
453
446
  @marshaller.load(decompress_response(response))
@@ -62,9 +62,12 @@ module NewRelic
62
62
  end
63
63
 
64
64
  def poll
65
- record_failed_jobs(failed_jobs)
66
- record_locked_jobs(locked_jobs)
67
- record_queue_length_metrics
65
+ # Wrapping these queries within the same connection avoids deadlocks
66
+ ActiveRecord::Base.connection_pool.with_connection do
67
+ record_failed_jobs(failed_jobs)
68
+ record_locked_jobs(locked_jobs)
69
+ record_queue_length_metrics
70
+ end
68
71
  end
69
72
 
70
73
  private
@@ -97,11 +100,11 @@ module NewRelic
97
100
  # here that's valid on 2.x through 4.1, so split it up.
98
101
  result = if ::ActiveRecord::VERSION::MAJOR.to_i < 4
99
102
  ::Delayed::Job.count(:group => column_name,
100
- :conditions => [QUEUE_QUERY_CONDITION, now])
103
+ :conditions => [QUEUE_QUERY_CONDITION, now])
101
104
  else
102
105
  ::Delayed::Job.where(QUEUE_QUERY_CONDITION, now).
103
- group(column_name).
104
- count
106
+ group(column_name).
107
+ count
105
108
  end
106
109
  result.to_a
107
110
  end
@@ -11,7 +11,7 @@ module NewRelic
11
11
  end
12
12
 
13
13
  MAJOR = 8
14
- MINOR = 0
14
+ MINOR = 1
15
15
  TINY = 0
16
16
 
17
17
  begin
data/newrelic.yml CHANGED
@@ -211,9 +211,6 @@ common: &default_settings
211
211
  # With distributed tracing data, you can quickly pinpoint failures or performance issues and fix them.
212
212
  # distributed_tracing.enabled: true
213
213
 
214
- # The Entity GUID for the entity that is running this agent.
215
- # entity_guid: nil
216
-
217
214
  # If true, the agent captures attributes from error collection.
218
215
  # error_collector.attributes.enabled: false
219
216
 
@@ -334,6 +331,10 @@ common: &default_settings
334
331
  # May be one of [auto|prepend|chain|disabled].
335
332
  # instrumentation.httprb: auto
336
333
 
334
+ # Controls auto-instrumentation of the Ruby standard library Logger.rb.
335
+ # May be one of [auto|prepend|chain|disabled].
336
+ # instrumentation.logger: auto
337
+
337
338
  # Controls auto-instrumentation of memcache-client gem for Memcache at start up.
338
339
  # May be one of [auto|prepend|chain|disabled].
339
340
  # instrumentation.memcache_client: auto
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic_rpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.0
4
+ version: 8.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Huntsman
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-09-22 00:00:00.000000000 Z
13
+ date: 2021-10-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
@@ -338,6 +338,10 @@ files:
338
338
  - lib/new_relic/agent/instrumentation/httprb/instrumentation.rb
339
339
  - lib/new_relic/agent/instrumentation/httprb/prepend.rb
340
340
  - lib/new_relic/agent/instrumentation/ignore_actions.rb
341
+ - lib/new_relic/agent/instrumentation/logger.rb
342
+ - lib/new_relic/agent/instrumentation/logger/chain.rb
343
+ - lib/new_relic/agent/instrumentation/logger/instrumentation.rb
344
+ - lib/new_relic/agent/instrumentation/logger/prepend.rb
341
345
  - lib/new_relic/agent/instrumentation/memcache.rb
342
346
  - lib/new_relic/agent/instrumentation/memcache/chain.rb
343
347
  - lib/new_relic/agent/instrumentation/memcache/dalli.rb
@@ -444,7 +448,6 @@ files:
444
448
  - lib/new_relic/agent/stats_engine.rb
445
449
  - lib/new_relic/agent/stats_engine/gc_profiler.rb
446
450
  - lib/new_relic/agent/stats_engine/stats_hash.rb
447
- - lib/new_relic/agent/supported_versions.rb
448
451
  - lib/new_relic/agent/synthetics_event_aggregator.rb
449
452
  - lib/new_relic/agent/system_info.rb
450
453
  - lib/new_relic/agent/threading/agent_thread.rb
@@ -1,275 +0,0 @@
1
- # encoding: utf-8
2
- # This file is distributed under New Relic's license terms.
3
- # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
4
-
5
- module NewRelic
6
- module Agent
7
- SUPPORTED_VERSIONS =
8
- {
9
- # Rubies
10
- :mri =>
11
- {
12
- :type => :ruby,
13
- :name => "MRI",
14
- :supported => ["2.0.0", "~>2.1.0", "~>2.2.0", "~>2.3.0", "~>2.4.0", "~>2.5.0", "~>2.6.0", "~>2.7.0"],
15
- :deprecated => ["1.8.6", "1.8.7", "1.9.2", "1.9.3"],
16
- :url => "https://www.ruby-lang.org",
17
- :feed => "https://www.ruby-lang.org/en/feeds/news.rss",
18
- :notes => ["Last supported agent for 1.8.7, 1.9.2, and 1.9.3 was 3.18.1.330.",
19
- "Last supported agent on 1.8.6 was 3.6.8.168."]
20
- },
21
- :jruby =>
22
- {
23
- :type => :ruby,
24
- :name => "JRuby",
25
- :supported => ["~>9.0", "~>9.1"],
26
- :deprecated => ["~>1.7.0"],
27
- :url => "http://jruby.org",
28
- :feed => "http://jruby.org/atom.xml",
29
- :notes => ["Last supported agent for ~>1.7.0 was 3.18.1.330."]
30
- },
31
-
32
- # App servers
33
- :passenger =>
34
- {
35
- :type => :app_server,
36
- :supported => ["~>2.2", "~>3.0", "~>4.0"],
37
- :url => "http://www.phusionpassenger.com/",
38
- :feed => "http://rubygems.org/gems/passenger/versions.atom"
39
- },
40
- :thin =>
41
- {
42
- :type => :app_server,
43
- :supported => ["~>1.0"],
44
- :url => "http://code.macournoyer.com/thin/",
45
- :feed => "http://rubygems.org/gems/thin/versions.atom"
46
- },
47
- :unicorn =>
48
- {
49
- :type => :app_server,
50
- :supported => ["~>4.0"],
51
- :deprecated => ["~>1.0", "~>2.0", "~>3.0"],
52
- :url => "http://unicorn.bogomips.org/",
53
- :feed => "http://rubygems.org/gems/unicorn/versions.atom"
54
- },
55
- :puma =>
56
- {
57
- :type => :app_server,
58
- :supported => ["~>2.0"],
59
- :deprecated => ["~>1.0"],
60
- :url => "http://puma.io/",
61
- :feed => "http://rubygems.org/gems/puma/versions.atom"
62
- },
63
- :rainbows =>
64
- {
65
- :type => :app_server,
66
- :name => "rainbows!",
67
- :experimental=> ["4.5.0"],
68
- :url => "http://rainbows.rubyforge.org/",
69
- :feed => "http://rubygems.org/gems/rainbows/versions.atom"
70
- },
71
- :webrick =>
72
- {
73
- :type => :app_server,
74
- :notes => [ "Supported for all agent-supported versions of Ruby" ]
75
- },
76
-
77
- # Web frameworks
78
- :rails =>
79
- {
80
- :type => :web,
81
- :supported => ["~3.0.0", "~>3.1.0", "~>3.2.0", "~>4.0.0", "~>4.1.0", "~>4.2.0", "~>5.0.0", "~>5.1.0"],
82
- :deprecated => ["~>2.0.0", "~>2.1.0", "~>2.2.0", "~>2.3.0"],
83
- :url => "https://rubygems.org/gems/rails",
84
- :feed => "https://rubygems.org/gems/rails/versions.atom",
85
- :notes => ["Last supported agent for ~>2.1.0, ~>2.2.0, and ~>2.3.0 was 3.18.1.330.",
86
- "Last supported agent for 2.0.x was 3.6.8.168."]
87
- },
88
- :sinatra =>
89
- {
90
- :type => :web,
91
- :supported => ["~>1.2.0", "~>1.3.0", "~>1.4.0", "~>2.0.0"],
92
- :url => "https://rubygems.org/gems/sinatra",
93
- :feed => "https://rubygems.org/gems/sinatra/versions.atom"
94
- },
95
- :padrino =>
96
- {
97
- :type => :web,
98
- :supported => ["~>0.10"],
99
- :url => "https://rubygems.org/gems/padrino",
100
- :feed => "https://rubygems.org/gems/padrino/versions.atom"
101
- },
102
- :rack =>
103
- {
104
- :type => :web,
105
- :supported => [">= 1.1.0"],
106
- :deprecated => ["~>1.0.0"],
107
- :url => "https://rubygems.org/gems/rack",
108
- :feed => "https://rubygems.org/gems/rack/versions.atom"
109
- },
110
- :grape =>
111
- {
112
- :type => :web,
113
- :supported => [">= 0.2.0"],
114
- :url => "https://rubygems.org/gems/grape",
115
- :feed => "https://rubygems.org/gems/grape/versions.atom"
116
- },
117
-
118
- # Database
119
- :activerecord =>
120
- {
121
- :type => :database,
122
- :supported => ["~>3.0.0", "~>3.1.0", "~>3.2.0", "~>4.0.0", "~>4.1.0", "~>4.2.0", "~>5.0.0", "~>5.1.0", "~>6.0.0"],
123
- :deprecated => ["~>2.0.0", "~>2.1.0", "~>2.2.0", "~>2.3.0",],
124
- :url => "https://rubygems.org/gems/activerecord",
125
- :feed => "https://rubygems.org/gems/activerecord/versions.atom",
126
- :notes => ["Last supported agent for ~>2.1.0, ~>2.2.0, and ~>2.3.0 was 3.18.1.330.",
127
- "Last supported agent for 2.0.x was 3.6.8.168."]
128
- },
129
- :datamapper =>
130
- {
131
- :type => :database,
132
- :supported => ["~>1.0"],
133
- :url => "https://rubygems.org/gems/datamapper",
134
- :feed => "https://rubygems.org/gems/datamapper/versions.atom"
135
- },
136
- :sequel =>
137
- {
138
- :type => :database,
139
- :supported => ["~>3.37", "~>4.0"],
140
- :url => "https://rubygems.org/gems/sequel",
141
- :feed => "https://rubygems.org/gems/sequel/versions.atom"
142
- },
143
- :mongo =>
144
- {
145
- :type => :database,
146
- :supported => ["~>1.8", "~>2.1"],
147
- :url => "https://rubygems.org/gems/mongo",
148
- :feed => "https://rubygems.org/gems/mongo/versions.atom"
149
- },
150
- :redis =>
151
- {
152
- :type => :database,
153
- :supported => ["~>3.0"],
154
- :url => "https://rubygems.org/gems/redis",
155
- :feed => "https://rubygems.org/gems/redis/versions.atom"
156
- },
157
-
158
- # Background Jobs
159
- :rake =>
160
- {
161
- :type => :background,
162
- :supported => ["~>10.0"],
163
- :url => "https://rubygems.org/gems/rake",
164
- :feed => "https://rubygems.org/gems/rake/versions.atom"
165
- },
166
- :resque =>
167
- {
168
- :type => :background,
169
- :supported => ["~>1.23.0"],
170
- :deprecated => ["~>1.22.0"],
171
- :experimental=> [">= 2.0"],
172
- :url => "https://rubygems.org/gems/resque",
173
- :feed => "https://rubygems.org/gems/resque/versions.atom"
174
- },
175
- :sidekiq =>
176
- {
177
- :type => :background,
178
- :supported => ["~>2.8", "~>3.4.2", "~>4.0"],
179
- :url => "https://rubygems.org/gems/sidekiq",
180
- :feed => "https://rubygems.org/gems/sidekiq/versions.atom"
181
- },
182
- :delayed_job =>
183
- {
184
- :type => :background,
185
- :supported => ["~>2.0", "~>3.0", "~>4.0"],
186
- :url => "https://rubygems.org/gems/delayed_job",
187
- :feed => "https://rubygems.org/gems/delayed_job/versions.atom"
188
- },
189
-
190
- # HTTP Clients
191
- :curb =>
192
- {
193
- :type => :http,
194
- :supported => [ ">= 0.8.1" ],
195
- :url => "https://rubygems.org/gems/curb",
196
- :feed => "https://rubygems.org/gems/curb/versions.atom"
197
- },
198
- :excon =>
199
- {
200
- :type => :http,
201
- :supported => [ ">= 0.19.0" ],
202
- :url => "https://rubygems.org/gems/excon",
203
- :feed => "https://rubygems.org/gems/excon/versions.atom"
204
- },
205
- :httpclient =>
206
- {
207
- :type => :http,
208
- :supported => [ ">= 2.2.0"],
209
- :url => "https://rubygems.org/gems/httpclient",
210
- :feed => "https://rubygems.org/gems/httpclient/versions.atom"
211
- },
212
- :typhoeus =>
213
- {
214
- :type => :http,
215
- :supported => [ ">= 0.5.3"],
216
- :url => "https://rubygems.org/gems/typhoeus",
217
- :feed => "https://rubygems.org/gems/typhoeus/versions.atom"
218
- },
219
- :net_http =>
220
- {
221
- :type => :http,
222
- :name => "Net::HTTP",
223
- :notes => [
224
- "Supported for all agent-supported versions of Ruby.",
225
- "For more information on supported HTTP clients see http://docs.newrelic.com/docs/ruby/ruby-http-clients."]
226
- },
227
- :httprb =>
228
- {
229
- :type => :http,
230
- :supported => [ ">= 0.9.9"],
231
- :url => "https://rubygems.org/gems/http",
232
- :feed => "https://rubygems.org/gems/http/versions.atom"
233
- },
234
-
235
- # Other
236
- :sunspot =>
237
- {
238
- :type => :other,
239
- :url => "https://rubygems.org/gems/sunspot",
240
- :feed => "https://rubygems.org/gems/sunspot/versions.atom"
241
- },
242
- :acts_as_solr =>
243
- {
244
- :type => :other,
245
- :url => "https://rubygems.org/gems/acts_as_solr",
246
- :feed => "https://rubygems.org/gems/acts_as_solr/versions.atom"
247
- },
248
- :dalli =>
249
- {
250
- :type => :other,
251
- :url => "https://rubygems.org/gems/dalli",
252
- :feed => "https://rubygems.org/gems/dalli/versions.atom"
253
- },
254
- :'memcache-client' =>
255
- {
256
- :type => :other,
257
- :url => "https://rubygems.org/gems/memcache-client",
258
- :feed => "https://rubygems.org/gems/memcache-client/versions.atom"
259
- },
260
- :authlogic =>
261
- {
262
- :type => :other,
263
- :url => "https://rubygems.org/gems/authlogic",
264
- :feed => "https://rubygems.org/gems/authlogic/versions.atom"
265
- },
266
- :activemerchant =>
267
- {
268
- :type => :other,
269
- :supported => [ ">= 1.25.0"],
270
- :url => "https://rubygems.org/gems/activemerchant",
271
- :feed => "https://rubygems.org/gems/activemerchant/versions.atom"
272
- },
273
- }
274
- end
275
- end