newrelic_rpm 9.7.0 → 9.7.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: 0ece3a3703c9847f5ddf5ddd8776a58ff03c6400e3d61053bfe227ea7ddc3d83
4
- data.tar.gz: 14aa9f742b5a9e73d510ff88cfe5292007fb97a002a23d15bc835be72b3ae483
3
+ metadata.gz: 6bdcea3ab1fea41b672c672c931a6005966bef1500709deb9d85681912cf7d33
4
+ data.tar.gz: 7d2bcd8db6e959d909e26dd4c3d8e8a99c7cec6572204a1c0283ce65521a5d6a
5
5
  SHA512:
6
- metadata.gz: 670682da76dcf65d64bd634579e63bf82ab33dafbfd72b5e66605b136d10dcdcc655e8a1d5ecac2db58e948ec57775ef74c337a43428b8458a5436458c1d1522
7
- data.tar.gz: 9f5e190e03218aa49d57dba5299770a93f0e835436f21144f65c9e149427a496468644950ccfd6274cdda0ed735002a46a20703afc79483767439266043c5f8e
6
+ metadata.gz: '053846613ea0a66e691e15cd2159c3ada613f3f66dcfc9232f723569a54d3659f84b8b16ed178e7eb46691a36dc182addaf187370b15862e3f05d3e9335f50b3'
7
+ data.tar.gz: 588be3aa5b6e29b2cb1c79e89d4b3bd4af5fc5e41e819f1916c52107aca1ba41f8ca9d573ccf7d8def38d9fb166a2cd73ae2bf9733de2bc03472cd517cdf1801
data/CHANGELOG.md CHANGED
@@ -1,13 +1,25 @@
1
1
  # New Relic Ruby Agent Release Notes
2
2
 
3
- ## v9.7.0
4
3
 
