newrelic_rpm 8.16.0 → 9.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (262) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +4 -106
  4. data/.rubocop_todo.yml +13 -14
  5. data/.simplecov +2 -1
  6. data/Brewfile +1 -0
  7. data/CHANGELOG.md +225 -0
  8. data/CONTRIBUTING.md +1 -1
  9. data/Gemfile +1 -1
  10. data/Guardfile +8 -7
  11. data/README.md +3 -2
  12. data/Rakefile +8 -8
  13. data/Thorfile +1 -1
  14. data/bin/newrelic +1 -0
  15. data/bin/newrelic_cmd +1 -0
  16. data/bin/nrdebug +36 -36
  17. data/init.rb +1 -1
  18. data/lib/new_relic/agent/agent.rb +3 -16
  19. data/lib/new_relic/agent/agent_helpers/connect.rb +5 -10
  20. data/lib/new_relic/agent/agent_helpers/harvest.rb +4 -4
  21. data/lib/new_relic/agent/agent_helpers/shutdown.rb +5 -5
  22. data/lib/new_relic/agent/agent_helpers/special_startup.rb +3 -4
  23. data/lib/new_relic/agent/agent_helpers/start_worker_thread.rb +47 -39
  24. data/lib/new_relic/agent/agent_helpers/startup.rb +13 -13
  25. data/lib/new_relic/agent/agent_helpers/transmit.rb +6 -6
  26. data/lib/new_relic/agent/agent_logger.rb +9 -9
  27. data/lib/new_relic/agent/attribute_filter.rb +2 -4
  28. data/lib/new_relic/agent/attribute_processing.rb +2 -2
  29. data/lib/new_relic/agent/audit_logger.rb +5 -5
  30. data/lib/new_relic/agent/autostart.rb +1 -1
  31. data/lib/new_relic/agent/commands/agent_command.rb +2 -2
  32. data/lib/new_relic/agent/commands/agent_command_router.rb +5 -4
  33. data/lib/new_relic/agent/commands/thread_profiler_session.rb +8 -8
  34. data/lib/new_relic/agent/configuration/default_source.rb +200 -588
  35. data/lib/new_relic/agent/configuration/environment_source.rb +2 -2
  36. data/lib/new_relic/agent/configuration/high_security_source.rb +3 -5
  37. data/lib/new_relic/agent/configuration/manager.rb +15 -2
  38. data/lib/new_relic/agent/configuration/security_policy_source.rb +10 -26
  39. data/lib/new_relic/agent/configuration/server_source.rb +24 -24
  40. data/lib/new_relic/agent/configuration/yaml_source.rb +4 -4
  41. data/lib/new_relic/agent/connect/request_builder.rb +1 -1
  42. data/lib/new_relic/agent/connect/response_handler.rb +1 -1
  43. data/lib/new_relic/agent/custom_event_aggregator.rb +4 -4
  44. data/lib/new_relic/agent/database/explain_plan_helpers.rb +1 -1
  45. data/lib/new_relic/agent/database/obfuscation_helpers.rb +2 -2
  46. data/lib/new_relic/agent/database/obfuscator.rb +2 -2
  47. data/lib/new_relic/agent/database.rb +4 -18
  48. data/lib/new_relic/agent/datastores/metric_helper.rb +5 -5
  49. data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +11 -11
  50. data/lib/new_relic/agent/datastores/redis.rb +6 -6
  51. data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +8 -10
  52. data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +10 -10
  53. data/lib/new_relic/agent/distributed_tracing/distributed_trace_metrics.rb +7 -7
  54. data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +1 -1
  55. data/lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb +6 -6
  56. data/lib/new_relic/agent/distributed_tracing/trace_context.rb +7 -7
  57. data/lib/new_relic/agent/distributed_tracing/trace_context_payload.rb +4 -4
  58. data/lib/new_relic/agent/distributed_tracing.rb +5 -5
  59. data/lib/new_relic/agent/error_collector.rb +36 -8
  60. data/lib/new_relic/agent/error_filter.rb +5 -5
  61. data/lib/new_relic/agent/error_trace_aggregator.rb +5 -4
  62. data/lib/new_relic/agent/event_loop.rb +3 -3
  63. data/lib/new_relic/agent/external.rb +1 -1
  64. data/lib/new_relic/agent/harvester.rb +1 -3
  65. data/lib/new_relic/agent/heap.rb +2 -1
  66. data/lib/new_relic/agent/hostname.rb +1 -1
  67. data/lib/new_relic/agent/http_clients/abstract.rb +9 -21
  68. data/lib/new_relic/agent/http_clients/curb_wrappers.rb +7 -3
  69. data/lib/new_relic/agent/http_clients/excon_wrappers.rb +7 -5
  70. data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +4 -0
  71. data/lib/new_relic/agent/http_clients/httpclient_wrappers.rb +6 -2
  72. data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +5 -1
  73. data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +8 -5
  74. data/lib/new_relic/agent/http_clients/uri_util.rb +2 -2
  75. data/lib/new_relic/agent/instrumentation/action_controller_other_subscriber.rb +5 -2
  76. data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +3 -2
  77. data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +3 -3
  78. data/lib/new_relic/agent/instrumentation/active_job.rb +2 -2
  79. data/lib/new_relic/agent/instrumentation/active_merchant.rb +3 -3
  80. data/lib/new_relic/agent/instrumentation/active_record.rb +3 -2
  81. data/lib/new_relic/agent/instrumentation/active_record_helper.rb +38 -35
  82. data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +3 -3
  83. data/lib/new_relic/agent/instrumentation/active_record_prepend.rb +2 -2
  84. data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +3 -2
  85. data/lib/new_relic/agent/instrumentation/bunny/chain.rb +1 -1
  86. data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +3 -3
  87. data/lib/new_relic/agent/instrumentation/bunny.rb +1 -1
  88. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +6 -4
  89. data/lib/new_relic/agent/instrumentation/curb/chain.rb +1 -1
  90. data/lib/new_relic/agent/instrumentation/curb/instrumentation.rb +5 -5
  91. data/lib/new_relic/agent/instrumentation/curb.rb +1 -1
  92. data/lib/new_relic/agent/instrumentation/custom_events_subscriber.rb +2 -1
  93. data/lib/new_relic/agent/instrumentation/delayed_job/chain.rb +1 -0
  94. data/lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb +1 -1
  95. data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +2 -1
  96. data/lib/new_relic/agent/instrumentation/elasticsearch/chain.rb +2 -2
  97. data/lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb +4 -3
  98. data/lib/new_relic/agent/instrumentation/elasticsearch.rb +2 -2
  99. data/lib/new_relic/agent/instrumentation/excon/middleware.rb +2 -1
  100. data/lib/new_relic/agent/instrumentation/excon.rb +3 -3
  101. data/lib/new_relic/agent/instrumentation/fiber/chain.rb +20 -0
  102. data/lib/new_relic/agent/instrumentation/fiber/instrumentation.rb +24 -0
  103. data/lib/new_relic/agent/instrumentation/fiber/prepend.rb +18 -0
  104. data/lib/new_relic/agent/instrumentation/fiber.rb +25 -0
  105. data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +4 -4
  106. data/lib/new_relic/agent/instrumentation/grape.rb +4 -4
  107. data/lib/new_relic/agent/instrumentation/grpc/client/chain.rb +1 -1
  108. data/lib/new_relic/agent/instrumentation/grpc/client/instrumentation.rb +3 -2
  109. data/lib/new_relic/agent/instrumentation/grpc/client/prepend.rb +1 -1
  110. data/lib/new_relic/agent/instrumentation/grpc/client/request_wrapper.rb +1 -1
  111. data/lib/new_relic/agent/instrumentation/grpc/server/instrumentation.rb +4 -4
  112. data/lib/new_relic/agent/instrumentation/grpc_client.rb +1 -1
  113. data/lib/new_relic/agent/instrumentation/grpc_server.rb +1 -1
  114. data/lib/new_relic/agent/instrumentation/httprb.rb +1 -1
  115. data/lib/new_relic/agent/instrumentation/ignore_actions.rb +1 -1
  116. data/lib/new_relic/agent/instrumentation/logger.rb +1 -1
  117. data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +3 -1
  118. data/lib/new_relic/agent/instrumentation/memcache/instrumentation.rb +2 -2
  119. data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +3 -1
  120. data/lib/new_relic/agent/instrumentation/memcache.rb +10 -10
  121. data/lib/new_relic/agent/instrumentation/middleware_proxy.rb +3 -3
  122. data/lib/new_relic/agent/instrumentation/middleware_tracing.rb +1 -1
  123. data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +6 -6
  124. data/lib/new_relic/agent/instrumentation/net_http.rb +2 -2
  125. data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +1 -1
  126. data/lib/new_relic/agent/instrumentation/padrino/instrumentation.rb +3 -3
  127. data/lib/new_relic/agent/instrumentation/passenger_instrumentation.rb +2 -2
  128. data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +1 -1
  129. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +3 -2
  130. data/lib/new_relic/agent/instrumentation/rails_middleware.rb +1 -1
  131. data/lib/new_relic/agent/instrumentation/rake/instrumentation.rb +8 -15
  132. data/lib/new_relic/agent/instrumentation/rake.rb +3 -3
  133. data/lib/new_relic/agent/instrumentation/redis/constants.rb +1 -1
  134. data/lib/new_relic/agent/instrumentation/redis/instrumentation.rb +2 -1
  135. data/lib/new_relic/agent/instrumentation/redis.rb +1 -1
  136. data/lib/new_relic/agent/instrumentation/resque/helper.rb +1 -1
  137. data/lib/new_relic/agent/instrumentation/resque.rb +1 -1
  138. data/lib/new_relic/agent/instrumentation/sequel.rb +8 -9
  139. data/lib/new_relic/agent/instrumentation/sequel_helper.rb +10 -10
  140. data/lib/new_relic/agent/instrumentation/sidekiq/extensions/delayed_class.rb +1 -1
  141. data/lib/new_relic/agent/instrumentation/sidekiq/server.rb +1 -1
  142. data/lib/new_relic/agent/instrumentation/sidekiq.rb +1 -0
  143. data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +1 -1
  144. data/lib/new_relic/agent/instrumentation/sinatra/instrumentation.rb +6 -5
  145. data/lib/new_relic/agent/instrumentation/sinatra/transaction_namer.rb +1 -1
  146. data/lib/new_relic/agent/instrumentation/thread/instrumentation.rb +3 -7
  147. data/lib/new_relic/agent/instrumentation/tilt/instrumentation.rb +2 -1
  148. data/lib/new_relic/agent/instrumentation/typhoeus/instrumentation.rb +5 -5
  149. data/lib/new_relic/agent/javascript_instrumentor.rb +29 -24
  150. data/lib/new_relic/agent/linking_metadata.rb +2 -2
  151. data/lib/new_relic/agent/log_event_aggregator.rb +15 -15
  152. data/lib/new_relic/agent/logging.rb +73 -33
  153. data/lib/new_relic/agent/messaging.rb +7 -5
  154. data/lib/new_relic/agent/method_tracer.rb +7 -7
  155. data/lib/new_relic/agent/method_tracer_helpers.rb +1 -1
  156. data/lib/new_relic/agent/monitors/cross_app_monitor.rb +4 -5
  157. data/lib/new_relic/agent/monitors/distributed_tracing_monitor.rb +1 -1
  158. data/lib/new_relic/agent/new_relic_service/encoders.rb +1 -1
  159. data/lib/new_relic/agent/new_relic_service/json_marshaller.rb +2 -2
  160. data/lib/new_relic/agent/new_relic_service/security_policy_settings.rb +0 -1
  161. data/lib/new_relic/agent/new_relic_service.rb +15 -16
  162. data/lib/new_relic/agent/obfuscator.rb +1 -1
  163. data/lib/new_relic/agent/parameter_filtering.rb +6 -6
  164. data/lib/new_relic/agent/pipe_channel_manager.rb +7 -6
  165. data/lib/new_relic/agent/pipe_service.rb +5 -3
  166. data/lib/new_relic/agent/priority_sampled_buffer.rb +1 -1
  167. data/lib/new_relic/agent/rules_engine/segment_terms_rule.rb +0 -1
  168. data/lib/new_relic/agent/sampler.rb +2 -1
  169. data/lib/new_relic/agent/sampler_collection.rb +1 -1
  170. data/lib/new_relic/agent/samplers/cpu_sampler.rb +5 -5
  171. data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +9 -9
  172. data/lib/new_relic/agent/samplers/memory_sampler.rb +9 -9
  173. data/lib/new_relic/agent/samplers/object_sampler.rb +1 -1
  174. data/lib/new_relic/agent/span_event_aggregator.rb +4 -4
  175. data/lib/new_relic/agent/span_event_primitive.rb +2 -2
  176. data/lib/new_relic/agent/sql_sampler.rb +2 -2
  177. data/lib/new_relic/agent/stats.rb +1 -1
  178. data/lib/new_relic/agent/synthetics_event_aggregator.rb +1 -1
  179. data/lib/new_relic/agent/system_info.rb +10 -10
  180. data/lib/new_relic/agent/threading/agent_thread.rb +1 -1
  181. data/lib/new_relic/agent/threading/backtrace_node.rb +3 -3
  182. data/lib/new_relic/agent/threading/backtrace_service.rb +3 -7
  183. data/lib/new_relic/agent/threading/thread_profile.rb +5 -5
  184. data/lib/new_relic/agent/timestamp_sampled_buffer.rb +1 -1
  185. data/lib/new_relic/agent/tracer.rb +19 -9
  186. data/lib/new_relic/agent/transaction/abstract_segment.rb +54 -48
  187. data/lib/new_relic/agent/transaction/datastore_segment.rb +1 -1
  188. data/lib/new_relic/agent/transaction/distributed_tracer.rb +7 -6
  189. data/lib/new_relic/agent/transaction/distributed_tracing.rb +13 -14
  190. data/lib/new_relic/agent/transaction/external_request_segment.rb +11 -11
  191. data/lib/new_relic/agent/transaction/message_broker_segment.rb +1 -1
  192. data/lib/new_relic/agent/transaction/request_attributes.rb +2 -2
  193. data/lib/new_relic/agent/transaction/segment.rb +1 -1
  194. data/lib/new_relic/agent/transaction/synthetics_sample_buffer.rb +1 -1
  195. data/lib/new_relic/agent/transaction/trace.rb +1 -1
  196. data/lib/new_relic/agent/transaction/trace_context.rb +4 -4
  197. data/lib/new_relic/agent/transaction/trace_node.rb +8 -7
  198. data/lib/new_relic/agent/transaction/tracing.rb +10 -4
  199. data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +1 -1
  200. data/lib/new_relic/agent/transaction.rb +60 -52
  201. data/lib/new_relic/agent/transaction_error_primitive.rb +5 -5
  202. data/lib/new_relic/agent/transaction_event_aggregator.rb +4 -4
  203. data/lib/new_relic/agent/transaction_event_primitive.rb +3 -3
  204. data/lib/new_relic/agent/transaction_sampler.rb +3 -3
  205. data/lib/new_relic/agent/transaction_time_aggregator.rb +7 -3
  206. data/lib/new_relic/agent/utilization/aws.rb +1 -1
  207. data/lib/new_relic/agent/utilization/azure.rb +3 -3
  208. data/lib/new_relic/agent/utilization/gcp.rb +3 -3
  209. data/lib/new_relic/agent/utilization/pcf.rb +1 -1
  210. data/lib/new_relic/agent/utilization/vendor.rb +1 -1
  211. data/lib/new_relic/agent/vm/monotonic_gc_profiler.rb +1 -1
  212. data/lib/new_relic/agent/vm/mri_vm.rb +9 -8
  213. data/lib/new_relic/agent/worker_loop.rb +1 -1
  214. data/lib/new_relic/agent.rb +79 -35
  215. data/lib/new_relic/cli/command.rb +3 -3
  216. data/lib/new_relic/cli/commands/deployments.rb +26 -25
  217. data/lib/new_relic/cli/commands/install.rb +23 -23
  218. data/lib/new_relic/collection_helper.rb +2 -2
  219. data/lib/new_relic/constants.rb +7 -8
  220. data/lib/new_relic/control/class_methods.rb +3 -3
  221. data/lib/new_relic/control/frameworks/rails.rb +30 -18
  222. data/lib/new_relic/control/instance_methods.rb +6 -6
  223. data/lib/new_relic/control/instrumentation.rb +1 -15
  224. data/lib/new_relic/control/private_instance_methods.rb +1 -1
  225. data/lib/new_relic/dependency_detection.rb +14 -18
  226. data/lib/new_relic/environment_report.rb +4 -4
  227. data/lib/new_relic/helper.rb +2 -1
  228. data/lib/new_relic/language_support.rb +1 -1
  229. data/lib/new_relic/latest_changes.rb +5 -5
  230. data/lib/new_relic/local_environment.rb +0 -10
  231. data/lib/new_relic/noticed_error.rb +20 -18
  232. data/lib/new_relic/rack/browser_monitoring.rb +20 -16
  233. data/lib/new_relic/recipes/capistrano3.rb +1 -1
  234. data/lib/new_relic/recipes/capistrano_legacy.rb +6 -6
  235. data/lib/new_relic/recipes/helpers/send_deployment.rb +5 -5
  236. data/lib/new_relic/supportability_helper.rb +2 -1
  237. data/lib/new_relic/version.rb +3 -3
  238. data/lib/newrelic_rpm.rb +4 -4
  239. data/lib/sequel/extensions/{newrelic_instrumentation.rb → new_relic_instrumentation.rb} +5 -5
  240. data/lib/sequel/plugins/{newrelic_instrumentation.rb → new_relic_instrumentation.rb} +4 -4
  241. data/lib/tasks/config.rake +12 -12
  242. data/lib/tasks/coverage_report.rake +4 -4
  243. data/lib/tasks/helpers/format.rb +10 -10
  244. data/lib/tasks/helpers/removers.rb +5 -5
  245. data/lib/tasks/install.rake +4 -4
  246. data/lib/tasks/instrumentation_generator/instrumentation.thor +15 -18
  247. data/lib/tasks/instrumentation_generator/templates/Envfile.tt +1 -1
  248. data/lib/tasks/instrumentation_generator/templates/chain.tt +1 -1
  249. data/lib/tasks/instrumentation_generator/templates/dependency_detection.tt +1 -1
  250. data/lib/tasks/multiverse.rb +13 -6
  251. data/lib/tasks/newrelic.rb +1 -0
  252. data/lib/tasks/tests.rake +6 -6
  253. data/newrelic.yml +10 -13
  254. data/newrelic_rpm.gemspec +29 -26
  255. data/test/agent_helper.rb +25 -24
  256. metadata +84 -16
  257. data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +0 -83
  258. data/lib/new_relic/agent/instrumentation/authlogic.rb +0 -33
  259. data/lib/new_relic/agent/instrumentation/data_mapper.rb +0 -215
  260. data/lib/new_relic/agent/instrumentation/rainbows_instrumentation.rb +0 -36
  261. data/lib/new_relic/agent/instrumentation/sunspot.rb +0 -41
  262. data/lib/new_relic/agent/range_extensions.rb +0 -27
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: 8.16.0
4
+ version: 9.2.2
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: 2023-02-06 00:00:00.000000000 Z
14
+ date: 2023-05-01 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -83,6 +83,76 @@ dependencies:
83
83
  - - '='
