newrelic_rpm 6.12.0.367 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -0
  3. data/CHANGELOG.md +269 -8
  4. data/CONTRIBUTING.md +54 -11
  5. data/README.md +40 -16
  6. data/ROADMAP.md +24 -0
  7. data/lib/new_relic/agent.rb +3 -10
  8. data/lib/new_relic/agent/agent.rb +6 -4
  9. data/lib/new_relic/agent/audit_logger.rb +10 -0
  10. data/lib/new_relic/agent/autostart.rb +1 -2
  11. data/lib/new_relic/agent/configuration/default_source.rb +294 -102
  12. data/lib/new_relic/agent/configuration/manager.rb +2 -2
  13. data/lib/new_relic/agent/database_adapter.rb +33 -0
  14. data/lib/new_relic/agent/datastores/redis.rb +0 -4
  15. data/lib/new_relic/agent/distributed_tracing.rb +0 -66
  16. data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +2 -2
  17. data/lib/new_relic/agent/http_clients/uri_util.rb +8 -8
  18. data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +4 -5
  19. data/lib/new_relic/agent/instrumentation/active_record_helper.rb +21 -68
  20. data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +0 -16
  21. data/lib/new_relic/agent/instrumentation/active_record_prepend.rb +23 -57
  22. data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +0 -15
  23. data/lib/new_relic/agent/instrumentation/bunny.rb +10 -196
  24. data/lib/new_relic/agent/instrumentation/bunny/chain.rb +45 -0
  25. data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +152 -0
  26. data/lib/new_relic/agent/instrumentation/bunny/prepend.rb +35 -0
  27. data/lib/new_relic/agent/instrumentation/curb.rb +9 -259
  28. data/lib/new_relic/agent/instrumentation/curb/chain.rb +93 -0
  29. data/lib/new_relic/agent/instrumentation/curb/instrumentation.rb +222 -0
  30. data/lib/new_relic/agent/instrumentation/curb/prepend.rb +63 -0
  31. data/lib/new_relic/agent/instrumentation/delayed_job/chain.rb +38 -0
  32. data/lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb +53 -0
  33. data/lib/new_relic/agent/instrumentation/delayed_job/prepend.rb +34 -0
  34. data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +8 -84
  35. data/lib/new_relic/agent/instrumentation/excon.rb +2 -1
  36. data/lib/new_relic/agent/instrumentation/grape.rb +13 -113
  37. data/lib/new_relic/agent/instrumentation/grape/chain.rb +25 -0
  38. data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +100 -0
  39. data/lib/new_relic/agent/instrumentation/grape/prepend.rb +17 -0
  40. data/lib/new_relic/agent/instrumentation/httpclient.rb +8 -30
  41. data/lib/new_relic/agent/instrumentation/httpclient/chain.rb +25 -0
  42. data/lib/new_relic/agent/instrumentation/httpclient/instrumentation.rb +38 -0
  43. data/lib/new_relic/agent/instrumentation/httpclient/prepend.rb +17 -0
  44. data/lib/new_relic/agent/instrumentation/httprb.rb +29 -0
  45. data/lib/new_relic/agent/instrumentation/httprb/chain.rb +22 -0
  46. data/lib/new_relic/agent/instrumentation/httprb/instrumentation.rb +30 -0
  47. data/lib/new_relic/agent/instrumentation/httprb/prepend.rb +15 -0
  48. data/lib/new_relic/agent/instrumentation/memcache.rb +54 -69
  49. data/lib/new_relic/agent/instrumentation/memcache/chain.rb +16 -0
  50. data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +38 -121
  51. data/lib/new_relic/agent/instrumentation/memcache/helper.rb +56 -0
  52. data/lib/new_relic/agent/instrumentation/memcache/instrumentation.rb +88 -0
  53. data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +88 -0
  54. data/lib/new_relic/agent/instrumentation/middleware_proxy.rb +4 -10
  55. data/lib/new_relic/agent/instrumentation/mongo.rb +7 -0
  56. data/lib/new_relic/agent/instrumentation/net_http.rb +39 -0
  57. data/lib/new_relic/agent/instrumentation/net_http/chain.rb +25 -0
  58. data/lib/new_relic/agent/instrumentation/net_http/instrumentation.rb +40 -0
  59. data/lib/new_relic/agent/instrumentation/net_http/prepend.rb +21 -0
  60. data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +1 -1
  61. data/lib/new_relic/agent/instrumentation/padrino.rb +18 -75
  62. data/lib/new_relic/agent/instrumentation/padrino/chain.rb +34 -0
  63. data/lib/new_relic/agent/instrumentation/padrino/instrumentation.rb +27 -0
  64. data/lib/new_relic/agent/instrumentation/padrino/prepend.rb +20 -0
  65. data/lib/new_relic/agent/instrumentation/rack.rb +29 -160
  66. data/lib/new_relic/agent/instrumentation/rack/chain.rb +57 -0
  67. data/lib/new_relic/agent/instrumentation/rack/helpers.rb +32 -0
  68. data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +73 -0
  69. data/lib/new_relic/agent/instrumentation/rack/prepend.rb +36 -0
  70. data/lib/new_relic/agent/instrumentation/rake.rb +13 -187
  71. data/lib/new_relic/agent/instrumentation/rake/chain.rb +25 -0
  72. data/lib/new_relic/agent/instrumentation/rake/instrumentation.rb +144 -0
  73. data/lib/new_relic/agent/instrumentation/rake/prepend.rb +14 -0
  74. data/lib/new_relic/agent/instrumentation/redis.rb +10 -188
  75. data/lib/new_relic/agent/instrumentation/redis/chain.rb +34 -0
  76. data/lib/new_relic/agent/instrumentation/redis/instrumentation.rb +65 -0
  77. data/lib/new_relic/agent/instrumentation/redis/prepend.rb +24 -0
  78. data/lib/new_relic/agent/instrumentation/resque.rb +8 -28
  79. data/lib/new_relic/agent/instrumentation/resque/chain.rb +22 -0
  80. data/lib/new_relic/agent/instrumentation/resque/instrumentation.rb +33 -0
  81. data/lib/new_relic/agent/instrumentation/resque/prepend.rb +16 -0
  82. data/lib/new_relic/agent/instrumentation/sidekiq.rb +1 -1
  83. data/lib/new_relic/agent/instrumentation/sinatra.rb +20 -198
  84. data/lib/new_relic/agent/instrumentation/sinatra/chain.rb +55 -0
  85. data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +29 -34
  86. data/lib/new_relic/agent/instrumentation/sinatra/instrumentation.rb +118 -0
  87. data/lib/new_relic/agent/instrumentation/sinatra/prepend.rb +33 -0
  88. data/lib/new_relic/agent/instrumentation/typhoeus.rb +10 -89
  89. data/lib/new_relic/agent/instrumentation/typhoeus/chain.rb +22 -0
  90. data/lib/new_relic/agent/instrumentation/typhoeus/instrumentation.rb +82 -0
  91. data/lib/new_relic/agent/instrumentation/typhoeus/prepend.rb +14 -0
  92. data/lib/new_relic/agent/method_tracer.rb +6 -16
  93. data/lib/new_relic/agent/new_relic_service.rb +19 -5
  94. data/lib/new_relic/agent/samplers/memory_sampler.rb +1 -1
  95. data/lib/new_relic/agent/span_event_primitive.rb +10 -8
  96. data/lib/new_relic/agent/sql_sampler.rb +1 -1
  97. data/lib/new_relic/agent/stats_engine/gc_profiler.rb +1 -1
  98. data/lib/new_relic/agent/transaction.rb +1 -4
  99. data/lib/new_relic/agent/transaction/abstract_segment.rb +1 -1
  100. data/lib/new_relic/agent/transaction/distributed_tracer.rb +12 -6
  101. data/lib/new_relic/agent/transaction/external_request_segment.rb +2 -2
  102. data/lib/new_relic/agent/transaction/message_broker_segment.rb +1 -0
  103. data/lib/new_relic/agent/transaction/segment.rb +9 -5
  104. data/lib/new_relic/agent/vm/mri_vm.rb +6 -4
  105. data/lib/new_relic/cli/commands/deployments.rb +0 -1
  106. data/lib/new_relic/constants.rb +4 -0
  107. data/lib/new_relic/control/frameworks/rails.rb +11 -9
  108. data/lib/new_relic/control/instance_methods.rb +1 -0
  109. data/lib/new_relic/dependency_detection.rb +119 -9
  110. data/lib/new_relic/environment_report.rb +1 -7
  111. data/lib/new_relic/noticed_error.rb +1 -5
  112. data/lib/new_relic/supportability_helper.rb +3 -2
  113. data/lib/new_relic/version.rb +2 -2
  114. data/lib/tasks/multiverse.rb +9 -0
  115. data/newrelic_rpm.gemspec +2 -3
  116. data/test/agent_helper.rb +7 -0
  117. metadata +55 -12
  118. data/.travis.yml +0 -240
  119. data/CODE_OF_CONDUCT.md +0 -46
  120. data/cert/cacert.pem +0 -1177
  121. data/lib/new_relic/agent/instrumentation/http.rb +0 -49
  122. data/lib/new_relic/agent/instrumentation/net.rb +0 -87
  123. data/lib/new_relic/metrics.rb +0 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: efe710ed6af08e45e611d34471d346723637357202d478afa086aac1f253516f
