newrelic_rpm 8.11.0 → 8.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -3
  3. data/.rubocop_todo.yml +14 -7
  4. data/Brewfile +1 -0
  5. data/CHANGELOG.md +78 -16
  6. data/README.md +1 -1
  7. data/bin/nrdebug +2 -0
  8. data/docker-compose.yml +22 -0
  9. data/lib/new_relic/agent/agent/shutdown.rb +1 -0
  10. data/lib/new_relic/agent/agent/special_startup.rb +2 -0
  11. data/lib/new_relic/agent/agent/startup.rb +1 -0
  12. data/lib/new_relic/agent/agent_logger.rb +1 -1
  13. data/lib/new_relic/agent/attributes.rb +1 -0
  14. data/lib/new_relic/agent/audit_logger.rb +2 -1
  15. data/lib/new_relic/agent/commands/thread_profiler_session.rb +1 -0
  16. data/lib/new_relic/agent/configuration/default_source.rb +1415 -1359
  17. data/lib/new_relic/agent/configuration/dotted_hash.rb +1 -0
  18. data/lib/new_relic/agent/configuration/environment_source.rb +3 -2
  19. data/lib/new_relic/agent/configuration/high_security_source.rb +1 -0
  20. data/lib/new_relic/agent/configuration/manager.rb +3 -0
  21. data/lib/new_relic/agent/configuration/security_policy_source.rb +10 -0
  22. data/lib/new_relic/agent/configuration/yaml_source.rb +1 -0
  23. data/lib/new_relic/agent/connect/request_builder.rb +1 -0
  24. data/lib/new_relic/agent/database/obfuscation_helpers.rb +1 -0
  25. data/lib/new_relic/agent/database.rb +7 -0
  26. data/lib/new_relic/agent/database_adapter.rb +2 -0
  27. data/lib/new_relic/agent/datastores/mongo/event_formatter.rb +3 -2
  28. data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +1 -1
  29. data/lib/new_relic/agent/datastores/nosql_obfuscator.rb +41 -0
  30. data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +3 -0
  31. data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +3 -0
  32. data/lib/new_relic/agent/distributed_tracing/distributed_trace_metrics.rb +1 -0
  33. data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +1 -0
  34. data/lib/new_relic/agent/distributed_tracing/trace_context.rb +1 -0
  35. data/lib/new_relic/agent/encoding_normalizer.rb +2 -0
  36. data/lib/new_relic/agent/error_collector.rb +3 -0
  37. data/lib/new_relic/agent/error_filter.rb +1 -0
  38. data/lib/new_relic/agent/error_trace_aggregator.rb +1 -0
  39. data/lib/new_relic/agent/event_aggregator.rb +1 -0
  40. data/lib/new_relic/agent/event_loop.rb +2 -0
  41. data/lib/new_relic/agent/http_clients/abstract.rb +2 -0
  42. data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +1 -1
  43. data/lib/new_relic/agent/http_clients/httpclient_wrappers.rb +1 -1
  44. data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +1 -0
  45. data/lib/new_relic/agent/instrumentation/active_merchant.rb +1 -2
  46. data/lib/new_relic/agent/instrumentation/active_storage_subscriber.rb +2 -0
  47. data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +1 -2
  48. data/lib/new_relic/agent/instrumentation/authlogic.rb +0 -2
  49. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +1 -0
  50. data/lib/new_relic/agent/instrumentation/data_mapper.rb +0 -1
  51. data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +1 -2
  52. data/lib/new_relic/agent/instrumentation/elasticsearch/chain.rb +29 -0
  53. data/lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb +66 -0
  54. data/lib/new_relic/agent/instrumentation/elasticsearch/prepend.rb +13 -0
  55. data/lib/new_relic/agent/instrumentation/elasticsearch.rb +31 -0
  56. data/lib/new_relic/agent/instrumentation/excon.rb +17 -0
  57. data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +1 -0
  58. data/lib/new_relic/agent/instrumentation/logger/instrumentation.rb +4 -0
  59. data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +2 -0
  60. data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +2 -0
  61. data/lib/new_relic/agent/instrumentation/rack/chain.rb +10 -2
  62. data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +3 -0
  63. data/lib/new_relic/agent/instrumentation/rack/prepend.rb +9 -2
  64. data/lib/new_relic/agent/instrumentation/rainbows_instrumentation.rb +0 -1
  65. data/lib/new_relic/agent/instrumentation/rake/instrumentation.rb +1 -0
  66. data/lib/new_relic/agent/instrumentation/redis/chain.rb +18 -6
  67. data/lib/new_relic/agent/instrumentation/redis/constants.rb +17 -0
  68. data/lib/new_relic/agent/instrumentation/redis/instrumentation.rb +28 -18
  69. data/lib/new_relic/agent/instrumentation/redis/middleware.rb +16 -0
  70. data/lib/new_relic/agent/instrumentation/redis/prepend.rb +6 -0
  71. data/lib/new_relic/agent/instrumentation/redis.rb +6 -0
  72. data/lib/new_relic/agent/instrumentation/sidekiq/client.rb +20 -0
  73. data/lib/new_relic/agent/instrumentation/sidekiq/extensions/delayed_class.rb +30 -0
  74. data/lib/new_relic/agent/instrumentation/sidekiq/server.rb +37 -0
  75. data/lib/new_relic/agent/instrumentation/sidekiq.rb +7 -70
  76. data/lib/new_relic/agent/instrumentation/sinatra.rb +1 -2
  77. data/lib/new_relic/agent/instrumentation/sunspot.rb +0 -2
  78. data/lib/new_relic/agent/instrumentation/thread/instrumentation.rb +1 -0
  79. data/lib/new_relic/agent/instrumentation/tilt/instrumentation.rb +1 -0
  80. data/lib/new_relic/agent/javascript_instrumentor.rb +1 -0
  81. data/lib/new_relic/agent/local_log_decorator.rb +1 -0
  82. data/lib/new_relic/agent/log_event_aggregator.rb +1 -0
  83. data/lib/new_relic/agent/messaging.rb +1 -0
  84. data/lib/new_relic/agent/method_tracer.rb +4 -0
  85. data/lib/new_relic/agent/method_tracer_helpers.rb +1 -1
  86. data/lib/new_relic/agent/monitors/distributed_tracing_monitor.rb +1 -0
  87. data/lib/new_relic/agent/new_relic_service.rb +2 -0
  88. data/lib/new_relic/agent/parameter_filtering.rb +7 -1
  89. data/lib/new_relic/agent/pipe_channel_manager.rb +2 -0
  90. data/lib/new_relic/agent/rules_engine.rb +1 -0
  91. data/lib/new_relic/agent/samplers/cpu_sampler.rb +1 -0
  92. data/lib/new_relic/agent/samplers/memory_sampler.rb +5 -0
  93. data/lib/new_relic/agent/span_event_primitive.rb +1 -0
  94. data/lib/new_relic/agent/stats.rb +1 -0
  95. data/lib/new_relic/agent/stats_engine/gc_profiler.rb +1 -0
  96. data/lib/new_relic/agent/system_info.rb +3 -0
  97. data/lib/new_relic/agent/threading/agent_thread.rb +1 -0
  98. data/lib/new_relic/agent/threading/backtrace_service.rb +1 -0
  99. data/lib/new_relic/agent/threading/thread_profile.rb +3 -0
  100. data/lib/new_relic/agent/tracer.rb +5 -1
  101. data/lib/new_relic/agent/transaction/abstract_segment.rb +3 -0
  102. data/lib/new_relic/agent/transaction/datastore_segment.rb +3 -0
  103. data/lib/new_relic/agent/transaction/distributed_tracer.rb +4 -0
  104. data/lib/new_relic/agent/transaction/distributed_tracing.rb +1 -0
  105. data/lib/new_relic/agent/transaction/external_request_segment.rb +1 -0
  106. data/lib/new_relic/agent/transaction/message_broker_segment.rb +1 -0
  107. data/lib/new_relic/agent/transaction/segment.rb +1 -0
  108. data/lib/new_relic/agent/transaction/trace.rb +4 -0
  109. data/lib/new_relic/agent/transaction/trace_node.rb +1 -0
  110. data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +2 -0
  111. data/lib/new_relic/agent/transaction.rb +10 -0
  112. data/lib/new_relic/agent/transaction_event_aggregator.rb +1 -0
  113. data/lib/new_relic/agent/transaction_time_aggregator.rb +1 -0
  114. data/lib/new_relic/agent/utilization/pcf.rb +1 -0
  115. data/lib/new_relic/agent/utilization/vendor.rb +2 -0
  116. data/lib/new_relic/agent/utilization_data.rb +3 -0
  117. data/lib/new_relic/agent.rb +4 -2
  118. data/lib/new_relic/cli/commands/install.rb +1 -0
  119. data/lib/new_relic/coerce.rb +6 -0
  120. data/lib/new_relic/collection_helper.rb +1 -0
  121. data/lib/new_relic/constants.rb +2 -0
  122. data/lib/new_relic/control/frameworks/rails.rb +5 -0
  123. data/lib/new_relic/control/instrumentation.rb +6 -8
  124. data/lib/new_relic/dependency_detection.rb +2 -0
  125. data/lib/new_relic/helper.rb +1 -0
  126. data/lib/new_relic/language_support.rb +1 -0
  127. data/lib/new_relic/latest_changes.rb +1 -0
  128. data/lib/new_relic/local_environment.rb +7 -1
  129. data/lib/new_relic/metric_spec.rb +2 -0
  130. data/lib/new_relic/rack/agent_middleware.rb +2 -0
  131. data/lib/new_relic/rack/browser_monitoring.rb +1 -0
  132. data/lib/new_relic/traced_thread.rb +1 -0
  133. data/lib/new_relic/version.rb +1 -1
  134. data/lib/tasks/helpers/format.rb +3 -0
  135. data/lib/tasks/helpers/prompt.rb +1 -1
  136. data/lib/tasks/instrumentation_generator/README.md +2 -2
  137. data/lib/tasks/instrumentation_generator/TODO.md +5 -5
  138. data/lib/tasks/instrumentation_generator/instrumentation.thor +27 -5
  139. data/lib/tasks/instrumentation_generator/templates/chain.tt +2 -1
  140. data/lib/tasks/instrumentation_generator/templates/chain_method.tt +3 -2
  141. data/lib/tasks/instrumentation_generator/templates/instrumentation.tt +2 -1
  142. data/lib/tasks/instrumentation_generator/templates/instrumentation_method.tt +1 -1
  143. data/lib/tasks/instrumentation_generator/templates/prepend.tt +1 -1
  144. data/lib/tasks/instrumentation_generator/templates/prepend_method.tt +1 -1
  145. data/lib/tasks/instrumentation_generator/templates/test.tt +1 -1
  146. data/newrelic.yml +13 -3
  147. data/newrelic_rpm.gemspec +7 -7
  148. data/test/agent_helper.rb +24 -0
  149. metadata +18 -79
  150. data/lib/new_relic/agent/datastores/mongo/obfuscator.rb +0 -43
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0513ed874184a3e737b2663f0fb404f10ddc0f4660da2b85678a1b93f1de1c2
4
- data.tar.gz: b82877030feb527d17c10732a4bfbe9625c36c0f4a3b5fc2e57d4d389f41a857
3
+ metadata.gz: 80f041d194a8a205c71293c88db7e0a35af051a9c318bc17aa7f6e16480f43a8
4
+ data.tar.gz: e7ffe3faef8538ed09feab8e416bfa28cbf82af31a5ae518c518c8540bcd8a01
5
5
  SHA512:
