newrelic_rpm 9.24.0 → 10.0.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.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +118 -0
  3. data/README.md +0 -7
  4. data/lib/new_relic/agent/agent.rb +9 -4
  5. data/lib/new_relic/agent/configuration/default_source.rb +50 -174
  6. data/lib/new_relic/agent/configuration/environment_source.rb +7 -38
  7. data/lib/new_relic/agent/configuration/manager.rb +141 -59
  8. data/lib/new_relic/agent/configuration/sampler_config_validator.rb +2 -2
  9. data/lib/new_relic/agent/configuration/server_source.rb +0 -1
  10. data/lib/new_relic/agent/connect/response_handler.rb +0 -11
  11. data/lib/new_relic/agent/datastores.rb +8 -30
  12. data/lib/new_relic/agent/distributed_tracing.rb +0 -3
  13. data/lib/new_relic/agent/health_check.rb +1 -0
  14. data/lib/new_relic/agent/instrumentation/active_job.rb +1 -1
  15. data/lib/new_relic/agent/instrumentation/active_job_subscriber.rb +2 -1
  16. data/lib/new_relic/agent/instrumentation/active_record_helper.rb +1 -4
  17. data/lib/new_relic/agent/instrumentation/active_support.rb +8 -1
  18. data/lib/new_relic/agent/instrumentation/active_support_subscriber.rb +22 -14
  19. data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +1 -4
  20. data/lib/new_relic/agent/instrumentation/bunny.rb +0 -1
  21. data/lib/new_relic/agent/instrumentation/curb/chain.rb +2 -2
  22. data/lib/new_relic/agent/instrumentation/curb/instrumentation.rb +2 -3
  23. data/lib/new_relic/agent/instrumentation/curb.rb +0 -1
  24. data/lib/new_relic/agent/instrumentation/excon/middleware.rb +1 -1
  25. data/lib/new_relic/agent/instrumentation/excon.rb +2 -3
  26. data/lib/new_relic/agent/instrumentation/grpc/client/instrumentation.rb +1 -2
  27. data/lib/new_relic/agent/instrumentation/httpclient.rb +0 -1
  28. data/lib/new_relic/agent/instrumentation/httprb.rb +0 -1
  29. data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +0 -2
  30. data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +0 -2
  31. data/lib/new_relic/agent/instrumentation/rack/helpers.rb +1 -3
  32. data/lib/new_relic/agent/instrumentation/typhoeus.rb +0 -1
  33. data/lib/new_relic/agent/llm/chat_completion_summary.rb +1 -8
  34. data/lib/new_relic/agent/llm/embedding.rb +1 -8
  35. data/lib/new_relic/agent/messaging.rb +12 -5
  36. data/lib/new_relic/agent/monitors/inbound_request_monitor.rb +1 -2
  37. data/lib/new_relic/agent/monitors/synthetics_monitor.rb +2 -1
  38. data/lib/new_relic/agent/monitors.rb +0 -3
  39. data/lib/new_relic/agent/new_relic_service/encoders.rb +0 -14
  40. data/lib/new_relic/agent/new_relic_service.rb +11 -49
  41. data/lib/new_relic/agent/opentelemetry/trace/span.rb +41 -0
  42. data/lib/new_relic/agent/opentelemetry/trace/tracer.rb +16 -7
  43. data/lib/new_relic/agent/opentelemetry_bridge.rb +3 -2
  44. data/lib/new_relic/agent/serverless_handler.rb +2 -2
  45. data/lib/new_relic/agent/span_event_primitive.rb +1 -1
  46. data/lib/new_relic/agent/sql_sampler.rb +0 -34
  47. data/lib/new_relic/agent/stats_engine.rb +1 -0
  48. data/lib/new_relic/agent/transaction/distributed_tracer.rb +12 -56
  49. data/lib/new_relic/agent/transaction/external_request_segment.rb +1 -131
  50. data/lib/new_relic/agent/transaction/message_broker_segment.rb +0 -2
  51. data/lib/new_relic/agent/transaction/trace_context.rb +19 -19
  52. data/lib/new_relic/agent/transaction.rb +4 -14
  53. data/lib/new_relic/agent/transaction_error_primitive.rb +0 -8
  54. data/lib/new_relic/agent/transaction_event_primitive.rb +0 -14
  55. data/lib/new_relic/agent/utilization/gcp.rb +2 -0
  56. data/lib/new_relic/agent.rb +11 -3
  57. data/lib/new_relic/cli/command.rb +2 -11
  58. data/lib/new_relic/control/instance_methods.rb +2 -15
  59. data/lib/new_relic/control/private_instance_methods.rb +2 -4
  60. data/lib/new_relic/control/server_methods.rb +0 -6
  61. data/lib/new_relic/helper.rb +21 -2
  62. data/lib/new_relic/language_support.rb +3 -34
  63. data/lib/new_relic/supportability_helper.rb +0 -4
  64. data/lib/new_relic/version.rb +2 -2
  65. data/lib/tasks/helpers/newrelicyml.rb +2 -2
  66. data/lib/tasks/helpers/version_bump.rb +1 -2
  67. data/newrelic.yml +25 -27
  68. data/newrelic_rpm.gemspec +10 -9
  69. metadata +26 -26
  70. data/bin/newrelic +0 -8
  71. data/lib/new_relic/agent/configuration/security_policy_source.rb +0 -246
  72. data/lib/new_relic/agent/distributed_tracing/cross_app_payload.rb +0 -44
  73. data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +0 -253
  74. data/lib/new_relic/agent/external.rb +0 -112
  75. data/lib/new_relic/agent/monitors/cross_app_monitor.rb +0 -117
  76. data/lib/new_relic/agent/new_relic_service/security_policy_settings.rb +0 -61
  77. data/lib/new_relic/cli/commands/deployments.rb +0 -206
  78. data/lib/new_relic/recipes/capistrano3.rb +0 -23
  79. data/lib/new_relic/recipes/capistrano_legacy.rb +0 -95
  80. data/lib/new_relic/recipes/helpers/send_deployment.rb +0 -70
  81. data/lib/new_relic/recipes.rb +0 -24
  82. data/recipes/newrelic.rb +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a513be9b409b6ae8c4e08416ded683ef6abeb372607baf25ba7aa10f7a916f5