4
- data.tar.gz: b184b7a749f8f64810aa39955c05d598ad5f747d90eb4f847b135e52024e8123
3
+ metadata.gz: 01dec51b68827b0fa9cd58d7882d9ddb29e7de80bcaa55cda486c30ff8529da9
4
+ data.tar.gz: 358e73adb1e93b0e12bc7f415df728a4a8670bed0ac4eb36b81df545cc1c4651
5
5
  SHA512:
6
- metadata.gz: 107f74976e67377a0a620ad71fa29f236d7c8325a124c702fa13d7a3687cd8210b162a8fb460f4ab4462b5badb53b2ef8082c6be47d66cd5032a915a59600ea6
7
- data.tar.gz: 76108939cf031153994e9b914a7952fab254bf457609bb521d2c095693558f686ed153331fb8d5a37cf9a2023ad77293152633407087b86ce91b1c9055372422
6
+ metadata.gz: b06d4efcd172c4517ac7be9c7271833cef6709ff18040ceaa81240bf4a3f8ce66f9c609cc78dfffbadc698cc761a2c7e7b439c72d69b024808c10d4b9873180f
7
+ data.tar.gz: 6f665d24f019d4e5c55aef8851a48f3fe7ff9735e16c41ba97cc27664fdfc9f66cdbcfd698aebe2072b12c7124431e00f4c08bdb4b15a57350d886ff98745f08
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ .ruby-version
1
2
  Gemfile.lock