6
- metadata.gz: e6ea4eaf8332be93253b1d3d9b894e59c5dee712bad8c098bc1b8c60bff904389b2ae4fb416f1d4d08b4ea36087327955d157101d523e43d1b5ddc97e382c2dc
7
- data.tar.gz: 2139d99e93eb289e976611535a46d58a826f66477931bc93ea5577a8f2c287bc9c49fd2ea9abcaf3f7b739a8c952ed58500c9aeab8daecbbd12f57f2b4d4fe4b
6
+ metadata.gz: 46a30273eca12890d0800f6959c90dc80a77097f1f6b64bb7d7d77efbdf1ee758cf8aa1c3f9da2537d5ddd64c4a996aea39d7f2c0ca1daebe8583f62605bfb0a
7
+ data.tar.gz: a9002651aa6822c657ba3928121e06cad319d1650bb891feb26c8c7f055c4e5249a9bf9e44daf69bc0b89ed26f4192d380084942aed75288c1fc3fa443eb8e93
data/.rubocop.yml CHANGED
@@ -132,9 +132,6 @@ Layout/EmptyComment:
132
132
  AllowBorderComment: true
133
133
  AllowMarginComment: true
134
134
 
135
- Layout/EmptyLineAfterGuardClause:
136
- Enabled: false
137
-
138
135
  # Disabling for now