84
84
  - !ruby/object:Gem::Version
85
85
  version: 12.3.3
86
+ - !ruby/object:Gem::Dependency
87
+ name: rubocop
88
+ requirement: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - '='
91
+ - !ruby/object:Gem::Version
92
+ version: 1.44.1
93
+ type: :development
94
+ prerelease: false
95
+ version_requirements: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - '='
98
+ - !ruby/object:Gem::Version
99
+ version: 1.44.1
100
+ - !ruby/object:Gem::Dependency
101
+ name: rubocop-ast
102
+ requirement: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - '='
105
+ - !ruby/object:Gem::Version
106
+ version: 1.24.1
107
+ type: :development
108
+ prerelease: false
109
+ version_requirements: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - '='
112
+ - !ruby/object:Gem::Version
113
+ version: 1.24.1
114
+ - !ruby/object:Gem::Dependency
115
+ name: rubocop-minitest
116
+ requirement: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - '='
119
+ - !ruby/object:Gem::Version
120
+ version: 0.27.0
121
+ type: :development
122
+ prerelease: false
123
+ version_requirements: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - '='
126
+ - !ruby/object:Gem::Version
127
+ version: 0.27.0
128
+ - !ruby/object:Gem::Dependency
129
+ name: rubocop-performance
130
+ requirement: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - '='
133
+ - !ruby/object:Gem::Version
134
+ version: 1.16.0
135
+ type: :development
136
+ prerelease: false
137
+ version_requirements: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - '='
140
+ - !ruby/object:Gem::Version
141
+ version: 1.16.0
142
+ - !ruby/object:Gem::Dependency
143
+ name: rubocop-rake
144
+ requirement: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - '='
147
+ - !ruby/object:Gem::Version
148
+ version: 0.6.0
149
+ type: :development
150
+ prerelease: false
151
+ version_requirements: !ruby/object:Gem::Requirement
152
+ requirements:
153
+ - - '='
154
+ - !ruby/object:Gem::Version
155
+ version: 0.6.0
86
156
  - !ruby/object:Gem::Dependency