2
3
  Guard*
3
4
  .DS\_Store
@@ -31,3 +32,6 @@ test/performance/script/log/
31
32
  infinite_tracing/log/
32
33
  infinite_tracing/test/new_relic/infinite_tracing/log
33
34
  test/fixtures/cross_agent_tests/*/README.md
35
+ node_modules/
36
+ yarn.lock
37
+ errors.txt
data/CHANGELOG.md CHANGED
@@ -1,38 +1,299 @@
1
1
  # New Relic Ruby Agent Release Notes #
2
2
 
3
+ ## v7.0.0
4
+
5
+ * **Ruby Agent 6.x to 7.x Migration Guide Available**
6
+
7
+ Please see our [Ruby Agent 6.x to 7.x migration guide](https://docs.newrelic.com/docs/agents/ruby-agent/getting-started/migration-7x-guide/) for helpful strategies and tips for migrating from earlier versions of the Ruby agent to 7.0.0. We cover new configuration settings, diagnosiing and installing SSL CA certificates and deprecated items and their replacements in this guide.
8
+
9
+ * **Ruby 2.0 and 2.1 Dropped**
10
+
11
+ Support for Ruby 2.0 and 2.1 dropped with this release. No code changes that would prevent the agent from continuing to
12
+ work with these releases are known. However, Rubies 2.0 and 2.1 are no longer included in our test matrices and are not supported
13
+ for 7.0.0 and onward.
14
+
15
+ * **Implemented prepend auto-instrumentation strategies for most Ruby gems/libraries**
16
+
17
+ This release brings the auto-instrumentation strategies for most gems into the modern era for Ruby by providing both
18
+ prepend and method-chaining (a.k.a. method-aliasing) strategies for auto instrumenting. Prepend, which has been available since
19
+ Ruby 2.0 is now the default strategy employed in auto-instrumenting. It is known that some external gems lead to Stack Level
20
+ too Deep exceptions when prepend and method-chaining are mixed. In such known cases, auto-instrumenting strategy will fall back
21
+ to method-chaining automatically.
22
+
23
+ This release also deprecates many overlapping and inconsistently named configuration settings in favor of being able to control
24
+ behavior of instrumentation per library with one setting that can be one of auto (the default), disabled, prepend, or chain.
25
+
26
+ Please see the above-referenced migration guide for further details.
27
+
28
+ * **Removed SSL cert bundle**
29
+
30
+ The agent will no longer ship this bundle and will rely on system certs.
31
+
32
+ * **Removed deprecated config options**
33
+
34
+ The following config options were previously deprecated and are no longer available
35
+ - `disable_active_record_4`
36
+ - `disable_active_record_5`
37
+ - `autostart.blacklisted_constants`
38
+ - `autostart.blacklisted_executables`
39
+ - `autostart.blacklisted_rake_tasks`
40
+ - `strip_exception_messages.whitelist`
41
+
42
+ * **Removed deprecated attribute**
43
+
44
+ The attribute `httpResponseCode` was previously deprecated and replaced with `http.statusCode`. This deprecated attribute has now been removed.
45
+
46
+ * **Removed deprecated option in notice_error**
47
+
48
+ Previously, the `:trace_only` option to NewRelic::Agent.notice_error was deprecated and replaced with `:expected`. This deprecated option has been removed.
49
+
50
+ * **Removed deprecated api methods**
51
+
52
+ Previously the api methods `create_distributed_trace_payload` and `accept_distributed_trace_payload` were deprecated. These have now been removed. Instead, please see `insert_distributed_trace_headers` and `accept_distributed_trace_headers`, respectively.
53
+
54
+ * **Bugfix: Prevent browser monitoring middleware from installing to middleware multiple times**
55
+
56
+ In rare cases on jRuby, the BrowserMonitoring middleware could attempt to install itself
57
+ multiple times at start up. This bug fix addresses that by using a mutex to introduce
58
+ thread safety to the operation. Sintra in particular can have this race condition because
59
+ its middleware stack is not installed until the first request is received.
60
+
61
+ * **Skip constructing Time for transactions**
62
+
63
+ Thanks to @viraptor, we are no longer constructing an unused Time object with every call to starting a new Transaction.
64
+
65
+ * **Bugfix: nil Middlewares injection now prevented and gracefully handled in Sinatra**
66
+
67
+ Previously, the agent could potentially inject multiples of an instrumented middleware if Sinatra received many
68
+ requests at once during start up and initialization due to Sinatra's ability to delay full start up as long as possible.
69
+ This has now been fixed and the Ruby agent correctly instruments only once as well as gracefully handles nil middleware
70
+ classes in general.
71
+
72
+ * **Bugfix: Ensure transaction nesting max depth is always consistent with length of segments**
73
+
74
+ Thanks to @warp for noticing and fixing the scenario where Transaction nesting_max_depth can get out of sync
75
+ with segments length resulting in an exception when attempting to nest the initial segment which does not exist.
76
+
77
+ ## v6.15.0
78
+
79
+ * **Official Ruby 3.0 support**
80
+
81
+ The ruby agent has been verified to run on ruby 3.0.0
82
+
83
+ * **Added support for Rails 6.1**
84
+
85
+ The ruby agent has been verified to run with Rails 6.1
86
+ Special thanks to @hasghari for setting this up!
87
+
88
+ * **Added support for Sidekiq 6.0, 6.1**
89
+
90
+ The ruby agent has been verified to run with both 6.0 and 6.1 versions of sidekiq
91
+
92
+ * **Bugfix: No longer overwrites sidekiq trace data**
93
+
94
+ Distributed tracing data is now added to the job trace info rather than overwriting the existing data.
95
+
96
+ * **Bugfix: Fixes cases where errors are reported for spans with no other attributes**
97
+
98
+ Previously, in cases where a span does not have any agent/custom attributes on it, but an error
99
+ is noticed and recorded against the span, a `FrozenError: can't modify frozen Hash` is thrown.
100
+ This is now fixed and errors are now correctly recorded against such span events.
101
+
102
+ * **Bugfix: `DistributedTracing.insert_distributed_trace_headers` Supportability metric now recorded**
103
+
104
+ Previously, API calls to `DistributedTracing.insert_distributed_trace_headers` would lead to an exception
105
+ about the missing supportability metric rather than flowing through the API implementation as intended.
106
+ This would potentially lead to broken distributed traces as the trace headers were not inserted on the API call.
107
+ `DistributedTracing.insert_distributed_trace_headers` now correctly records the supportability metric and
108
+ inserts the distributed trace headers as intended.
109
+
110
+ * **Bugfix: child completions after parent completes sometimes throws exception attempting to access nil parent**
111
+
112
+ In scenarios where the child segment/span is completing after the parent in jRuby, the parent may have already
113
+ been freed and no longer accessible. This would lead to an attempt to call `descendant_complete` on a Nil
114
+ object. This is fixed to protect against calling the `descendant_complete` in such cases.
115
+
116
+ * **Feature: implements `force_install_exit_handler` config flag**
117
+
118
+ The `force_install_exit_handler` configuration flag allows an application to instruct the agent to install its
119
+ graceful shutdown exit handler, which will send any locally cached data to the New Relic collector prior to the
120
+ application shutting down. This is useful for when the primary framework has an embedded Sinatra application that
121
+ is otherwise detected and skips installing the exit hook for graceful shutdowns.
122
+
123
+ * **Default prepend_net_instrumentation to false**
124
+
125
+ Previously, `prepend_net_instrumentation` defaulted to true. However, many gems are still using monkey patching on Net::HTTP, which causes compatibility issues with using prepend. Defaulting this to false minimizes instances of
126
+ unexpected compatibilty issues.
127
+
128
+ ## v6.14.0
129
+
130
+ * **Bugfix: Method tracers no longer cloning arguments**
131
+
132
+ Previously, when calling add_method_tracer with certain combination of arguments, it would lead to the wrapped method's arguments being cloned rather than passed to the original method for manipulation as intended. This has been fixed.
133
+
134
+ * **Bugfix: Delayed Job instrumentation fixed for Ruby 2.7+**
135
+
136
+ Previously, the agent was erroneousy separating positional and keyword arguments on the instrumented method calls into
137
+ Delayed Job's library. The led to Delayed job not auto-instrumenting correctly and has been fixed.
138
+
139
+ * **Bugfix: Ruby 2.7+ methods sometimes erroneously attributed compiler warnings to the Agent's `add_method_tracer`**
140
+
141
+ The specific edge cases presented are now fixed by this release of the agent. There are still some known corner-cases
142
+ that will be resolved with upcoming changes in next major release of the Agent. If you encounter a problem with adding
143
+ method tracers and compiler warnings raised, please continue to submit small repoducible examples.
144
+
145
+ * **Bugfix: Ruby 2.7+ fix for keyword arguments on Rack apps is unnecessary and removed**
146
+
147
+ A common fix for positional and keyword arguments for method parameters was implemented where it was not needed and
148
+ led to RackApps getting extra arguments converted to keyword arguments rather than Hash when it expected one. This
149
+ Ruby 2.7+ change was reverted so that Rack apps behave correctly for Ruby >= 2.7.
150
+
151
+ * **Feature: captures incoming and outgoing request headers for distributed tracing**
152
+
153
+ HTTP request headers will be logged when log level is at least debug level. Similarly, request headers
154
+ for exchanges with New Relic servers are now audit logged when audit logging is enabled.
155
+
156
+ * **Bugfix: `newrelic.yml.erb` added to the configuration search path**
157
+
158
+ Previously, when a user specifies a `newrelic.yml.erb` and no `newrelic.yml` file, the agent fails to find
159
+ the `.erb` file because it was not in the list of files searched at startup. The Ruby agent has long supported this as a
160
+ means of configuring the agent programatically. The `newrelic.yml.erb` filename is restored to the search
161
+ path and will be utilized if present. NOTE: `newrelic.yml` still takes precedence over `newrelic.yml.erb` If found,
162
+ the `.yml` file is used instead of the `.erb` file. Search directories and order of traversal remain unchanged.
163
+
164
+ * **Bugfix: dependency detection of Redis now works without raising an exception**
165
+
166
+ Previously, when detecting if Redis was available to instrument, the dependency detection would fail with an Exception raised
167
+ (with side effect of not attempting to instrument Redis). This is now fixed with a better dependency check that resolves falsly without raising an `Exception`.
168
+
169
+ * **Bugfix: Gracefully handles NilClass as a Middleware Class when instrumenting**
170
+
171
+ Previously, if a NilClass is passed as the Middleware Class to instrument when processing the middleware stack,
172
+ the agent would fail to fully load and instrument the middleware stack. This fix gracefully skips over nil classes.
173
+
174
+ * **Memory Sampler updated to recognize macOS Big Sur**
175
+
176
+ Previously, the agent was unable to recognize the platform macOS Big Sur in the memory sampler, resulting in an error being logged. The memory sampler is now able to recognize Big Sur.
177
+
178
+ * **Prepend implementation of Net::HTTP instrumentation available**
179
+
180
+ There is now a config option (`prepend_net_instrumentation`) that will enable the agent to use prepend while instrumenting Net::HTTP. This option is set to true by default.
181
+
182
+ ## v6.13.1
183
+
184
+ * **Bugfix: obfuscating URLs to external services no longer modifying original URI**
185
+
186
+ A recent change to the Ruby agent to obfuscate URIs sent to external services had the unintended side-effect of removing query parameters
187
+ from the original URI. This is fixed to obfuscate while also preserving the original URI.
188
+
189
+ Thanks to @VictorJimenezKwast for pinpointing and helpful unit test to demonstrate.
190
+
191
+ ## v6.13.0
192
+
193
+ * **Bugfix: never use redirect host when accessing preconnect endpoint**
194
+
195
+ When connecting to New Relic, the Ruby Agent uses the value in `Agent.config[:host]` to post a request to the New Relic preconnect endpoint. This endpoint returns a "redirect host" which is the URL to which agents send data from that point on.
196
+
197
+ Previously, if the agent needed to reconnect to the collector, it would incorrectly use this redirect host to call the preconnect
198
+ endpoint, when it should have used the original configured value in `Agent.config[:host]`. The agent now uses the correct host
199
+ for all calls to preconnect.
200
+
201
+ * **Bugfix: calling `add_custom_attributes` no longer modifies the params of the caller**
202
+
203
+ The previous agent's improvements to recording attributes at the span level had an unexpected
204
+ side-effect of modifying the params passed to the API call as duplicated attributes were deleted
205
+ in the process. This is now fixed and params passed in are no longer modified.
206
+
207
+ Thanks to Pete Johns (@johnsyweb) for the PR that resolves this bug.
208
+
209
+ * **Bugfix: `http.url` query parameters spans are now obfuscated**
210
+
211
+ Previously, the agent was recording the full URL of the external requests, including
212
+ the query and fragment parts of the URL as part of the attributes on the external request
213
+ span. This has been fixed so that the URL is obfuscated to filter out potentially sensitive data.
214
+
215
+ * **Use system SSL certificates by default**
216
+
217
+ The Ruby agent previously used a root SSL/TLS certificate bundle by default. Now the agent will attempt to use
218
+ the default system certificates, but will fall back to the bundled certs if there is an issue (and log that this occurred).
219
+
220
+ * **Bugfix: reduce allocations for segment attributes**
221
+
222
+ Previously, every segment received an `Attributes` object on initialization. The agent now lazily creates attributes
223
+ on segments, resulting in a significant reduction in object allocations for a typical transaction.
224
+
225
+ * **Bugfix: eliminate errors around Rake::VERSION with Rails**
226
+
227
+ When running a Rails application with rake tasks, customers could see the following error:
228
+
229
+ * **Prevent connecting agent thread from hanging on shutdown**
230
+
231
+ A bug in `Net::HTTP`'s Gzip decoder can cause the (un-catchable)
232
+ thread-kill exception to be replaced with a (catchable) `Zlib` exception,
233
+ which prevents a connecting agent thread from exiting during shutdown,
234
+ causing the Ruby process to hang indefinitely.
235
+ This workaround checks for an `aborting` thread in the `#connect` exception handler
236
+ and re-raises the exception, allowing a killed thread to continue exiting.
237
+
238
+ Thanks to Will Jordan (@wjordan) for chasing this one down and patching with tests.
239
+
240
+ * **Fix error messages about Rake instrumentation**
241
+
242
+ When running a Rails application with rake tasks, customers could see the following error in logs resulting from
243
+ a small part of rake functionality being loaded with the Rails test runner:
244
+
245
+ ```
246
+ ERROR : Error while detecting rake_instrumentation:
247
+ ERROR : NameError: uninitialized constant Rake::VERSION
248
+ ```
249
+
250
+ Such error messages should no longer appear in this context.
251
+
252
+ Thanks to @CamilleDrapier for pointing out this issue.
253
+
254
+ * **Remove NewRelic::Metrics**
255
+
256
+ The `NewRelic::Metrics` module has been removed from the agent since it is no longer used.
257
+
258
+ Thanks to @csaura for the contribution!
259
+
3
260
  ## v6.12.0
4
261
 
262
+ * The New Relic Ruby Agent is now open source under the [Apache 2 license](LICENSE)
263
+ and you can now observe the project roadmap. See our [Contributing guide](https://github.com/newrelic/newrelic-ruby-agent/blob/main/CONTRIBUTING.md)
264
+ and [Code of Conduct](https://github.com/newrelic/.github/blob/master/CODE_OF_CONDUCT.md) for details on contributing!
265
+
5
266
  * **Security: Updated all uses of Rake to >= 12.3.3**
6
267
 
7
268
  All versions of Rake testing prior to 12.3.3 were removed to address
8
269
  [CVE-2020-8130](https://nvd.nist.gov/vuln/detail/CVE-2020-8130).
9
270
  No functionality in the agent was removed nor deprecated with this change, and older versions
10
- of rake are expected to continue to work as they have in the past. However, versions of
271
+ of rake are expected to continue to work as they have in the past. However, versions of
11
272
  rake < 12.3.3 are no longer tested nor supported.
12
273
 
13
274
  * **Bugfix: fixes an error capturing content length in middleware on multi-part responses**
14
275
 
15
- In the middleware tracing, the `Content-Length` header is sometimes returned as an array of
16
- values when content is a multi-part response. Previously, the agent would fail with
17
- "NoMethodError: undefined method `to_i` for Array" Error. This bug is now fixed and
276
+ In the middleware tracing, the `Content-Length` header is sometimes returned as an array of
277
+ values when content is a multi-part response. Previously, the agent would fail with
278
+ "NoMethodError: undefined method `to_i` for Array" Error. This bug is now fixed and
18
279
  multi-part content lengths are summed for a total when an `Array` is present.
19
-
280
+
20
281
  * **Added support for auto-instrumenting Mongo gem versions 2.6 to 2.12**
21
-
282
+
22
283
  * **Bugfix: MongoDB instrumentation did not handle CommandFailed events when noticing errors**
23
284
 
24
285
  The mongo gem sometimes returns a CommandFailed object instead of a CommandSucceeded object with
25
286
  error attributes populated. The instrumentation did not handle noticing errors on CommandFailed
26
287
  objects and resulted in logging an error and backtrace to the log file.
27
288
 
28
- Additionally, a bug in recording the metric for "findAndModify" as all lowercased "findandmodify"
289
+ Additionally, a bug in recording the metric for "findAndModify" as all lowercased "findandmodify"
29
290
  for versions 2.1 through 2.5 was fixed.
30
291
 
31
292
  * **Bugfix: Priority Sampler causes crash in high throughput environents in rare cases**
32
293
 
33
294
  Previously, the priority sampling buffer would, in rare cases, generate an error in high-throughput
34
295
  environments once capacity is reached and the sampling algorthym engages. This issue is fixed.
35
-
296
+
36
297
  * **Additional Transaction Information applied to Span Events**
37
298
 
38
299
  When Distributed Tracing and/or Infinite Tracing are enabled, the Agent will now incorporate additional information from the Transaction Event on to the root Span Event of the transaction.
data/CONTRIBUTING.md CHANGED
@@ -6,8 +6,8 @@ development team.
6
6
 
7
7
  When contributing, keep in mind that the agent runs in a wide variety of Ruby
8
8
  language implementations (e.g. 2.x.x, jruby, etc.) as well as a wide variety of
9
- application environments (e.g. Rails, Sinatra, roll-your-own, etc.) See
10
- https://docs.newrelic.com/docs/agents/ruby-agent/getting-started/ruby-agent-requirements-supported-frameworks
9
+ application environments (e.g. Rails, Sinatra, roll-your-own, etc.) See [Ruby agent requirements and supported frameworks]
10
+ (https://docs.newrelic.com/docs/agents/ruby-agent/getting-started/ruby-agent-requirements-supported-frameworks)
11
11
  for the current full list.
12
12
 
13
13
  Because of this, we need to be more defensive in our coding practices than most
@@ -17,12 +17,52 @@ we can't assume the presence of any specific libraries, including `ActiveSupport
17
17
 
18
18
  ## Process
19
19
 
20
+ ### Version Support
21
+
22
+ When contributing, keep in mind that New Relic customers (that's you!) are
23
+ running many different versions of Ruby, some of them pretty old. Changes that
24
+ depend on the newest version of Ruby will probably be rejected, especially if
25
+ they replace something backwards compatible.
26
+
27
+ Be aware that the instrumentation needs to work with a wide range of versions of
28
+ the instrumented modules, and that code that looks nonsensical or
29
+ overcomplicated may be that way for compatibility-related reasons. Read all the
30
+ comments and check the related tests before deciding whether existing code is
31
+ incorrect.
32
+
33
+ If you are planning on contributing a new feature or an otherwise complex
34
+ contribution, we kindly ask you to start a conversation with the maintainer team
35
+ by opening up an Github issue first.
36
+
37
+
38
+ ### General Guidelines
39
+ The Ruby agent avoids requiring any dependencies in the main agent code base.
40
+ Instrumentations and features that would otherwise require a dependency (such as
41
+ Infinite Tracing, which require gRPC and protobuf) are built as separate gems.
42
+ If you have a feature or instrumentation request that would require a
43
+ dependency, please open an Issue to discuss with the maintainers before
44
+ proceeding.
45
+
46
+ Your code will be evaluated for completeness and accuracy in
47
+ implementation and must be accompanied with appropriate unit tests. New
48
+ additions that do not break existing tests are the easiest and quickest to be
49
+ accepted and merged. New features and improvements that break existing
50
+ functionality are slower to be accepted and merged as they require agreement
51
+ with maintainers across a majority of the languages New Relic supports. Any
52
+ such breaking changes will require a major version bump whereas non-breaking
53
+ additions only lead to minor version bumps.
54
+
55
+ Please be aware that the maintainers of New Relic’s agents aim to have as much
56
+ commonality of functionality across all language agents as makes sense, so we are
57
+ always working to reconcile language-specific changes against the cross-language
58
+ community set of agreements.
59
+
20
60
  ### Feature Requests
21
61
 
22
62
  Feature requests should be submitted in the [Issue tracker](../../issues), with
23
63
  a description of the expected behavior & use case. Before submitting an Issue,
24
64
  please search for similar ones in the [closed
25
- issues](../../issues?q=is%3Aissue+is%3Aclosed+label%3Aenhancement).
65
+ issues](../../issues?q=is%3Aissue+is%3Aclosed).
26
66
 
27
67
  ### Pull Requests
28
68
 
@@ -31,9 +71,9 @@ licensing restrictions.
31
71
 
32
72
  ### Code of Conduct
33
73
 
34
- Before contributing please read the [code of conduct](./CODE_OF_CONDUCT.md)
74
+ Before contributing please read the [code of conduct](https://github.com/newrelic/.github/blob/master/CODE_OF_CONDUCT.md)
35
75
 
36
- Note that our [code of conduct](./CODE_OF_CONDUCT.md) applies to all platforms
76
+ Note that our [code of conduct](https://github.com/newrelic/.github/blob/master/CODE_OF_CONDUCT.md) applies to all platforms
37
77
  and venues related to this project; please follow it in all your interactions
38
78
  with the project and its participants.
39
79
 
@@ -61,13 +101,16 @@ Running the test suite is simple. Just invoke:
61
101
  bundle
62
102
  bundle exec rake
63
103
 
64
- This will run the unit tests in standalone mode, bootstrapping a basic Rails
65
- 3.2 environment for the agent to instrument, then executing the test suite.
104
+ This will run the unit tests in standalone mode. You can run against a specific Rails version
105
+ by passing the version name (which should match the name of a subdirectory in test/environments)
106
+ as an argument to the test:env rake task, like this:
107
+
108
+ bundle exec rake test:env[rails60]
66
109
 
67
110
  These tests are setup to run automatically in
68
- [Travis CI](https://travis-ci.org/newrelic/rpm) under several Ruby implementations.
69
- When you've pushed your changes to GitHub, you can confirm that the Travis
70
- build passes for your fork.
111
+ [GitHub Actions](https://github.com/newrelic/newrelic-ruby-agent/actions) under several
112
+ Ruby implementations. When you've pushed your changes to GitHub, you can confirm that
113
+ the GitHub Actions test matrix passes for your fork.
71
114
 
72
115
  Additionally, our own CI jobs runs these tests under multiple versions of Rails
73
116
  to verify compatibility.
@@ -124,7 +167,7 @@ practices. Like all official New Relic open source projects, there's a related
124
167
  Community topic in the New Relic Explorers Hub. You can find this project's
125
168
  topic/threads here:
126
169
 
127
- [Explorer's Hub](https://discuss.newrelic.com/c/support-products-agents/ruby-agent)
170
+ [Explorer's Hub](https://discuss.newrelic.com/tags/rubyagent)
128
171
 
129
172
  ## And Finally...
130
173
 
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
- [![Community Project header](https://github.com/newrelic/opensource-website/raw/master/src/images/categories/Community_Project.png)](https://opensource.newrelic.com/oss-category/#community-project)
1
+ [![Community Plus header](https://github.com/newrelic/opensource-website/raw/master/src/images/categories/Community_Plus.png)](https://opensource.newrelic.com/oss-category/#community-plus)
2
2
 
3
3
  # New Relic Ruby Agent
4
4
 
5
- The New Relic Ruby agent monitors your applications to help you
6
- [identify and solve performance issues](https://docs.newrelic.com/docs/agents/ruby-agent/getting-started/introduction-new-relic-ruby#monitor-performance).
7
- You can also extend the agent's performance monitoring to
8
- [collect and analyze business data](https://docs.newrelic.com/docs/agents/ruby-agent/getting-started/introduction-new-relic-ruby#business-data)
5
+ The New Relic Ruby agent monitors your applications to help you
6
+ [identify and solve performance issues](https://docs.newrelic.com/docs/agents/ruby-agent/getting-started/introduction-new-relic-ruby#monitor-performance).
7
+ You can also extend the agent's performance monitoring to
8
+ [collect and analyze business data](https://docs.newrelic.com/docs/agents/ruby-agent/getting-started/introduction-new-relic-ruby#business-data)
9
9
  to help you improve the customer experience and make data-driven business decisions.
10
10
 
11
11
  The New Relic Ruby Agent is dual-purposed as a either a Gem or a Rails plugin,
@@ -47,7 +47,7 @@ and then require the New Relic Ruby agent in your Ruby start-up sequence:
47
47
  require 'newrelic_rpm'
48
48
  ```
49
49
 
50
- #### Oher Environments
50
+ #### Other Environments
51
51
 
52
52
  Assuming you have installed the agent per above, you may also need to tell the Ruby agent to start for some frameworks and non-framework environments. To do so, add the following to your Ruby start-up sequence start the agent:
53
53
 
@@ -79,29 +79,53 @@ for more information.
79
79
 
80
80
  ## Support
81
81
 
82
- New Relic hosts and moderates an online forum where customers can interact with New Relic employees as well as other customers to get help and share best practices. Like all official New Relic open source projects, there's a related Community topic in the New Relic Explorers Hub. You can find this project's topic/threads here:
82
+ Should you need assistance with New Relic products, you are in good hands with several support diagnostic tools and support channels.
83
83
 
84
- https://discuss.newrelic.com/c/support-products-agents/ruby-agent
84
+ This [troubleshooting framework](https://discuss.newrelic.com/t/ruby-troubleshooting-framework-install/108685) steps you through common troubleshooting questions.
85
+
86
+ New Relic offers NRDiag, [a client-side diagnostic utility](https://docs.newrelic.com/docs/using-new-relic/cross-product-functions/troubleshooting/new-relic-diagnostics) that automatically detects common problems with New Relic agents. If NRDiag detects a problem, it suggests troubleshooting steps. NRDiag can also automatically attach troubleshooting data to a New Relic Support ticket.
87
+
88
+ If the issue has been confirmed as a bug or is a Feature request, please file a Github issue.
89
+
90
+ **Support Channels**
91
+
92
+ * [New Relic Documentation](https://docs.newrelic.com/docs/agents/ruby-agent): Comprehensive guidance for using our platform
93
+ * [New Relic Community](https://discuss.newrelic.com/tags/rubyagent): The best place to engage in troubleshooting questions
94
+ * [New Relic Developer](https://developer.newrelic.com/): Resources for building a custom observability applications
95
+ * [New Relic University](https://learn.newrelic.com/): A range of online training for New Relic users of every level
96
+ * [New Relic Technical Support](https://support.newrelic.com/) 24/7/365 ticketed support. Read more about our [Technical Support Offerings](https://docs.newrelic.com/docs/licenses/license-information/general-usage-licenses/support-plan).
97
+
98
+ ## Privacy
99
+
100
+ At New Relic we take your privacy and the security of your information seriously, and are committed to protecting your information. We must emphasize the importance of not sharing personal data in public forums, and ask all users to scrub logs and diagnostic information for sensitive information, whether personal, proprietary, or otherwise.
101
+
102
+ We define “Personal Data” as any information relating to an identified or identifiable individual, including, for example, your name, phone number, post code or zip code, Device ID, IP address and email address.
103
+
104
+ Please review [New Relic’s General Data Privacy Notice](https://newrelic.com/termsandconditions/privacy) for more information.
105
+
106
+ ## Roadmap
107
+ See our [roadmap](https://github.com/newrelic/newrelic-ruby-agent/blob/main/ROADMAP.md), to learn more about our product vision, understand our plans, and provide us valuable feedback.
85
108
 
86
109
  ## Contributing
87
110
 
88
111
  We encourage contributions to improve the New Relic Ruby agent! Keep in mind when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project.
89
112
  If you have any questions, or to execute our corporate CLA, required if your contribution is on behalf of a company, please drop us an email at opensource@newrelic.com.
90
113
 
91
- If you would like to contribute to this project, please review [these guidelines](./CONTRIBUTING.md).
114
+ **A note about vulnerabilities**
115
+
116
+ As noted in our [security policy](https://github.com/newrelic/newrelic-ruby-agent/security/policy), New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.
117
+
118
+ If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through [HackerOne](https://hackerone.com/newrelic).
119
+
120
+ If you would like to contribute to this project, please review [these guidelines](https://github.com/newrelic/newrelic-ruby-agent/blob/main/CONTRIBUTING.md).
92
121
 
93
- To [all contributors](https://github.com/newrelic/newrelic-ruby-agent/graphs/contributors), we thank you! Without your contribution, this project would not be what it is today. We also host a community project page dedicated to
122
+ To [all contributors](https://github.com/newrelic/newrelic-ruby-agent/graphs/contributors), we thank you! Without your contribution, this project would not be what it is today. We also host a community project page dedicated to
94
123
  the [New Relic Ruby agent](https://opensource.newrelic.com/projects/newrelic/newrelic-ruby-agent).
95
124
 
96
125
  ## License
97
126
 
98
127
  The New Relic Ruby agent is licensed under the [Apache 2.0](http://apache.org/licenses/LICENSE-2.0.txt) License.
99
- The New Relic Ruby agent also uses source code from third-party libraries. Full details on which libraries are used and the terms under which they are licensed can be found in the [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md).
100
-
101
- ## Support
102
-
103
- You can find more detailed documentation [on our website](http://newrelic.com/docs),
104
- and specifically in the [Ruby category](http://newrelic.com/docs/ruby).
128
+ The New Relic Ruby agent also uses source code from third-party libraries. Full details on which libraries are used and the terms under which they are licensed can be found in the [THIRD_PARTY_NOTICES.md](https://github.com/newrelic/newrelic-ruby-agent/blob/main/THIRD_PARTY_NOTICES.md).
105
129
 
106
130
  ## Thank You
107
131