139
136
  Layout/EmptyLineAfterMagicComment:
140
137
  Enabled: false
@@ -1337,6 +1334,7 @@ Style/MethodCallWithArgsParentheses:
1337
1334
  - include
1338
1335
  - print
1339
1336
  - puts
1337
+ - pp
1340
1338
  - raise
1341
1339
  - require
1342
1340
  - skip
data/.rubocop_todo.yml CHANGED
@@ -14,15 +14,9 @@ Metrics/AbcSize:
14
14
  - test/**/*
15
15
  - infinite_tracing/test/**/*
16
16
 
17
- # Offense count: 145
18
17
  # This cop supports safe autocorrection (--autocorrect).
19
18
  Minitest/AssertInDelta:
20
- Enabled: false
21
-
22
- # Offense count: 145
23
- # This cop supports safe autocorrection (--autocorrect).
24
- Minitest/AssertPredicate:
25
- Enabled: false
19
+ Enabled: true
26
20
 
27
21
  # Offense count: 7
28
22
  Minitest/AssertRaisesCompoundBody:
@@ -50,3 +44,16 @@ Minitest/RefutePredicate:
50
44
  # This cop supports safe autocorrection (--autocorrect).
51
45
  Minitest/TestMethodName:
52
46
  Enabled: false
47
+
48
+ Minitest/RefuteRespondTo:
49
+ Exclude:
50
+ - 'test/new_relic/cli/commands/deployments_test.rb'
51
+
52
+ Minitest/EmptyLineBeforeAssertionMethods:
53
+ Exclude:
54
+ - 'test/new_relic/agent_test.rb'
55
+ - 'test/new_relic/cli/commands/deployments_test.rb'
56
+
57
+ Style/RedundantStringEscape:
58
+ Exclude:
59
+ - 'test/new_relic/agent/logging_test.rb'
data/Brewfile CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+ brew 'elasticsearch'
2
3
  brew 'imagemagick'