4
+ ## v9.7.1
5
+
6
+ Version 9.7.1 fixes a ViewComponent instrumentation bug and enforces maximum size limits for custom event attributes.
7
+
8
+ - **Bugfix: Stop suppressing ViewComponent errors**
9
+
10
+ Previously, the agent suppressed ViewComponent render errors. The agent now reports these errors and allows them to raise. Thank you [@mjacobus](https://github.com/mjacobus) for reporting this bug and providing a fix! [PR#2410](https://github.com/newrelic/newrelic-ruby-agent/pull/2410)
11
+
12
+ - **Bugfix: Enforce maximum size limits for custom event attributes**
13
+
14
+ Previously, the agent would allow custom event attributes to be any size. This would lead to the New Relic backend dropping attributes larger than the maximum size. Now, the agent will truncate custom event attribute values to 4095 characters, attribute names to 255 characters, and the total count of attributes to 64. [PR#2401](https://github.com/newrelic/newrelic-ruby-agent/pull/2401)
15
+
16
+ ## v9.7.0
5
17
 
6
18
  Version 9.7.0 introduces ViewComponent instrumentation, changes the endpoint used to access the cluster name for Elasticsearch instrumentation, removes the creation of the Ruby/Thread and Ruby/Fiber spans, and adds support for Falcon.
7
19
 
8
20
  - **Feature: ViewComponent instrumentation**
9
21
 
10
- [ViewComponent](https://viewcomponent.org/) is a now an instrumented framework. The agent currently supports Roda versions 2.0.0+. [PR#2367](https://github.com/newrelic/newrelic-ruby-agent/pull/2367)
22
+ [ViewComponent](https://viewcomponent.org/) is a now an instrumented library. [PR#2367](https://github.com/newrelic/newrelic-ruby-agent/pull/2367)
11
23
 
12
24
  - **Feature: Use root path to access Elasticsearch cluster name**
13
25
 
@@ -14,6 +14,9 @@ module NewRelic
14
14
  TIMESTAMP = 'timestamp'.freeze
15
15
  PRIORITY = 'priority'.freeze
16
16
  EVENT_TYPE_REGEX = /^[a-zA-Z0-9:_ ]+$/.freeze
17
+ MAX_ATTRIBUTE_COUNT = 64
18
+ MAX_ATTRIBUTE_SIZE = 4095
19
+ MAX_NAME_SIZE = 255
17
20
 
18
21
  named :CustomEventAggregator
19
22
  capacity_key :'custom_insights_events.max_samples_stored'
@@ -49,10 +52,33 @@ module NewRelic
49
52
  {TYPE => type,
50
53
  TIMESTAMP => Process.clock_gettime(Process::CLOCK_REALTIME).to_i,
51
54
  PRIORITY => priority},
52
- AttributeProcessing.flatten_and_coerce(attributes)
55
+ create_custom_event_attributes(attributes)
53
56
  ]
54
57
  end
55
58
 
59
+ def create_custom_event_attributes(attributes)
60
+ result = AttributeProcessing.flatten_and_coerce(attributes)
61
+
62
+ if result.size > MAX_ATTRIBUTE_COUNT
63
+ NewRelic::Agent.logger.warn("Custom event attributes are limited to #{MAX_ATTRIBUTE_COUNT}. Discarding #{result.size - MAX_ATTRIBUTE_COUNT} attributes")
64
+ result = result.first(MAX_ATTRIBUTE_COUNT)
65
+ end
66
+
67
+ result.each_with_object({}) do |(key, val), new_result|
68
+ # name is limited to 255
69
+ if key.is_a?(String) && key.length > MAX_NAME_SIZE
70
+ key = key[0, MAX_NAME_SIZE]
71
+ end
72
+
73
+ # value is limited to 4095
74
+ if val.is_a?(String) && val.length > MAX_ATTRIBUTE_SIZE
75
+ val = val[0, MAX_ATTRIBUTE_SIZE]
76
+ end
77
+
78
+ new_result[key] = val
79
+ end
80
+ end
81
+
56
82
  def after_initialize
57
83
  @type_strings = Hash.new { |hash, key| hash[key] = key.to_s.freeze }
58
84
  end
@@ -10,7 +10,9 @@ DependencyDetection.defer do
10
10
  named :async_http
11
11
 
12
12
  depends_on do
13
- defined?(Async::HTTP) && Gem::Version.new(Async::HTTP::VERSION) >= Gem::Version.new('0.59.0')
13
+ defined?(Async::HTTP) &&
14
+ Gem::Version.new(Async::HTTP::VERSION) >= Gem::Version.new('0.59.0') &&
15
+ !defined?(Traces::Backend::NewRelic) # defined in the traces-backend-newrelic gem
14
16
  end
15
17
 
16
18
  executes do
@@ -14,7 +14,7 @@ DependencyDetection.defer do
14
14
  end
15
15
 
16
16
  executes do
17
- supportability_name = NewRelic::Agent::Instrumentation::GRPC::Client::INSTRUMENTATION_NAME
17
+ supportability_name = NewRelic::Agent::Instrumentation::GRPC::Server::INSTRUMENTATION_NAME
18
18
  if use_prepend?
19
19
  prepend_instrument GRPC::RpcServer, NewRelic::Agent::Instrumentation::GRPC::Server::RpcServerPrepend, supportability_name
20
20
  prepend_instrument GRPC::RpcDesc, NewRelic::Agent::Instrumentation::GRPC::Server::RpcDescPrepend, supportability_name
@@ -15,7 +15,8 @@ module NewRelic::Agent::Instrumentation
15
15
  )
16
16
  yield
17
17
  rescue => e
18
- ::NewRelic::Agent.logger.debug('Error capturing ViewComponent segment', e)
18
+ NewRelic::Agent.notice_error(e)
19
+ raise
19
20
  ensure
20
21
  segment&.finish
21
22
  end
@@ -7,7 +7,7 @@ module NewRelic
7
7
  module VERSION # :nodoc:
8
8
  MAJOR = 9
9
9
  MINOR = 7
10
- TINY = 0
10
+ TINY = 1
11
11
 
12
12
  STRING = "#{MAJOR}.#{MINOR}.#{TINY}"
13
13
  end
@@ -82,7 +82,7 @@ class Instrumentation < Thor
82
82
  insert_into_file(
83
83
  DEFAULT_SOURCE_LOCATION,
84
84
  config_block(name.downcase),
85
- after: ":description => 'Controls auto-instrumentation of bunny at start-up. May be one of [auto|prepend|chain|disabled].'
85
+ after: ":description => 'Controls auto-instrumentation of bunny at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
86
86
  },\n"
87
87
  )
88
88
  end
@@ -9,7 +9,6 @@ module NewRelic::Agent::Instrumentation
9
9
  include NewRelic::Agent::Instrumentation::<%= @class_name %>
10
10
 
11
11
  alias_method(:<%= @method.downcase %>_without_new_relic, :<%= @method.downcase %>)
12
- alias_method(:<%= @method.downcase %>, :<%= @method.downcase %>_with_new_relic)
13
12
 
14
13
  def <%= @method.downcase %><%= "(#{@args})" unless @args.empty? %>
15
14
  <%= @method.downcase %>_with_new_relic<%= "(#{@args})" unless @args.empty? %> do
@@ -1,5 +1,4 @@
1
1
  alias_method(:<%= @method.downcase %>_without_new_relic, :<%= @method.downcase %>)
2
- alias_method(:<%= @method.downcase %>, :<%= @method.downcase %>_with_new_relic)
3
2
 
4
3
  def <%= @method.downcase %><%= "(#{@args})" unless @args.empty? %>
5
4
  <%= @method.downcase %>_with_new_relic<%= "(#{@args})" unless @args.empty? %> do
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.7.0
4
+ version: 9.7.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-01-10 00:00:00.000000000 Z
14
+ date: 2024-01-25 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler