newrelic_rpm 9.10.0 → 9.10.1

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: d3793bb498826b000ad9e00e7d57de0e95988c4ba213e341a6a8c18f90df772e
4
- data.tar.gz: 6cb26b15c2faace4a7e1fd6775a3f69f965beaad10f395e0fb618cb411dbacfe
3
+ metadata.gz: 8660cb164e8b97c18397b4413d5b2ccb582c8cb377599f77b89d15920d3eb568
4
+ data.tar.gz: 81e5a8617f26c196f72f57b8dbb536acafb199325af6c56676190fb7a12acfc8
5
5
  SHA512:
6
- metadata.gz: acb8dd0c767f40796fa1afb9cc26c0a57a9bdd83a4cbf550589a094f5cf48da32caf1d4c0f10e154633b754086bd62aa17d393bffa37eee5a0128e72c3bd6160
7
- data.tar.gz: 6ce06fe8f1506405b7696089bf366e1aa0ccd60ab0d5034b22db87ac3c4523bd9d8d4dc4a6b568515cd516cd5c64babf853cdfed4af1839fd45cbed0450994f5
6
+ metadata.gz: 7f6aef929dcdaef485265ef0055466292a511fcb71af6720947b5fc1599f6518aca4e11b43a553df65c20c61b73cd59e8e6fbdd53683222f875c88dba5cc942b
7
+ data.tar.gz: 293dcf0e5a6865e1aed9bf0f913c14cbda26251aa2141f1a5dd3a096804239496889a413b2f2d21c0009552913fc42f7a8bd52c85aa76fdf4be1b546a219f527
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # New Relic Ruby Agent Release Notes
2
2
 