3
4
  brew 'memcached'
4
5
  tap 'mongodb/brew'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,67 @@
1
1
  # New Relic Ruby Agent Release Notes #
2
2
 
3
+ ## v8.13.0
4
+
5
+ Version 8.13.0 of the agent updates our Rack, Redis, and Sidekiq instrumentation. It also delivers some bugfixes.
6
+
7
+ * **Support for Redis v5.0**
8
+
9
+ Redis v5.0 restructures where some of our instrumented methods are located and how they are named. It also introduces a new [instrumentation middleware API](https://github.com/redis-rb/redis-client#instrumentation-and-middlewares). This API is used for pipelined and multi calls to maintain reporting parity with previous Redis versions. However, it is introduced later in the chain, so you may see errors that used to appear at the segment level on the transaction instead. The agent's behavior when used with older supported Redis versions will remain unaffected. [PR#1611](https://github.com/newrelic/newrelic-ruby-agent/pull/1611)
10
+
11
+ * **Support for Sidekiq v7.0**
12
+
13
+ Sidekiq v7.0 removed Delayed Extensions and began offering client and server [middleware](https://github.com/mperham/sidekiq/blob/main/docs/middleware.md) classes to inherit from. The agent's Sidekiq instrumentation has been updated accordingly. The agent's behavior when used with older Sidekiq versions will remain unaffected. [PR#1615](https://github.com/newrelic/newrelic-ruby-agent/pull/1615)
14
+
15
+ * **Support for Rack v3.0: Rack::Builder#new accepting a block**
16
+
17
+ Via [rack/rack#1942](https://github.com/rack/rack/pull/1942) (released with Rack v3.0), `Rack::Builder#run` now optionally accepts a block instead of an app argument. The agent's instrumentation has been updated to support the use of a block with `Rack::Builder#run`. [PR#1600](https://github.com/newrelic/newrelic-ruby-agent/pull/1600)
18
+
19
+ * **Bugfix: Correctly identify Unicorn, Rainbows and FastCGI with Rack v3.0**
20
+
21
+ Unicorn, Rainbows, or FastCGI web applications using Rack v3.0 may previously have had the "dispatcher" value incorrectly reported as "Webrick" instead of "Unicorn", "Rainbows", or "FastCGI". This issue has now been addressed. [PR#1585](https://github.com/newrelic/newrelic-ruby-agent/pull/1585)
22
+
23
+ * **Bugfix: add_method_tracer fails to record code level metric attributes on private methods**
24
+
25
+ When using `add_method_tracer` on a private method, the agent was unable to record code level metrics for the method. This resulted in the following being logged to the newrelic_agent.log file.
26
+ ```
27
+ WARN : Unable to determine source code info for 'Example', method 'private_method' - NameError: undefined method 'private_method' for class '#<Class:Example>'
28
+ ```
29
+ Thank you [@jdelStrother](https://github.com/jdelStrother) for bringing this issue to our attention and suggesting a fix! [PR#1593](https://github.com/newrelic/newrelic-ruby-agent/pull/1593)
30
+
31
+
32
+ * **Bugfix: Category is a required keyword arg for NewRelic::Agent::Tracer.in_transaction**
33
+
34
+ When support for Ruby 2.0 was dropped in version 8.0.0 of the agent, the agent API methods were updated to use the required keyword argument feature built into Ruby, rather than manually raising ArgumentErrors. The API method `NewRelic::Agent::Tracer.in_transaction` removed the ArgumentError raised by the agent, but did not update the method arguments to identify `:category` as a required keyword argument. This is now resolved. Thank you [@tatzsuzuki](https://github.com/tatzsuzuki) for bringing this to our attention. [PR#1587](https://github.com/newrelic/newrelic-ruby-agent/pull/1587)
35
+
36
+ ## v8.12.0
37
+
38
+ Version 8.12.0 of the agent delivers new Elasticsearch instrumentation, increases the default number of recorded Custom Events, announces the deprecation of Ruby 2.3, and brings some valuable code cleanup.
39
+
40
+ * **Support for Elasticsearch instrumentation**
41
+
42
+ This release adds support to automatically instrument the [elasticsearch](https://rubygems.org/gems/elasticsearch) gem. Versions 7.x and 8.x are supported. [PR#1525](https://github.com/newrelic/newrelic-ruby-agent/pull/1525)
43
+
44
+ | Configuration name | Default | Behavior |
45
+ | ----------- | ----------- |----------- |
46
+ | `instrumentation.elasticsearch` | auto | Controls auto-instrumentation of the elasticsearch library at start up. May be one of `auto`, `prepend`, `chain`, `disabled`. |
47
+ | `elasticsearch.capture_queries` | true | If `true`, the agent captures Elasticsearch queries in transaction traces. |
48
+ | `elasticsearch.obfuscate_queries` | true | If `true`, the agent obfuscates Elasticsearch queries in transaction traces. |
49
+
50
+ * **Custom Event Limit Increase**
51
+
52
+ This version increases the default limit of custom events from 1000 events per minute to 3000 events per minute. In the scenario that custom events were being limited, this change will allow more custom events to be sent to New Relic. There is also a new configurable maximum limit of 100,000 events per minute. To change the limits, see the documentation for [max_samples_stored](https://docs.newrelic.com/docs/apm/agents/ruby-agent/configuration/ruby-agent-configuration/#custom_insights_events-max_samples_stored). To learn more about the change and how to determine if custom events are being dropped, see our Explorers Hub [post](https://discuss.newrelic.com/t/send-more-custom-events-with-the-latest-apm-agents/190497). [PR#1541](https://github.com/newrelic/newrelic-ruby-agent/pull/1541)
53
+
54
+ * **Deprecate support for Ruby 2.3**
55
+
56
+ Ruby 2.3 reached end of life on March 31, 2019. The Ruby agent has deprecated support for Ruby 2.3 and will make breaking changes for this version in its next major release, v9.0.0 (release date not yet planned). All 8.x.x versions of the agent will remain compatible with Ruby 2.3.
57
+
58
+ * **Cleanup: Remove orphaned code**
59
+
60
+ In both the agent and unit tests, changes have taken place over the years that have left certain bits of code unreachable. This orphaned code can complicate code maintenance and refactoring, so getting it squared away can be very helpful. Commmuniy member [@ohbarye](https://github.com/ohbarye) contributed two separate cleanup PRs for this release; one for the agent and one for the tests. [PR#1537](https://github.com/newrelic/newrelic-ruby-agent/pull/1537) [PR#1548](https://github.com/newrelic/newrelic-ruby-agent/pull/1548)
61
+
62
+ Thank you to [@ohbarye](https://github.com/ohbarye) for contributing this helpful cleanup!
63
+
64
+
3
65
  ## v8.11.0
4
66
 
5
67
  Version 8.11.0 of the agent updates the `newrelic deployments` command to work with API keys issued to newer accounts, fixes a memory leak in the instrumentation of Curb error handling, further preps for Ruby 3.2.0 support, and includes several community member driven cleanup and improvement efforts. Thank you to everyone involved!
@@ -49,15 +111,15 @@
49
111
 
50
112
 
51
113
  * **Bugfix: Missing unscoped metrics when instrumentation.thread.tracing is enabled**
52
-
114
+
53
115
  Previously, when `instrumentation.thread.tracing` was set to true, some puma applications encountered a bug where a varying number of unscoped metrics would be missing. The agent now will correctly store and send all unscoped metrics.
54
-
116
+
55
117
  Thank you to @texpert for providing details of their situation to help resolve the issue.
56
-
57
-
118
+
119
+
58
120
  * **Bugfix: gRPC instrumentation causes ArgumentError when other Google gems are present**
59
121
 
60
- Previously, when the agent had gRPC instrumentation enabled in an application using other gems (such as google-ads-googleads), the instrumentation could cause the error `ArgumentError: wrong number of arguments (given 3, expected 2)`. The gRPC instrumentation has been updated to prevent this issue from occurring in the future.
122
+ Previously, when the agent had gRPC instrumentation enabled in an application using other gems (such as google-ads-googleads), the instrumentation could cause the error `ArgumentError: wrong number of arguments (given 3, expected 2)`. The gRPC instrumentation has been updated to prevent this issue from occurring in the future.
61
123
 
62
124
  Thank you to @FeminismIsAwesome for bringing this issue to our attention.
63
125
 
@@ -94,26 +156,26 @@
94
156
 
95
157
 
96
158
  * **Bugfix: Error when setting the yaml configuration with `transaction_tracer.transaction_threshold: apdex_f`**
97
-
98
- Originally, the agent was only checking the `transaction_tracer.transaction_threshold` from the newrelic.yml correctly if it was on two lines.
159
+
160
+ Originally, the agent was only checking the `transaction_tracer.transaction_threshold` from the newrelic.yml correctly if it was on two lines.
99
161
 
100
162
  Example:
101
163
 
102
164
  ```
103
165
  # newrelic.yml
104
166
  transaction_tracer:
105
- transaction_threshold: apdex_f
167
+ transaction_threshold: apdex_f
106
168
  ```
107
169
 
108
- When this was instead changed to be on one line, the agent was not able to correctly identify the value of apdex_f.
170
+ When this was instead changed to be on one line, the agent was not able to correctly identify the value of apdex_f.
109
171
 
110
172
  Example:
111
173
  ```
112
174
  # newrelic.yml
113
175
  transaction_tracer.transaction_threshold: apdex_f
114
176
  ```
115
- This would cause prevent transactions from finishing due to the error `ArgumentError: comparison of Float with String failed`. This has now been corrected and the agent is able to process newrelic.yml with a one line `transaction_tracer.transaction_threshold: apdex_f` correctly now.
116
-
177
+ This would cause prevent transactions from finishing due to the error `ArgumentError: comparison of Float with String failed`. This has now been corrected and the agent is able to process newrelic.yml with a one line `transaction_tracer.transaction_threshold: apdex_f` correctly now.
178
+
117
179
  Thank you to @oboxodo for bringing this to our attention.
118
180
 
119
181
 
@@ -123,8 +185,8 @@
123
185
 
124
186
 
125
187
  ## v8.9.0
126
-
127
-
188
+
189
+
128
190
  * **Add support for Dalli 3.1.0 to Dalli 3.2.2**
129
191
 
130
192
  Dalli versions 3.1.0 and above include breaking changes where the agent previously hooked into the gem. We have updated our instrumentation to correctly hook into Dalli 3.1.0 and above. At this time, 3.2.2 is the latest Dalli version and is confirmed to be supported.
@@ -136,9 +198,9 @@
136
198
 
137
199
  * **Bugfix: Use read_nonblock instead of read on pipe**
138
200
 
139
- Previously, our PipeChannelManager was using read which could cause Resque jobs to get stuck in some versions. This change updates the PipeChannelManager to use read_nonblock instead. This method can leverage error handling to allow the instrumentation to gracefully log a message and exit the stuck Resque job.
201
+ Previously, our PipeChannelManager was using read which could cause Resque jobs to get stuck in some versions. This change updates the PipeChannelManager to use read_nonblock instead. This method can leverage error handling to allow the instrumentation to gracefully log a message and exit the stuck Resque job.
202
+
140
203
 
141
-
142
204
  ## v8.8.0
143
205
 
144
206
  * **Support Makara database adapters with ActiveRecord**
@@ -235,7 +297,7 @@
235
297
  * **Bugfix: Error events missing attributes when created outside of a transaction**
236
298
 
237
299
  Previously the agent was not assigning a priority to error events that were created by calling notice_error outside the scope of a transaction. This caused issues with sampling when the error event buffer was full, resulting in a `NoMethodError: undefined method '<' for nil:NilClass` in the newrelic_agent.log. This bugfix ensures that a priority is always assigned on error events so that the agent will be able to sample these error events correctly. Thank you to @olleolleolle for bringing this issue to our attention.
238
-
300
+
239
301
 
240
302
 
241
303
  ## v8.6.0
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Blue banner - Community Plus: This code is currently maintained by New Relic engineering teams and delivered here in GitHub. See the README for troubleshooting and defect reporting instructions.](https://github.com/newrelic/opensource-website/raw/master/src/images/categories/Community_Plus.png)](https://opensource.newrelic.com/oss-category/#community-plus)
1
+ [![Blue banner - Community Plus: This code is currently maintained by New Relic engineering teams and delivered here in GitHub. See the README for troubleshooting and defect reporting instructions.](https://github.com/newrelic/opensource-website/raw/main/src/images/categories/Community_Plus.png)](https://opensource.newrelic.com/oss-category/#community-plus)
2
2
 
3
3
  # New Relic Ruby Agent
4
4
 
data/bin/nrdebug CHANGED
@@ -219,6 +219,7 @@ class ProcessReport
219
219
  if c_backtraces =~ /could not attach/i
220
220
  fail("Failed to attach to target process. Please try again with sudo.")
221
221
  end
222
+
222
223
  section(f, "C Backtraces") { c_backtraces }
223
224
  section(f, "Ruby Backtrace(s)") { ruby_backtraces }
224
225
  end
@@ -282,6 +283,7 @@ end
282
283
  if !target.alive?
283
284
  fail("Could not find process with PID #{target_pid}")
284
285
  end
286
+
285
287
  target_cmd = target.procline
286
288
 
287
289
  prompt_for_confirmation(target_pid, target_cmd)
data/docker-compose.yml CHANGED
@@ -1,5 +1,25 @@
1
1
  version: "3.9"
2
2
  services:
3
+ elasticsearch7:
4
+ image: elasticsearch:7.16.2
5
+ ports:
6
+ - "9200:9200"
7
+ environment:
8
+ - discovery.type=single-node
9
+ - bootstrap.memory_lock=true
10
+ - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
11
+ mem_limit: 1g
12
+ elasticsearch8:
13
+ image: elasticsearch:8.4.2
14
+ ports:
15
+ - "9250:9250"
16
+ environment:
17
+ - discovery.type=single-node
18
+ - xpack.security.enabled=false
19
+ - http.port=9250
20
+ - bootstrap.memory_lock=true
21
+ - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
22
+ mem_limit: 1g
3
23
  mysql:
4
24
  image: mysql:5.7
5
25
  restart: always
@@ -68,6 +88,8 @@ services:
68
88
  volumes:
69
89
  - ".:/usr/src/app"
70
90
  depends_on:
91
+ - elasticsearch7
92
+ - elasticsearch8
71
93
  - mysql
72
94
  - memcached
73
95
  - mongodb
@@ -9,6 +9,7 @@ module NewRelic
9
9
  # data.
10
10
  def shutdown
11
11
  return unless started?
12
+
12
13
  ::NewRelic::Agent.logger.info("Starting Agent shutdown")
13
14
 
14
15
  stop_event_loop
@@ -57,11 +57,13 @@ module NewRelic
57
57
 
58
58
  def should_install_exit_handler?
59
59
  return false unless Agent.config[:send_data_on_exit]
60
+
60
61
  !sinatra_classic_app? || Agent.config[:force_install_exit_handler]
61
62
  end
62
63
 
63
64
  def install_exit_handler
64
65
  return unless should_install_exit_handler?
66
+
65
67
  NewRelic::Agent.logger.debug("Installing at_exit handler")
66
68
  at_exit { shutdown }
67
69
  end
@@ -37,6 +37,7 @@ module NewRelic
37
37
  def check_config_and_start_agent
38
38
  return unless monitoring? && has_correct_license_key?
39
39
  return if using_forking_dispatcher?
40
+
40
41
  setup_and_start_agent
41
42
  end
42
43
 
@@ -132,7 +132,7 @@ module NewRelic
132
132
  end
133
133
 
134
134
  def wants_stdout?
135
- ::NewRelic::Agent.config[:log_file_path].casecmp("STDOUT").zero?
135
+ ::NewRelic::Agent.config[:log_file_path].casecmp(NewRelic::STANDARD_OUT) == 0
136
136
  end
137
137
 
138
138
  def find_or_create_file_path(path_setting, root)
@@ -58,6 +58,7 @@ module NewRelic
58
58
  def merge_custom_attributes(other)
59
59
  return unless Agent.config[:'custom_attributes.enabled']
60
60
  return if other.empty?
61
+
61
62
  AttributeProcessing.flatten_and_coerce(other) do |k, v|
62
63
  add_custom_attribute(k, v)
63
64
  end
@@ -29,6 +29,7 @@ module NewRelic
29
29
 
30
30
  def log_request_headers(uri, headers)
31
31
  return unless enabled? && allowed_endpoint?(uri)
32
+
32
33
  @log.info("REQUEST HEADERS: #{headers}")
33
34
  rescue StandardError, SystemStackError, SystemCallError => e
34
35
  ::NewRelic::Agent.logger.warn("Failed writing request headers to audit log", e)
@@ -94,7 +95,7 @@ module NewRelic
94
95
  end
95
96
 
96
97
  def wants_stdout?
97
- ::NewRelic::Agent.config[:'audit_log.path'].casecmp("STDOUT").zero?
98
+ ::NewRelic::Agent.config[:'audit_log.path'].casecmp(NewRelic::STANDARD_OUT) == 0
98
99
  end
99
100
 
100
101
  def create_log_formatter
@@ -42,6 +42,7 @@ module NewRelic
42
42
 
43
43
  def stop(report_data)
44
44
  return unless running?
45
+
45
46
  NewRelic::Agent.logger.debug("Stopping Thread Profiler.")
46
47
  @finished_profile = @backtrace_service.harvest(NewRelic::Agent::Threading::BacktraceService::ALL_TRANSACTIONS)
47
48
  @backtrace_service.unsubscribe(NewRelic::Agent::Threading::BacktraceService::ALL_TRANSACTIONS)