4
- data.tar.gz: 3604c7f4df3c33a1f61cd2b3b984dce971bac3b3b028862929a0c99c79931f4c
3
+ metadata.gz: f1ba5e172b3a5648a782fbac5ff79ed02c515effb8f956277857b0d31df80e4c
4
+ data.tar.gz: 12b8f92031c90f9bf3afeec99651220ab1a08e08f176efe2a178a6d9c3b72e2c
5
5
  SHA512:
6
- metadata.gz: 5ecb0cd5c7b6476b008ac82be5bbda20b2c4e8b58465f457057a9357ac499f82b3779b9bbbcdaa2e5c2376db98e000957f653875bb9e98436f41b1a4f718dc42
7
- data.tar.gz: 72e77abe6f9b63be2ae7af1bd99dcb285ec82d54725826e38c5c54df391c13bc983b7d50fe4b9e0795ef6b28f02c732d196db1ebe40f7e590d031f3d8394c3a6
6
+ metadata.gz: 0b1f474da66156182fb297affe29c8c2231fec2c25d181b010134b648dcdd5c03b6543114bce29b760d59718fc77e86606b520d7d4ed1adf7675eb7982034be1
7
+ data.tar.gz: ac2cdcb58281265d7bdc6674ac02731e35de1cc2038ae2c0957c588bf8d5773bf69ed868cdc255e0a4ccea114378a44c8d4267e1faa7e4e8b2232f64f1f9a316
data/CHANGELOG.md CHANGED
@@ -1,5 +1,123 @@
1
1
  # New Relic Ruby Agent Release Notes
2
2
 