3
+ ## v9.10.1
4
+
5
+ - **Bugfix: Incompatibility with Bootstrap**
6
+
7
+ Version 9.10.1 fixes an incompatibility between the agent and the [Bootstrap](https://github.com/twbs/bootstrap-rubygem) gem caused by agent v9.10.0's introduction of a `lib/bootstrap.rb` file. Thank you to [@dorner](https://github.com/dorner) for reporting the bug and identifying the 'bootstrap' name collision as the root cause. [BUG#2675](https://github.com/newrelic/newrelic-ruby-agent/issues/2675) [PR#2676](https://github.com/newrelic/newrelic-ruby-agent/pull/2676)
8
+
3
9
  ## v9.10.0
4
10
 
5
11
  Version 9.10.0 introduces instrumentation for DynamoDB, adds a new feature to automatically apply nonces from the Rails content security policy, fixes a bug that would cause an expected error to negatively impact a transaction's Apdex, and fixes the agent's autostart logic so that by default `rails runner` and `rails db` commands will not cause the agent to start.
@@ -27,7 +27,7 @@
27
27
  # - Next, use the "RUBYOPT" environment variable to require ("-r") this
28
28
  # file (note that the ".rb" extension is dropped):
29
29
  # ```
30
- # export RUBYOPT="-r /newrelic/lib/bootstrap"
30
+ # export RUBYOPT="-r /newrelic/lib/boot/strap"
31
31
  # ```
32
32
  # - Add your New Relic license key as an environment variable.
33
33
  # ```
@@ -50,7 +50,7 @@ module NRBundlerPatch
50
50
  end
51
51
 
52
52
  def require_newrelic
53
- lib = File.dirname(__FILE__)
53
+ lib = File.expand_path('../..', __FILE__)
54
54
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
55
55
  Kernel.require NR_AGENT_GEM
56
56
  end
@@ -65,40 +65,36 @@ class NRBundlerPatcher
65
65
  check_for_rubyopt
66
66
  check_for_bundler
67
67
  Bundler::Runtime.prepend(NRBundlerPatch)
68
+ rescue StandardError => e
69
+ Kernel.warn "New Relic entrypoint at #{__FILE__} encountered an issue:\n #{e.message}"
68
70
  end
69
71
 
70
72
  private
71
73
 
72
74
  def self.check_for_require
73
- warn_and_exit "#{__FILE__} is meant to be required, not invoked directly" if $PROGRAM_NAME == __FILE__
75
+ raise "#{__FILE__} is meant to be required, not invoked directly" if $PROGRAM_NAME == __FILE__
74
76
  end
75
77
 
76
78
  def self.check_for_rubyopt
77
79
  unless ENV[RUBYOPT].to_s.match?("-r #{__FILE__.rpartition('.').first}")
78
- warn_and_exit "#{__FILE__} is meant to be required via the RUBYOPT env var"
80
+ raise "#{__FILE__} is meant to be required via the RUBYOPT env var"
79
81
  end
80
82
  end
81
83
 
82
84
  def self.check_for_bundler
83
85
  require_bundler
84
86
 
85
- warn_and_exit 'Required Ruby Bundler class Bundler::Runtime not defined!' unless defined?(Bundler::Runtime)
87
+ raise 'Required Ruby Bundler class Bundler::Runtime not defined!' unless defined?(Bundler::Runtime)
86
88
 
87
89
  unless Bundler::Runtime.method_defined?(:require)
88
- warn_and_exit "The active Ruby Bundler instance doesn't offer Bundler::Runtime#require"
90
+ raise "The active Ruby Bundler instance doesn't offer Bundler::Runtime#require"
89
91
  end
90
92
  end
91
93
 
92
94
  def self.require_bundler
93
95
  require BUNDLER
94
96
  rescue LoadError => e
95
- warn_and_exit "Required Ruby library '#{BUNDLER}' could not be required - #{e}"
96
- end
97
-
98
- def self.warn_and_exit(msg)
99
- warn "New Relic entrypoint at #{__FILE__} encountered an issue:\n\t#{msg}"
100
-
101
- exit 1
97
+ raise "Required Ruby library '#{BUNDLER}' could not be required - #{e}"
102
98
  end
103
99
  end
104
100
 
@@ -782,7 +782,7 @@ module NewRelic
782
782
  # CSP nonce
783
783
  :'browser_monitoring.content_security_policy_nonce' => {
784
784
  :default => value_of(:'rum.enabled'),
785
- :documentation_default => false,
785
+ :documentation_default => true,
786
786
  :public => true,
787
787
  :type => Boolean,
788
788
  :allowed_from_server => false,
@@ -8,6 +8,54 @@ module NewRelic::Agent::Instrumentation
8
8
  module Elasticsearch
9
9
  PRODUCT_NAME = 'Elasticsearch'
10
10
  OPERATION = 'perform_request'
11
+
12
+ # Pattern to use with client caller location strings. Look for a location
13
+ # that contains '/lib/elasticsearch/api/' and is NOT followed by the
14
+ # string held in the OPERATION constant
15
+ OPERATION_PATTERN = %r{/lib/elasticsearch/api/(?!.+#{OPERATION})}.freeze
16
+
17
+ # Use the OPERATION_PATTERN pattern to find the appropriate caller location
18
+ # that will contain the client instance method (example: 'search') and
19
+ # return that method name.
20
+ #
21
+ # A Ruby caller location matching the OPERATION_PATTERN will contain an
22
+ # elasticsearch client instance method name (such as "search"), and that
23
+ # method name will be used as the operation name.
24
+ #
25
+ # With Ruby < 3.4 the method name is listed as:
26
+ #
27
+ # `search'
28
+ #
29
+ # with an opening backtick and a closing single tick. And only the
30
+ # method name itself is listed.
31
+ #
32
+ # With Ruby 3.4+ the method name is listed as:
33
+ #
34
+ # 'Elasticsearch::API::Actions#search'
35
+ #
36
+ # with opening and closing single ticks and the class defining the
37
+ # instance method listed.
38
+ #
39
+ # (?:) = ?: prevents capturing
40
+ # (?:`|') = allow ` or '
41
+ # (?:.+#) = allow the class name and '#' prefix to exist but ignore it
42
+ # ([^']+)' = after the opening ` or ', capturing everything up to the
43
+ # closing '. [^']+ = one or more characters that are not '
44
+ #
45
+ # Example Ruby 3.3.1 input:
46
+ #
47
+ # /Users/fallwith/.rubies/ruby-3.3.1/lib/ruby/gems/3.3.0/gems/elasticsearch-api-7.17.10/lib/elasticsearch/api/actions/index.rb:74:in `index'
48
+ #
49
+ # Example Ruby 3.4.0-preview1 input:
50
+ #
51
+ # /Users/fallwith/.rubies/ruby-3.4.0-preview1/lib/ruby/gems/3.4.0+0/gems/elasticsearch-api-7.17.10/lib/elasticsearch/api/actions/index.rb:74:in 'Elasticsearch::API::Actions#index'
52
+ #
53
+ # Example output for both Rubies:
54
+ #
55
+ # index
56
+
57
+ INSTANCE_METHOD_PATTERN = /:in (?:`|')(?:.+#)?([^']+)'\z/.freeze
58
+
11
59
  INSTRUMENTATION_NAME = NewRelic::Agent.base_name(name)
12
60
 
13
61
  # We need the positional arguments `params` and `body`
@@ -40,13 +88,10 @@ module NewRelic::Agent::Instrumentation
40
88
  private
41
89
 
42
90
  def nr_operation
43
- operation_index = caller_locations.index do |line|
44
- string = line.to_s
45
- string.include?('lib/elasticsearch/api') && !string.include?(OPERATION)
46
- end
47
- return nil unless operation_index
91
+ location = caller_locations.detect { |loc| loc.to_s.match?(OPERATION_PATTERN) }
92
+ return unless location && location.to_s =~ INSTANCE_METHOD_PATTERN
48
93
 
49
- caller_locations[operation_index].to_s.split('`')[-1].gsub(/\W/, '')
94
+ Regexp.last_match(1)
50
95
  end
51
96
 
52
97
  def nr_reported_query(query)
@@ -7,7 +7,7 @@ module NewRelic
7
7
  module VERSION # :nodoc:
8
8
  MAJOR = 9
9
9
  MINOR = 10
10
- TINY = 0
10
+ TINY = 1
11
11
 
12
12
  STRING = "#{MAJOR}.#{MINOR}.#{TINY}"
13
13
  end
@@ -78,8 +78,9 @@ module Sequel
78
78
  end
79
79
 
80
80
  THREAD_SAFE_CONNECTION_POOL_CLASSES = [
81
- (defined?(::Sequel::ThreadedConnectionPool) && ::Sequel::ThreadedConnectionPool)
82
- ].freeze
81
+ (defined?(::Sequel::ThreadedConnectionPool) && ::Sequel::ThreadedConnectionPool),
82
+ (defined?(::Sequel::TimedQueueConnectionPool) && RUBY_VERSION >= '3.4' && ::Sequel::TimedQueueConnectionPool)
83
+ ].compact.freeze
83
84
 
84
85
  def explainer_for(sql)
85
86
  proc do |*|
data/newrelic.yml CHANGED
@@ -43,6 +43,8 @@ common: &default_settings
43
43
  # The excluded attributes include:
44
44
  # * content from LlmChatCompletionMessage events
45
45
  # * input from LlmEmbedding events
46
+ # This is an optional security setting to prevent recording sensitive data sent to
47
+ # and received from your LLMs.
46
48
  # ai_monitoring.record_content.enabled: true
47
49
 
48
50
  # If true, enables capture of all HTTP request headers for all destinations.
@@ -146,7 +148,7 @@ common: &default_settings
146
148
 
147
149
  # If true, enables auto-injection of Content Security Policy Nonce in browser
148
150
  # monitoring scripts. For now, auto-injection only works with Rails 5.2+.
149
- # browser_monitoring.content_security_policy_nonce: false
151
+ # browser_monitoring.content_security_policy_nonce: true
150
152
 
151
153
  # Manual override for the path to your local CA bundle. This CA bundle will be
152
154
  # used to validate the SSL certificate presented by New Relic's data collection
@@ -358,8 +360,8 @@ common: &default_settings
358
360
  # embedded service within another framework and the agent is detecting the Sinatra
359
361
  # app and skipping the at_exit handler as a result. Sinatra classically runs the
360
362
  # entire application in an at_exit block and would otherwise misbehave if the
361
- # agent's at_exit handler was also installed in those circumstances. Note:
362
- # send_data_on_exit should also be set to true in tandem with this setting.
363
+ # Agent's at_exit handler was also installed in those circumstances. Note:
364
+ # send_data_on_exit should also be set to true in tandem with this setting."
363
365
  # force_install_exit_handler: false
364
366
 
365
367
  # Ordinarily the agent reports dyno names with a trailing dot and process ID (for
@@ -420,15 +422,15 @@ common: &default_settings
420
422
  # instrumentation.delayed_job: auto
421
423
 
422
424
  # Controls auto-instrumentation of the aws-sdk-dynamodb library at start-up. May
423
- # be one of [auto|prepend|chain|disabled].
425
+ # be one of auto, prepend, chain, disabled.
424
426
  # instrumentation.dynamodb: auto
425
427
 
426
428
  # Controls auto-instrumentation of the elasticsearch library at start-up. May be
427
429
  # one of: auto, prepend, chain, disabled.
428
430
  # instrumentation.elasticsearch: auto
429
431
 
430
- # Controls auto-instrumentation of ethon at start up. May be one of
431
- # [auto|prepend|chain|disabled]
432
+ # Controls auto-instrumentation of ethon at start up. May be one of auto, prepend,
433
+ # chain, disabled
432
434
  # instrumentation.ethon: auto
433
435
 
434
436
  # Controls auto-instrumentation of Excon at start-up. May be one of: enabled,
@@ -468,8 +470,8 @@ common: &default_settings
468
470
  # prepend, chain, disabled.
469
471
  # instrumentation.httprb: auto
470
472
 
471
- # Controls auto-instrumentation of httpx at start up. May be one of
472
- # [auto|prepend|chain|disabled]
473
+ # Controls auto-instrumentation of httpx at start up. May be one of auto, prepend,
474
+ # chain, disabled
473
475
  # instrumentation.httpx: auto
474
476
 
475
477
  # Controls auto-instrumentation of Ruby standard library Logger at start-up. May
@@ -531,7 +533,7 @@ common: &default_settings
531
533
  # instrumentation.roda: auto
532
534
 
533
535
  # Controls auto-instrumentation of the ruby-openai gem at start-up. May be one of:
534
- # auto, prepend, chain, disabled.
536
+ # auto, prepend, chain, disabled. Defaults to disabled in high security mode.
535
537
  # instrumentation.ruby_openai: auto
536
538
 
537
539
  # Controls auto-instrumentation of Sinatra at start-up. May be one of: auto,
@@ -695,8 +697,10 @@ common: &default_settings
695
697
  # If true, enables span event sampling.
696
698
  # span_events.enabled: true
697
699
 
698
- # Defines the maximum number of span events reported from a single harvest. Any
699
- # Integer between 1 and 10000 is valid.
700
+ # * Defines the maximum number of span events reported from a single harvest. Any
701
+ # Integer between 1 and 10000 is valid.'
702
+ # * When configuring the agent for AI monitoring, set to max value 10000. This
703
+ # ensures that the agent captures the maximum amount of distributed traces.
700
704
  # span_events.max_samples_stored: 2000
701
705
 
702
706
  # Sets the maximum number of span events to buffer when streaming to the trace
data/test/agent_helper.rb CHANGED
@@ -1039,3 +1039,7 @@ def first_call_for(subject)
1039
1039
 
1040
1040
  items.first
1041
1041
  end
1042
+
1043
+ def ruby_version_float
1044
+ RUBY_VERSION.split('.')[0..1].join('.').to_f
1045
+ end
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: 9.10.0
4
+ version: 9.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanna McClure
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2024-05-29 00:00:00.000000000 Z
14
+ date: 2024-06-03 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -243,7 +243,7 @@ files:
243
243
  - bin/nrdebug
244
244
  - init.rb
245
245
  - install.rb
246
- - lib/bootstrap.rb
246
+ - lib/boot/strap.rb
247
247
  - lib/new_relic/agent.rb
248
248
  - lib/new_relic/agent/adaptive_sampler.rb
249
249
  - lib/new_relic/agent/agent.rb