87
157
  name: simplecov
88
158
  requirement: !ruby/object:Gem::Requirement
@@ -115,16 +185,16 @@ dependencies:
115
185
  name: yard
116
186
  requirement: !ruby/object:Gem::Requirement
117
187
  requirements:
118
- - - ">"
188
+ - - ">="
119
189
  - !ruby/object:Gem::Version
120
- version: 0.9.26
190
+ version: '0'
121
191
  type: :development
122
192
  prerelease: false
123
193
  version_requirements: !ruby/object:Gem::Requirement
124
194
  requirements:
125
- - - ">"
195
+ - - ">="
126
196
  - !ruby/object:Gem::Version
127
- version: 0.9.26
197
+ version: '0'
128
198
  description: |
129
199
  New Relic is a performance management system, developed by New Relic,
130
200
  Inc (http://www.newrelic.com). New Relic provides you with deep
@@ -280,8 +350,6 @@ files:
280
350
  - lib/new_relic/agent/instrumentation/active_support_logger/instrumentation.rb
281
351
  - lib/new_relic/agent/instrumentation/active_support_logger/prepend.rb
282
352
  - lib/new_relic/agent/instrumentation/active_support_subscriber.rb
283
- - lib/new_relic/agent/instrumentation/acts_as_solr.rb
284
- - lib/new_relic/agent/instrumentation/authlogic.rb
285
353
  - lib/new_relic/agent/instrumentation/bunny.rb
286
354
  - lib/new_relic/agent/instrumentation/bunny/chain.rb
287
355
  - lib/new_relic/agent/instrumentation/bunny/instrumentation.rb
@@ -297,7 +365,6 @@ files:
297
365
  - lib/new_relic/agent/instrumentation/curb/prepend.rb
298
366
  - lib/new_relic/agent/instrumentation/custom_events.rb
299
367
  - lib/new_relic/agent/instrumentation/custom_events_subscriber.rb
300
- - lib/new_relic/agent/instrumentation/data_mapper.rb
301
368
  - lib/new_relic/agent/instrumentation/delayed_job/chain.rb
302
369
  - lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb
303
370
  - lib/new_relic/agent/instrumentation/delayed_job/prepend.rb
@@ -308,6 +375,10 @@ files:
308
375
  - lib/new_relic/agent/instrumentation/elasticsearch/prepend.rb
309
376
  - lib/new_relic/agent/instrumentation/excon.rb
310
377
  - lib/new_relic/agent/instrumentation/excon/middleware.rb
378
+ - lib/new_relic/agent/instrumentation/fiber.rb
379
+ - lib/new_relic/agent/instrumentation/fiber/chain.rb
380
+ - lib/new_relic/agent/instrumentation/fiber/instrumentation.rb
381
+ - lib/new_relic/agent/instrumentation/fiber/prepend.rb
311
382
  - lib/new_relic/agent/instrumentation/grape.rb
312
383
  - lib/new_relic/agent/instrumentation/grape/chain.rb
313
384
  - lib/new_relic/agent/instrumentation/grape/instrumentation.rb
@@ -368,7 +439,6 @@ files:
368
439
  - lib/new_relic/agent/instrumentation/rails_notifications/action_controller.rb
369
440
  - lib/new_relic/agent/instrumentation/rails_notifications/action_view.rb
370
441
  - lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb
371
- - lib/new_relic/agent/instrumentation/rainbows_instrumentation.rb
372
442
  - lib/new_relic/agent/instrumentation/rake.rb
373
443
  - lib/new_relic/agent/instrumentation/rake/chain.rb
374
444
  - lib/new_relic/agent/instrumentation/rake/instrumentation.rb
@@ -396,7 +466,6 @@ files:
396
466
  - lib/new_relic/agent/instrumentation/sinatra/instrumentation.rb
397
467
  - lib/new_relic/agent/instrumentation/sinatra/prepend.rb
398
468
  - lib/new_relic/agent/instrumentation/sinatra/transaction_namer.rb
399
- - lib/new_relic/agent/instrumentation/sunspot.rb
400
469
  - lib/new_relic/agent/instrumentation/thread.rb
401
470
  - lib/new_relic/agent/instrumentation/thread/chain.rb
402
471
  - lib/new_relic/agent/instrumentation/thread/instrumentation.rb
@@ -440,7 +509,6 @@ files:
440
509
  - lib/new_relic/agent/pipe_service.rb
441
510
  - lib/new_relic/agent/prepend_supportability.rb
442
511
  - lib/new_relic/agent/priority_sampled_buffer.rb
443
- - lib/new_relic/agent/range_extensions.rb
444
512
  - lib/new_relic/agent/rules_engine.rb
445
513
  - lib/new_relic/agent/rules_engine/replacement_rule.rb
446
514
  - lib/new_relic/agent/rules_engine/segment_terms_rule.rb
@@ -544,8 +612,8 @@ files:
544
612
  - lib/new_relic/traced_thread.rb
545
613
  - lib/new_relic/version.rb
546
614
  - lib/newrelic_rpm.rb
547
- - lib/sequel/extensions/newrelic_instrumentation.rb
548
- - lib/sequel/plugins/newrelic_instrumentation.rb
615
+ - lib/sequel/extensions/new_relic_instrumentation.rb
616
+ - lib/sequel/plugins/new_relic_instrumentation.rb
549
617
  - lib/tasks/all.rb
550
618
  - lib/tasks/config.rake
551
619
  - lib/tasks/coverage_report.rake
@@ -594,14 +662,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
594
662
  requirements:
595
663
  - - ">="
596
664
  - !ruby/object:Gem::Version
597
- version: 2.2.0
665
+ version: 2.4.0
598
666
  required_rubygems_version: !ruby/object:Gem::Requirement
599
667
  requirements:
600
668
  - - ">"
601
669
  - !ruby/object:Gem::Version
602
670
  version: 1.3.1
603
671
  requirements: []
604
- rubygems_version: 3.1.6
672
+ rubygems_version: 3.4.10
605
673
  signing_key:
606
674
  specification_version: 4
607
675
  summary: New Relic Ruby Agent
@@ -1,83 +0,0 @@
1
- # This file is distributed under New Relic's license terms.
2
- # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
- # frozen_string_literal: true
4
-
5
- require 'new_relic/agent/database'
6
-
7
- module NewRelic
8
- module Instrumentation
9
- module ActsAsSolrInstrumentation
10
- module ParserMethodsInstrumentation
11
- def parse_query_with_newrelic(*args)
12
- self.class.trace_execution_scoped(["SolrClient/ActsAsSolr/query"]) do
13
- begin
14
- parse_query_without_newrelic(*args)
15
- ensure
16
- return unless txn = ::NewRelic::Agent::Tracer.current_transaction
17
-
18
- txn.current_segment.params[:statement] = ::NewRelic::Agent::Database.truncate_query(args.first.inspect) rescue nil
19
- end
20
- end
21
- end
22
- end
23
- end
24
- end
25
- end
26
-
27
- DependencyDetection.defer do
28
- @name = :acts_as_solr
29
-
30
- depends_on do
31
- defined?(ActsAsSolr)
32
- end
33
-
34
- depends_on do
35
- defined?(ActsAsSolr::ParserMethods)
36
- end
37
-
38
- depends_on do
39
- defined?(ActsAsSolr::ClassMethods)
40
- end
41
-
42
- depends_on do
43
- defined?(ActsAsSolr::CommonMethods)
44
- end
45
-
46
- executes do
47
- NewRelic::Agent.logger.info('Installing ActsAsSolr instrumentation')
48
- deprecation_msg = 'The instrumentation for ActsAsSolr is deprecated. ' \
49
- 'It will be removed in version 9.0.0.' \
50
-
51
- NewRelic::Agent.logger.log_once(
52
- :warn,
53
- :deprecated_acts_as_solr,
54
- deprecation_msg
55
- )
56
- end
57
-
58
- executes do
59
- ActsAsSolr::ParserMethods.module_eval do
60
- include NewRelic::Instrumentation::ActsAsSolrInstrumentation::ParserMethodsInstrumentation
61
- alias :parse_query_without_newrelic :parse_query
62
- alias :parse_query :parse_query_with_newrelic
63
- end
64
- end
65
-
66
- executes do
67
- ActsAsSolr::ClassMethods.module_eval do
68
- %w[find_by_solr find_id_by_solr multi_solr_search count_by_solr].each do |method|
69
- add_method_tracer method, 'SolrClient/ActsAsSolr/query'
70
- end
71
- add_method_tracer :rebuild_solr_index, 'SolrClient/ActsAsSolr/index'
72
- end
73
- end
74
-
75
- executes do
76
- ActsAsSolr::CommonMethods.module_eval do
77
- add_method_tracer :solr_add, 'SolrClient/ActsAsSolr/add'
78
- add_method_tracer :solr_delete, 'SolrClient/ActsAsSolr/delete'
79
- add_method_tracer :solr_commit, 'SolrClient/ActsAsSolr/commit'
80
- add_method_tracer :solr_optimize, 'SolrClient/ActsAsSolr/optimize'
81
- end
82
- end
83
- end
@@ -1,33 +0,0 @@
1
- # This file is distributed under New Relic's license terms.
2
- # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
- # frozen_string_literal: true
4
-
5
- DependencyDetection.defer do
6
- @name = :authlogic
7
-
8
- depends_on do
9
- defined?(Authlogic) &&
10
- defined?(Authlogic::Session) &&
11
- defined?(Authlogic::Session::Base)
12
- end
13
-
14
- executes do
15
- NewRelic::Agent.logger.info('Installing Authlogic instrumentation')
16
- deprecation_msg = 'The instrumentation for Authlogic is deprecated. ' \
17
- 'It will be removed in version 9.0.0.' \
18
-
19
- NewRelic::Agent.logger.log_once(
20
- :warn,
21
- :deprecated_authlogic,
22
- deprecation_msg
23
- )
24
- end
25
-
26
- executes do
27
- Authlogic::Session::Base.class_eval do
28
- class << self
29
- add_method_tracer :find, 'Custom/Authlogic/find'
30
- end
31
- end
32
- end
33
- end
@@ -1,215 +0,0 @@
1
- # This file is distributed under New Relic's license terms.
2
- # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
- # frozen_string_literal: true
4
-
5
- DependencyDetection.defer do
6
- named :data_mapper
7
-
8
- depends_on do
9
- defined?(DataMapper) &&
10
- defined?(DataMapper::Model) &&
11
- defined?(DataMapper::Resource) &&
12
- defined?(DataMapper::Collection)
13
- end
14
-
15
- executes do
16
- NewRelic::Agent.logger.info('Installing DataMapper instrumentation')
17
- require 'new_relic/agent/datastores/metric_helper'
18
-
19
- deprecation_msg = 'The instrumentation for DataMapper is deprecated. ' \
20
- 'It will be removed in version 9.0.0.' \
21
- 'Visit https://docs.newrelic.com/docs/apm/agents/ruby-agent/getting-started/ruby-agent-requirements-supported-frameworks ' \
22
- 'to learn about supported gems.'
23
-
24
- NewRelic::Agent.logger.log_once(
25
- :warn,
26
- :deprecated_datamapper,
27
- deprecation_msg
28
- )
29
- end
30
-
31
- executes do
32
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Model, :get)
33
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Model, :first)
34
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Model, :last)
35
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Model, :all)
36
-
37
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Model, :create)
38
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Model, :create!)
39
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Model, :update)
40
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Model, :update!)
41
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Model, :destroy)
42
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Model, :destroy!)
43
-
44
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Model, :aggregate)
45
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Model, :find)
46
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Model, :find_by_sql)
47
- end
48
-
49
- executes do
50
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Resource, :update)
51
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Resource, :update!)
52
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Resource, :save)
53
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Resource, :save!)
54
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Resource, :destroy)
55
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Resource, :destroy!)
56
- end
57
-
58
- executes do
59
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Collection, :get)
60
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Collection, :first)
61
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Collection, :last)
62
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Collection, :all)
63
-
64
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Collection, :lazy_load)
65
-
66
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Collection, :create)
67
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Collection, :create!)
68
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Collection, :update)
69
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Collection, :update!)
70
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Collection, :destroy)
71
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Collection, :destroy!)
72
-
73
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Collection, :aggregate)
74
- end
75
-
76
- executes do
77
- # Catch direct SQL calls that bypass CRUD
78
- if defined?(DataMapper::Adapters::DataObjectsAdapter)
79
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Adapters::DataObjectsAdapter, :select, true)
80
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Adapters::DataObjectsAdapter, :execute, true)
81
- end
82
- end
83
-
84
- executes do
85
- # DM::Validations overrides Model#create, so we patch it here as well
86
- if defined?(DataMapper::Validations::ClassMethods)
87
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Validations::ClassMethods, :create)
88
- end
89
- end
90
-
91
- executes do
92
- # DM::Transaction calls commit() twice, so potentially shows up twice.
93
- if defined?(DataMapper::Transaction)
94
- NewRelic::Agent::DataMapperTracing.add_tracer(DataMapper::Transaction, :commit, true)
95
- end
96
- end
97
-
98
- executes do
99
- if defined?(DataObjects::Connection)
100
- DataObjects::Connection.class_eval do
101
- include NewRelic::Agent::Instrumentation::DataMapperInstrumentation
102
- end
103
- end
104
- end
105
- end
106
-
107
- module NewRelic
108
- module Agent
109
- module DataMapperTracing
110
- def self.add_tracer(clazz, method_name, operation_only = false)
111
- clazz.class_eval do
112
- if method_defined?(method_name) || private_method_defined?(method_name)
113
- define_method("#{method_name}_with_newrelic",
114
- NewRelic::Agent::DataMapperTracing.method_body(clazz, method_name, operation_only))
115
-
116
- alias_method("#{method_name}_without_newrelic", method_name)
117
- alias_method(method_name, "#{method_name}_with_newrelic")
118
- end
119
- end
120
- end
121
-
122
- DATA_MAPPER = "DataMapper".freeze
123
- PASSWORD_REGEX = /&password=.*?(&|$)/
124
- AMPERSAND = '&'.freeze
125
- PASSWORD_PARAM = '&password='.freeze
126
-
127
- def self.method_body(clazz, method_name, operation_only)
128
- use_model_name = NewRelic::Helper.instance_methods_include?(clazz, :model)
129
- metric_operation = method_name.to_s.gsub(/[!?]/, "")
130
-
131
- proc do |*args, &blk|
132
- begin
133
- if operation_only
134
- # Used by direct SQL, like ::DataMapper::Adapters::DataObjectsAdapter#select
135
- name = nil
136
- elsif use_model_name
137
- # Used by ::DataMapper::Collection to get contained model name
138
- name = self.model.name
139
- elsif self.is_a?(Class)
140
- # Used by class-style access, like Model.first()
141
- name = self.name
142
- else
143
- # Used by instance-style access, like model.update(attr: "new")
144
- name = self.class.name
145
- end
146
-
147
- segment = NewRelic::Agent::Tracer.start_datastore_segment(
148
- product: DATA_MAPPER,
149
- operation: metric_operation,
150
- collection: name
151
- )
152
-
153
- begin
154
- NewRelic::Agent::Tracer.capture_segment_error(segment) do
155
- self.send("#{method_name}_without_newrelic", *args, &blk)
156
- end
157
- rescue ::DataObjects::ConnectionError => e
158
- raise
159
- rescue ::DataObjects::SQLError => e
160
- e.uri.gsub!(PASSWORD_REGEX, AMPERSAND) if e.uri.include?(PASSWORD_PARAM)
161
-
162
- strategy = NewRelic::Agent::Database.record_sql_method(:slow_sql)
163
- case strategy
164
- when :obfuscated
165
- adapter_name = if self.respond_to?(:options)
166
- self.options[:adapter]
167
- else
168
- if self.repository.adapter.respond_to?(:options)
169
- self.repository.adapter.options[:adapter]
170
- else
171
- # DataMapper < 0.10.0
172
- self.repository.adapter.uri.scheme
173
- end
174
- end
175
- statement = NewRelic::Agent::Database::Statement.new(e.query, :adapter => adapter_name)
176
- obfuscated_sql = NewRelic::Agent::Database.obfuscate_sql(statement)
177
- e.instance_variable_set(:@query, obfuscated_sql)
178
- when :off
179
- e.instance_variable_set(:@query, nil)
180
- end
181
-
182
- raise
183
- ensure
184
- ::NewRelic::Agent::Transaction::Segment.finish(segment)
185
- end
186
- end
187
- end
188
- end
189
- end
190
-
191
- module Instrumentation
192
- module DataMapperInstrumentation
193
- # Unlike in AR, log is called in DM after the query actually ran,
194
- # complete with metrics. Since DO has already calculated the
195
- # duration, there's nothing more to measure, so just record and log.
196
- #
197
- # We rely on the assumption that all possible entry points have been
198
- # hooked with tracers, ensuring that notice_sql attaches this SQL to
199
- # the proper call scope.
200
- def log(msg) # THREAD_LOCAL_ACCESS
201
- state = NewRelic::Agent::Tracer.state
202
- return unless state.is_execution_traced?
203
-
204
- txn = state.current_transaction
205
-
206
- if txn && txn.current_segment.respond_to?(:notice_sql)
207
- txn.current_segment.notice_sql(msg.query)
208
- end
209
- ensure
210
- super
211
- end
212
- end
213
- end
214
- end
215
- end
@@ -1,36 +0,0 @@
1
- # This file is distributed under New Relic's license terms.
2
- # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
- # frozen_string_literal: true
4
-
5
- DependencyDetection.defer do
6
- @name = :rainbows
7
-
8
- depends_on do
9
- defined?(Rainbows) && defined?(Rainbows::HttpServer)
10
- end
11
-
12
- executes do
13
- NewRelic::Agent.logger.info('Installing Rainbows instrumentation')
14
- NewRelic::Agent.logger.info('Detected Rainbows, please see additional documentation: https://newrelic.com/docs/troubleshooting/im-using-unicorn-and-i-dont-see-any-data')
15
-
16
- deprecation_msg = 'The dispatcher rainbows is deprecated. It will be removed ' \
17
- 'in version 9.0.0. Please use a supported dispatcher instead. ' \
18
- 'Visit https://docs.newrelic.com/docs/apm/agents/ruby-agent/getting-started/ruby-agent-requirements-supported-frameworks for options.'
19
-
20
- NewRelic::Agent.logger.log_once(
21
- :warn,
22
- :deprecated_rainbows_dispatcher,
23
- deprecation_msg
24
- )
25
- end
26
-
27
- executes do
28
- Rainbows::HttpServer.class_eval do
29
- old_worker_loop = instance_method(:worker_loop)
30
- define_method(:worker_loop) do |worker|
31
- NewRelic::Agent.after_fork(:force_reconnect => true)
32
- old_worker_loop.bind(self).call(worker)
33
- end
34
- end
35
- end
36
- end
@@ -1,41 +0,0 @@
1
- # This file is distributed under New Relic's license terms.
2
- # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
- # frozen_string_literal: true
4
-
5
- DependencyDetection.defer do
6
- @name = :sunspot
7
-
8
- depends_on do
9
- defined?(Sunspot)
10
- end
11
-
12
- executes do
13
- NewRelic::Agent.logger.info('Installing Rails Sunspot instrumentation')
14
- deprecation_msg = 'The instrumentation for Sunspot is deprecated. ' \
15
- 'It will be removed in version 9.0.0.'
16
-
17
- NewRelic::Agent.logger.log_once(
18
- :warn,
19
- :deprecated_sunspot,
20
- deprecation_msg
21
- )
22
- end
23
-
24
- executes do
25
- Sunspot.module_eval do
26
- class << self
27
- %w[index index!].each do |method|
28
- add_method_tracer method, 'SolrClient/Sunspot/index'
29
- end
30
- add_method_tracer :commit, 'SolrClient/Sunspot/commit'
31
-
32
- %w[search more_like_this].each do |method|
33
- add_method_tracer method, 'SolrClient/Sunspot/query'
34
- end
35
- %w[remove remove! remove_by_id remove_by_id! remove_all remove_all!].each do |method|
36
- add_method_tracer method, 'SolrClient/Sunspot/delete'
37
- end
38
- end
39
- end
40
- end
41
- end
@@ -1,27 +0,0 @@
1
- # This file is distributed under New Relic's license terms.
2
- # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
- # frozen_string_literal: true
4
-
5
- module NewRelic
6
- module Agent
7
- module RangeExtensions
8
- module_function
9
-
10
- def intersects?(r1, r2)
11
- r1.begin > r2.begin ? r2.cover?(r1.begin) : r1.cover?(r2.begin)
12
- end
13
-
14
- # Computes the amount of overlap between range and an array of ranges.
15
- # For efficiency, it assumes that range intersects with each of the
16
- # ranges in the ranges array.
17
- def compute_overlap(range, ranges)
18
- ranges.inject(0) do |memo, other|
19
- next memo unless intersects?(range, other)
20
-
21
- memo += ([range.end, other.end].min) -
22
- ([range.begin, other.begin].max)
23
- end
24
- end
25
- end
26
- end
27
- end