3
+ ## v10.0.0
4
+
5
+ - **Breaking Change: Remove support for Ruby 2.4 and 2.5**
6
+
7
+ Support for Ruby versions 2.4 and 2.5 has been removed. The new minimum required Ruby version is now 2.6. [PR#3314](https://github.com/newrelic/newrelic-ruby-agent/pull/3314)
8
+
9
+ - **Breaking Change: Removal of Cross Application Tracing (CAT)**
10
+
11
+ Previously, Cross Application Tracing (CAT) was deprecated in favor of Distributed Tracing. CAT functionality has now been removed. The configuration option `cross_application_tracer.enabled` has been removed. Public API methods `NewRelic::Agent::External.process_request_metadata`, `NewRelic::Agent::External.get_response_metadata`, `NewRelic::Agent::Transaction::ExternalRequestSegment#process_response_metadata`, `NewRelic::Agent::Transaction::ExternalRequestSegment#get_request_metadata`, and `NewRelic::Agent::Transaction::ExternalRequestSegment#read_response_headers` have also been removed. [PR#3333](https://github.com/newrelic/newrelic-ruby-agent/pull/3333)
12
+
13
+ - **Breaking Change: Rename ActiveJob metrics and segments**
14
+
15
+ ActiveJob metrics have been updated to include the job's class name for more specific reporting. This is a breaking change and may require updating custom dashboards or alerts. [PR#3370](https://github.com/newrelic/newrelic-ruby-agent/pull/3370) [PR#3320](https://github.com/newrelic/newrelic-ruby-agent/pull/3320)
16
+ - Old format: `Ruby/ActiveJob/<QueueName>/<Method>`
17
+ - New format: `Ruby/ActiveJob/<QueueName>/<ClassName>/<Method>`
18
+
19
+ In addition, segments created for Active Job enqueuing actions now include the job class.
20
+ - Old format: `ActiveJob/<QueueAdapter>/Queue/<Event>/Named/<QueueName>`
21
+ - New format: `ActiveJob/<QueueAdapter>/Queue/<Event>/Named/<QueueName>/<ClassName>`
22
+
23
+ - **Breaking Change: Rename `bin/newrelic` command to `bin/newrelic_rpm`**
24
+
25
+ The executable file for the agent's CLI has been renamed from `bin/newrelic` to `bin/newrelic_rpm`. This change resolves a name collision with the standalone New Relic CLI tool. [PR#3323](https://github.com/newrelic/newrelic-ruby-agent/pull/3323)
26
+
27
+ - **Breaking Change: Remove the `newrelic deployments` CLI command**
28
+
29
+ The deprecated `newrelic deployments` CLI command has been removed. To track changes and deployments in New Relic, please see our guide to [Change Tracking](https://docs.newrelic.com/docs/change-tracking/change-tracking-introduction/) for a list of available options. [PR#3299](https://github.com/newrelic/newrelic-ruby-agent/pull/3299)
30
+
31
+ - **Breaking Change: Remove the NewRelic::Agent::SqlSampler#notice_sql method**
32
+
33
+ Users should call `NewRelic::Agent::Datastores.notice_sql` instead. [PR#3338](https://github.com/newrelic/newrelic-ruby-agent/pull/3338)
34
+
35
+ - **Breaking Change: Remove unused arguments from various NewRelic::Agent::Datastores APIs**
36
+
37
+ The following APIs from the `NewRelic::Agent::Datastores` class have had method arguments removed:
38
+ * `NewRelic::Agent::Datastores.notice_sql`, previously had three positional arguments, `query`, `scoped_metric` and `elapsed`. Now, it only has `query`.
39
+ * `NewRelic::Agent::Datastores.notice_statement`, previously had two positional arguments `query` and `elapsed`. Now it only has `query`.
40
+ * `NewRelic::Agent::Datastores.wrap` requires a proc. Previously the proc received three arguments: the result of the yield, the most specific scoped metric name, and the elapsed time of the call. Now, it only receives one: the result of the yield.
41
+
42
+ The values of the removed arguments are derived from the current segment at the time of the call. [PR#3347](https://github.com/newrelic/newrelic-ruby-agent/pull/3347)
43
+
44
+ - **Breaking Change: Remove experimental feature Configurable Security Policies (CSP)**
45
+
46
+ The experimental feature, Configurable Security Policies (CSP), is no longer supported and has been removed. [PR#3292](https://github.com/newrelic/newrelic-ruby-agent/pull/3292)
47
+
48
+ - **Breaking Change: Remove support for Puma versions < 3.9.0**
49
+
50
+ The minimum version of Puma now supported is 3.9.0 or higher. [PR#3326](https://github.com/newrelic/newrelic-ruby-agent/pull/3326)
51
+
52
+ - **Breaking Change: Improve configuration validation and coercion**
53
+
54
+ The internals used to coerce and validate the values provided for agent configuration are now more performant and more accurate.
55
+ * Warning messages will now be logged to the newrelic_agent.log file when nil is provided as a config value for a setting that does not support it.
56
+ * Integer values are permitted for Float configuration types
57
+ * Float values are permitted for Integer configuration types
58
+ * Fatal interruptions are prevented when a default value can be found to replace an invalid input value
59
+ [PR#3341](https://github.com/newrelic/newrelic-ruby-agent/pull/3341)
60
+
61
+ - **Breaking Change: Replace 'default' option with 'adaptive' for distributed tracing remote parent samplers**
62
+
63
+ Previously, the default option for `distributed_tracing.sampler.remote_parent_sampled` and `distributed_tracing.sampler.remote_parent_not_sampled` was `default`, which used the pre-existing adaptive sampler. The `default` option has been renamed to `adaptive`. [PR#3363](https://github.com/newrelic/newrelic-ruby-agent/pull/3363)
64
+
65
+ - **Feature: Add `logger` as a dependency**
66
+
67
+ The `logger` gem is now listed as a dependency of the agent to ensure continued logging functionality and support for Ruby 4.0.0 and newer versions. [PR#3293](https://github.com/newrelic/newrelic-ruby-agent/pull/3293)
68
+
69
+ - **Feature: Add Active Support notification allowlist configuration option**
70
+
71
+ A new configuration option, `instrumentation.active_support_notifications.active_support_events`, allows users to define an allowlist of Active
72
+ Support notifications event names for the agent to subscribe to. By default, the agent subscribes to all [Active Support: Caching](https://guides.rubyonrails.org/active_support_instrumentation.html#active-support-caching) and [Active Support: Messages](https://guides.rubyonrails.org/active_support_instrumentation.html#active-support-messages) events. [PR#3327](https://github.com/newrelic/newrelic-ruby-agent/pull/3327)
73
+
74
+ - **Feature: Use Ruby's built-in Gzip compression**
75
+
76
+ The agent now uses the built-in `Zlib.gzip` method from the Ruby standard library for compression, replacing the previous custom implementation. [PR#3332](https://github.com/newrelic/newrelic-ruby-agent/pull/3332)
77
+
78
+ - **Feature: Add argument validation for the `NewRelic::Agent#record_custom_event` API**
79
+
80
+ The `NewRelic::Agent#record_custom_event` API now raises an `ArgumentError` when an invalid `event_type` is provided. A valid event type must consist only of alphanumeric characters, underscores (`_`), colons (`:`), or spaces (` `). [PR#3319](https://github.com/newrelic/newrelic-ruby-agent/pull/3319)
81
+
82
+ - **Feature: Add root sampling configuration options**
83
+
84
+ You can now configure the sampling behavior for traces that originate within the current service using `distributed_tracing.sampler.root`. [PR#3330](https://github.com/newrelic/newrelic-ruby-agent/pull/3330)
85
+
86
+ There are four modes available:
87
+
88
+ | Mode | Description |
89
+ | ------ | ----------- |
90
+ | `adaptive` | Uses the existing adaptive sampler algorithm |
91
+ | `always_off` | Marks 0% of root traces as sampled |
92
+ | `always_on` | Marks 100% of root traces as sampled |
93
+ | `trace_id_ratio_based` | Samples traces based on a ratio set in `distributed_tracing.sampler.root.trace_id_ratio_based.ratio`. The ratio must be float between 0.0 and 1.0 |
94
+
95
+ - **Feature: Add Trace ID Ratio Based sampling options**
96
+
97
+ The agent can now sample traces using the OpenTelemetry Trace ID Ratio Based sampler algorithm. [PR#3330](https://github.com/newrelic/newrelic-ruby-agent/pull/3330) This samples traces based on a probability between 0.0 and 1.0 based on the trace ID.
98
+
99
+ To use this option, you must first set your distributed tracing sampler configuration to `trace_id_ratio_based` and then set the corresponding `distributed_tracing.sampler.*.trace_id_ratio_based.ratio` sampler to a Float between 0.0 and 1.0.
100
+
101
+ For example:
102
+ ```yaml
103
+ distributed_tracing.sampler.remote_parent_sampled: 'trace_id_ratio_based'
104
+ distributed_tracing.sampler.remote_parent_sampled.trace_id_ratio_based.ratio': 0.5
105
+ ```
106
+ This configuration would sample approximately 50% of your traces for all traces where the remote parent is sampled.
107
+
108
+ This option is available for:
109
+ * `distributed_tracing.sampler.root`
110
+ * `distributed_tracing.sampler.remote_parent_sampled`
111
+ * `distributed_tracing.sampler.remote_parent_not_sampled`
112
+
113
+ - **Feature: Add Entity GUID to Agent Control health check files**
114
+
115
+ When the agent is started within an [Agent Control](https://docs-preview.newrelic.com/docs/new-relic-agent-control) environment, a health check file is created at the configured file location for every agent process. This file now includes the guid of the entity related to the agent when available. [PR#3371](https://github.com/newrelic/newrelic-ruby-agent/pull/3371)
116
+
117
+ - **Bugfix: Resolve a `NoMethodError` in GCP utilization detection.**
118
+
119
+ The GCP metadata discovery logic will now gracefully handle `nil` or unexpected values, preventing service initialization crashes. [PR##3388](https://github.com/newrelic/newrelic-ruby-agent/pull/#3388)
120
+
3
121
  ## v9.24.0
4
122
 
5
123
  - **Feature: Deprecation reminder for SqlSampler#notice_sql API**
data/README.md CHANGED
@@ -77,13 +77,6 @@ For complete documentation on installing the New Relic Ruby agent, see the follo
77
77
  * [Update the agent](https://docs.newrelic.com/docs/agents/ruby-agent/installation/update-ruby-agent)
78
78
  * [Uninstall the Ruby agent](https://docs.newrelic.com/docs/agents/ruby-agent/installation/uninstall-ruby-agent)
79
79
 
80
- ### Recording deploys
81
-
82
- The Ruby agent supports recording deployments in New Relic via a command line
83
- tool or Capistrano recipes. For more information on these features, see
84
- [our deployment documentation](http://docs.newrelic.com/docs/ruby/recording-deployments-with-the-ruby-agent)
85
- for more information.
86
-
87
80
  ## Support
88
81
 
89
82
  Should you need assistance with New Relic products, you are in good hands with several support diagnostic tools and support channels.
@@ -100,6 +100,12 @@ module NewRelic
100
100
  @monotonic_gc_profiler = VM::MonotonicGCProfiler.new
101
101
  @adaptive_sampler = AdaptiveSampler.new(Agent.config[:sampling_target],
102
102
  Agent.config[:sampling_target_period_in_seconds])
103
+ # TODO: update the configs used here to match new sampler-specific options
104
+ # TODO: Consider refactoring to only create the sampler if 'adaptive' is the sampler's setting
105
+ @adaptive_sampler_remote_parent_sampled = AdaptiveSampler.new(Agent.config[:sampling_target],
106
+ Agent.config[:sampling_target_period_in_seconds])
107
+ @adaptive_sampler_remote_parent_not_sampled = AdaptiveSampler.new(Agent.config[:sampling_target],
108
+ Agent.config[:sampling_target_period_in_seconds])
103
109
  @serverless_handler = ServerlessHandler.new
104
110
  @opentelemetry_bridge = OpenTelemetryBridge.new
105
111
  end
@@ -156,8 +162,6 @@ module NewRelic
156
162
  attr_reader :record_sql
157
163
  # builder for JS agent scripts to inject
158
164
  attr_reader :javascript_instrumentor
159
- # cross application tracing ids and encoding
160
- attr_reader :cross_process_id
161
165
  # service for communicating with collector
162
166
  attr_reader :service
163
167
  # Global events dispatcher. This will provides our primary mechanism
@@ -180,6 +184,8 @@ module NewRelic
180
184
  attr_reader :transaction_event_recorder
181
185
  attr_reader :attribute_filter
182
186
  attr_reader :adaptive_sampler
187
+ attr_reader :adaptive_sampler_remote_parent_sampled
188
+ attr_reader :adaptive_sampler_remote_parent_not_sampled
183
189
  attr_reader :serverless_handler
184
190
 
185
191
  def transaction_event_aggregator
@@ -238,8 +244,7 @@ module NewRelic
238
244
  return false if !needs_restart ||
239
245
  !Agent.config[:agent_enabled] ||
240
246
  !Agent.config[:monitor_mode] ||
241
- disconnected? ||
242
- !control.security_settings_valid?
247
+ disconnected?
243
248
 
244
249
  true
245
250
  end