newrelic_rpm 8.2.0 → 8.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (266) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1936 -0
  3. data/CHANGELOG.md +17 -2
  4. data/CONTRIBUTING.md +14 -2
  5. data/Guardfile +8 -8
  6. data/Rakefile +5 -7
  7. data/bin/mongrel_rpm +8 -9
  8. data/bin/newrelic +1 -1
  9. data/bin/nrdebug +14 -14
  10. data/init.rb +0 -2
  11. data/lefthook.yml +9 -0
  12. data/lib/new_relic/agent/adaptive_sampler.rb +7 -3
  13. data/lib/new_relic/agent/agent.rb +38 -40
  14. data/lib/new_relic/agent/agent_logger.rb +8 -9
  15. data/lib/new_relic/agent/attribute_filter.rb +31 -31
  16. data/lib/new_relic/agent/attributes.rb +2 -2
  17. data/lib/new_relic/agent/autostart.rb +6 -7
  18. data/lib/new_relic/agent/commands/agent_command.rb +2 -2
  19. data/lib/new_relic/agent/commands/agent_command_router.rb +6 -5
  20. data/lib/new_relic/agent/commands/thread_profiler_session.rb +0 -3
  21. data/lib/new_relic/agent/configuration/default_source.rb +318 -324
  22. data/lib/new_relic/agent/configuration/dotted_hash.rb +3 -3
  23. data/lib/new_relic/agent/configuration/environment_source.rb +3 -4
  24. data/lib/new_relic/agent/configuration/event_harvest_config.rb +2 -4
  25. data/lib/new_relic/agent/configuration/high_security_source.rb +7 -7
  26. data/lib/new_relic/agent/configuration/manager.rb +57 -57
  27. data/lib/new_relic/agent/configuration/mask_defaults.rb +1 -1
  28. data/lib/new_relic/agent/configuration/security_policy_source.rb +73 -73
  29. data/lib/new_relic/agent/configuration/server_source.rb +10 -10
  30. data/lib/new_relic/agent/configuration/yaml_source.rb +9 -9
  31. data/lib/new_relic/agent/connect/request_builder.rb +13 -16
  32. data/lib/new_relic/agent/connect/response_handler.rb +0 -3
  33. data/lib/new_relic/agent/custom_event_aggregator.rb +9 -10
  34. data/lib/new_relic/agent/database/explain_plan_helpers.rb +3 -4
  35. data/lib/new_relic/agent/database/obfuscation_helpers.rb +12 -12
  36. data/lib/new_relic/agent/database/postgres_explain_obfuscator.rb +2 -2
  37. data/lib/new_relic/agent/database.rb +20 -24
  38. data/lib/new_relic/agent/datastores/metric_helper.rb +10 -10
  39. data/lib/new_relic/agent/datastores/mongo/event_formatter.rb +2 -3
  40. data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +3 -5
  41. data/lib/new_relic/agent/datastores/mongo/obfuscator.rb +1 -2
  42. data/lib/new_relic/agent/datastores/redis.rb +2 -4
  43. data/lib/new_relic/agent/datastores.rb +1 -3
  44. data/lib/new_relic/agent/distributed_tracing/cross_app_payload.rb +5 -5
  45. data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +11 -10
  46. data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +10 -11
  47. data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +41 -42
  48. data/lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb +3 -3
  49. data/lib/new_relic/agent/distributed_tracing/trace_context.rb +41 -43
  50. data/lib/new_relic/agent/distributed_tracing/trace_context_payload.rb +23 -23
  51. data/lib/new_relic/agent/distributed_tracing.rb +17 -18
  52. data/lib/new_relic/agent/encoding_normalizer.rb +1 -1
  53. data/lib/new_relic/agent/error_collector.rb +17 -17
  54. data/lib/new_relic/agent/error_event_aggregator.rb +1 -1
  55. data/lib/new_relic/agent/error_filter.rb +6 -8
  56. data/lib/new_relic/agent/error_trace_aggregator.rb +1 -1
  57. data/lib/new_relic/agent/event_aggregator.rb +1 -1
  58. data/lib/new_relic/agent/event_buffer.rb +6 -7
  59. data/lib/new_relic/agent/event_listener.rb +0 -1
  60. data/lib/new_relic/agent/event_loop.rb +10 -10
  61. data/lib/new_relic/agent/external.rb +1 -2
  62. data/lib/new_relic/agent/guid_generator.rb +1 -3
  63. data/lib/new_relic/agent/harvester.rb +3 -4
  64. data/lib/new_relic/agent/heap.rb +1 -3
  65. data/lib/new_relic/agent/hostname.rb +3 -3
  66. data/lib/new_relic/agent/http_clients/abstract.rb +5 -7
  67. data/lib/new_relic/agent/http_clients/curb_wrappers.rb +1 -5
  68. data/lib/new_relic/agent/http_clients/excon_wrappers.rb +4 -4
  69. data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +3 -3
  70. data/lib/new_relic/agent/http_clients/httpclient_wrappers.rb +1 -2
  71. data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +2 -3
  72. data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +2 -3
  73. data/lib/new_relic/agent/http_clients/uri_util.rb +0 -1
  74. data/lib/new_relic/agent/instrumentation/action_cable_subscriber.rb +2 -3
  75. data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +9 -10
  76. data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +5 -7
  77. data/lib/new_relic/agent/instrumentation/active_job.rb +4 -3
  78. data/lib/new_relic/agent/instrumentation/active_merchant.rb +2 -2
  79. data/lib/new_relic/agent/instrumentation/active_record.rb +20 -18
  80. data/lib/new_relic/agent/instrumentation/active_record_helper.rb +36 -42
  81. data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +28 -25
  82. data/lib/new_relic/agent/instrumentation/active_record_prepend.rb +3 -3
  83. data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +5 -6
  84. data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +8 -9
  85. data/lib/new_relic/agent/instrumentation/bunny/chain.rb +1 -1
  86. data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +7 -8
  87. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +41 -41
  88. data/lib/new_relic/agent/instrumentation/curb/chain.rb +19 -20
  89. data/lib/new_relic/agent/instrumentation/curb/instrumentation.rb +34 -38
  90. data/lib/new_relic/agent/instrumentation/curb/prepend.rb +9 -10
  91. data/lib/new_relic/agent/instrumentation/data_mapper.rb +10 -10
  92. data/lib/new_relic/agent/instrumentation/delayed_job/chain.rb +5 -7
  93. data/lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb +2 -6
  94. data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +4 -4
  95. data/lib/new_relic/agent/instrumentation/excon/middleware.rb +2 -2
  96. data/lib/new_relic/agent/instrumentation/excon.rb +0 -1
  97. data/lib/new_relic/agent/instrumentation/grape/chain.rb +1 -2
  98. data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +6 -7
  99. data/lib/new_relic/agent/instrumentation/grape.rb +2 -3
  100. data/lib/new_relic/agent/instrumentation/httpclient/chain.rb +2 -3
  101. data/lib/new_relic/agent/instrumentation/httpclient/instrumentation.rb +0 -1
  102. data/lib/new_relic/agent/instrumentation/httpclient/prepend.rb +0 -2
  103. data/lib/new_relic/agent/instrumentation/httprb/chain.rb +2 -2
  104. data/lib/new_relic/agent/instrumentation/httprb/instrumentation.rb +6 -6
  105. data/lib/new_relic/agent/instrumentation/httprb/prepend.rb +1 -1
  106. data/lib/new_relic/agent/instrumentation/ignore_actions.rb +2 -3
  107. data/lib/new_relic/agent/instrumentation/logger/instrumentation.rb +0 -1
  108. data/lib/new_relic/agent/instrumentation/logger.rb +1 -1
  109. data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +2 -1
  110. data/lib/new_relic/agent/instrumentation/memcache/helper.rb +0 -1
  111. data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +1 -0
  112. data/lib/new_relic/agent/instrumentation/middleware_proxy.rb +9 -10
  113. data/lib/new_relic/agent/instrumentation/middleware_tracing.rb +4 -5
  114. data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +4 -4
  115. data/lib/new_relic/agent/instrumentation/net_http/chain.rb +3 -4
  116. data/lib/new_relic/agent/instrumentation/net_http/instrumentation.rb +5 -5
  117. data/lib/new_relic/agent/instrumentation/net_http/prepend.rb +4 -4
  118. data/lib/new_relic/agent/instrumentation/net_http.rb +1 -1
  119. data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +2 -3
  120. data/lib/new_relic/agent/instrumentation/padrino/instrumentation.rb +3 -2
  121. data/lib/new_relic/agent/instrumentation/padrino/prepend.rb +1 -1
  122. data/lib/new_relic/agent/instrumentation/padrino.rb +0 -5
  123. data/lib/new_relic/agent/instrumentation/queue_time.rb +5 -5
  124. data/lib/new_relic/agent/instrumentation/rack/chain.rb +5 -5
  125. data/lib/new_relic/agent/instrumentation/rack/helpers.rb +0 -1
  126. data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +4 -5
  127. data/lib/new_relic/agent/instrumentation/rack/prepend.rb +0 -1
  128. data/lib/new_relic/agent/instrumentation/rack.rb +1 -1
  129. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +6 -6
  130. data/lib/new_relic/agent/instrumentation/rails_notifications/action_cable.rb +2 -2
  131. data/lib/new_relic/agent/instrumentation/rails_notifications/action_controller.rb +0 -1
  132. data/lib/new_relic/agent/instrumentation/rake/chain.rb +0 -5
  133. data/lib/new_relic/agent/instrumentation/rake/instrumentation.rb +6 -6
  134. data/lib/new_relic/agent/instrumentation/rake.rb +1 -1
  135. data/lib/new_relic/agent/instrumentation/redis/chain.rb +6 -6
  136. data/lib/new_relic/agent/instrumentation/redis/instrumentation.rb +2 -2
  137. data/lib/new_relic/agent/instrumentation/redis/prepend.rb +1 -1
  138. data/lib/new_relic/agent/instrumentation/redis.rb +1 -1
  139. data/lib/new_relic/agent/instrumentation/resque/chain.rb +2 -3
  140. data/lib/new_relic/agent/instrumentation/resque/helper.rb +1 -1
  141. data/lib/new_relic/agent/instrumentation/resque/instrumentation.rb +4 -4
  142. data/lib/new_relic/agent/instrumentation/resque/prepend.rb +1 -2
  143. data/lib/new_relic/agent/instrumentation/resque.rb +7 -7
  144. data/lib/new_relic/agent/instrumentation/sequel.rb +7 -9
  145. data/lib/new_relic/agent/instrumentation/sequel_helper.rb +1 -1
  146. data/lib/new_relic/agent/instrumentation/sidekiq.rb +5 -4
  147. data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +0 -1
  148. data/lib/new_relic/agent/instrumentation/sinatra/instrumentation.rb +4 -3
  149. data/lib/new_relic/agent/instrumentation/sunspot.rb +1 -1
  150. data/lib/new_relic/agent/instrumentation/tilt/instrumentation.rb +0 -1
  151. data/lib/new_relic/agent/instrumentation/typhoeus/chain.rb +4 -4
  152. data/lib/new_relic/agent/instrumentation/typhoeus/instrumentation.rb +3 -5
  153. data/lib/new_relic/agent/instrumentation/typhoeus/prepend.rb +1 -1
  154. data/lib/new_relic/agent/internal_agent_error.rb +1 -1
  155. data/lib/new_relic/agent/javascript_instrumentor.rb +28 -28
  156. data/lib/new_relic/agent/logging.rb +8 -4
  157. data/lib/new_relic/agent/memory_logger.rb +1 -1
  158. data/lib/new_relic/agent/messaging.rb +42 -43
  159. data/lib/new_relic/agent/method_tracer.rb +9 -12
  160. data/lib/new_relic/agent/method_tracer_helpers.rb +2 -2
  161. data/lib/new_relic/agent/monitors/cross_app_monitor.rb +13 -12
  162. data/lib/new_relic/agent/monitors/distributed_tracing_monitor.rb +2 -2
  163. data/lib/new_relic/agent/monitors/inbound_request_monitor.rb +0 -1
  164. data/lib/new_relic/agent/monitors/synthetics_monitor.rb +4 -7
  165. data/lib/new_relic/agent/monitors.rb +1 -2
  166. data/lib/new_relic/agent/new_relic_service/encoders.rb +4 -4
  167. data/lib/new_relic/agent/new_relic_service/json_marshaller.rb +1 -1
  168. data/lib/new_relic/agent/new_relic_service/marshaller.rb +1 -1
  169. data/lib/new_relic/agent/new_relic_service/security_policy_settings.rb +4 -3
  170. data/lib/new_relic/agent/new_relic_service.rb +20 -20
  171. data/lib/new_relic/agent/noticible_error.rb +0 -2
  172. data/lib/new_relic/agent/null_logger.rb +6 -2
  173. data/lib/new_relic/agent/obfuscator.rb +6 -8
  174. data/lib/new_relic/agent/parameter_filtering.rb +3 -5
  175. data/lib/new_relic/agent/payload_metric_mapping.rb +8 -9
  176. data/lib/new_relic/agent/pipe_channel_manager.rb +5 -6
  177. data/lib/new_relic/agent/pipe_service.rb +1 -1
  178. data/lib/new_relic/agent/priority_sampled_buffer.rb +4 -7
  179. data/lib/new_relic/agent/rules_engine/replacement_rule.rb +9 -9
  180. data/lib/new_relic/agent/rules_engine/segment_terms_rule.rb +12 -12
  181. data/lib/new_relic/agent/rules_engine.rb +2 -2
  182. data/lib/new_relic/agent/sampler.rb +2 -3
  183. data/lib/new_relic/agent/sampler_collection.rb +2 -3
  184. data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +3 -3
  185. data/lib/new_relic/agent/samplers/memory_sampler.rb +4 -3
  186. data/lib/new_relic/agent/samplers/vm_sampler.rb +18 -18
  187. data/lib/new_relic/agent/span_event_aggregator.rb +8 -8
  188. data/lib/new_relic/agent/span_event_primitive.rb +39 -39
  189. data/lib/new_relic/agent/sql_sampler.rb +9 -9
  190. data/lib/new_relic/agent/stats.rb +16 -16
  191. data/lib/new_relic/agent/stats_engine/gc_profiler.rb +7 -9
  192. data/lib/new_relic/agent/stats_engine/stats_hash.rb +8 -9
  193. data/lib/new_relic/agent/stats_engine.rb +6 -6
  194. data/lib/new_relic/agent/synthetics_event_aggregator.rb +0 -1
  195. data/lib/new_relic/agent/system_info.rb +22 -20
  196. data/lib/new_relic/agent/threading/agent_thread.rb +4 -5
  197. data/lib/new_relic/agent/threading/backtrace_node.rb +6 -9
  198. data/lib/new_relic/agent/threading/backtrace_service.rb +8 -8
  199. data/lib/new_relic/agent/threading/thread_profile.rb +15 -18
  200. data/lib/new_relic/agent/tracer.rb +37 -43
  201. data/lib/new_relic/agent/transaction/abstract_segment.rb +6 -6
  202. data/lib/new_relic/agent/transaction/datastore_segment.rb +5 -7
  203. data/lib/new_relic/agent/transaction/distributed_tracer.rb +7 -9
  204. data/lib/new_relic/agent/transaction/distributed_tracing.rb +21 -22
  205. data/lib/new_relic/agent/transaction/external_request_segment.rb +3 -5
  206. data/lib/new_relic/agent/transaction/message_broker_segment.rb +23 -23
  207. data/lib/new_relic/agent/transaction/request_attributes.rb +7 -7
  208. data/lib/new_relic/agent/transaction/segment.rb +3 -3
  209. data/lib/new_relic/agent/transaction/slowest_sample_buffer.rb +0 -2
  210. data/lib/new_relic/agent/transaction/trace.rb +8 -8
  211. data/lib/new_relic/agent/transaction/trace_context.rb +13 -15
  212. data/lib/new_relic/agent/transaction/trace_node.rb +16 -16
  213. data/lib/new_relic/agent/transaction/tracing.rb +1 -3
  214. data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +1 -2
  215. data/lib/new_relic/agent/transaction.rb +79 -81
  216. data/lib/new_relic/agent/transaction_error_primitive.rb +16 -16
  217. data/lib/new_relic/agent/transaction_event_aggregator.rb +5 -6
  218. data/lib/new_relic/agent/transaction_event_primitive.rb +29 -29
  219. data/lib/new_relic/agent/transaction_metrics.rb +3 -3
  220. data/lib/new_relic/agent/transaction_sampler.rb +0 -1
  221. data/lib/new_relic/agent/transaction_time_aggregator.rb +6 -6
  222. data/lib/new_relic/agent/utilization/azure.rb +1 -1
  223. data/lib/new_relic/agent/utilization_data.rb +3 -4
  224. data/lib/new_relic/agent/vm/monotonic_gc_profiler.rb +1 -1
  225. data/lib/new_relic/agent/vm/snapshot.rb +3 -3
  226. data/lib/new_relic/agent/worker_loop.rb +3 -5
  227. data/lib/new_relic/agent.rb +22 -22
  228. data/lib/new_relic/cli/command.rb +15 -17
  229. data/lib/new_relic/cli/commands/deployments.rb +20 -22
  230. data/lib/new_relic/cli/commands/install.rb +6 -10
  231. data/lib/new_relic/coerce.rb +5 -8
  232. data/lib/new_relic/collection_helper.rb +48 -47
  233. data/lib/new_relic/control/class_methods.rb +2 -2
  234. data/lib/new_relic/control/frameworks/external.rb +1 -1
  235. data/lib/new_relic/control/frameworks/rails.rb +5 -6
  236. data/lib/new_relic/control/frameworks/rails3.rb +2 -3
  237. data/lib/new_relic/control/frameworks/ruby.rb +2 -2
  238. data/lib/new_relic/control/instance_methods.rb +4 -5
  239. data/lib/new_relic/control/instrumentation.rb +4 -5
  240. data/lib/new_relic/control/server_methods.rb +2 -3
  241. data/lib/new_relic/control.rb +0 -1
  242. data/lib/new_relic/dependency_detection.rb +6 -8
  243. data/lib/new_relic/environment_report.rb +16 -18
  244. data/lib/new_relic/helper.rb +5 -5
  245. data/lib/new_relic/language_support.rb +1 -1
  246. data/lib/new_relic/latest_changes.rb +2 -2
  247. data/lib/new_relic/local_environment.rb +7 -7
  248. data/lib/new_relic/metric_data.rb +6 -7
  249. data/lib/new_relic/metric_spec.rb +3 -3
  250. data/lib/new_relic/noticed_error.rb +14 -15
  251. data/lib/new_relic/rack/agent_middleware.rb +2 -2
  252. data/lib/new_relic/rack/browser_monitoring.rb +9 -9
  253. data/lib/new_relic/recipes/capistrano3.rb +11 -13
  254. data/lib/new_relic/recipes/capistrano_legacy.rb +11 -14
  255. data/lib/new_relic/supportability_helper.rb +1 -2
  256. data/lib/new_relic/version.rb +3 -4
  257. data/lib/sequel/extensions/newrelic_instrumentation.rb +4 -7
  258. data/lib/sequel/plugins/newrelic_instrumentation.rb +3 -9
  259. data/lib/tasks/all.rb +1 -1
  260. data/lib/tasks/config.rake +21 -21
  261. data/lib/tasks/multiverse.rb +4 -6
  262. data/lib/tasks/tests.rake +3 -7
  263. data/newrelic_rpm.gemspec +13 -12
  264. data/recipes/newrelic.rb +1 -1
  265. data/test/agent_helper.rb +55 -55
  266. metadata +33 -4
@@ -19,7 +19,7 @@ module NewRelic
19
19
  def instrument_save_methods
20
20
  ::ActiveRecord::Base.class_eval do
21
21
  alias_method :save_without_newrelic, :save
22
-
22
+
23
23
  def save(*args, &blk)
24
24
  ::NewRelic::Agent.with_database_metric_name(self.class.name, nil, ACTIVE_RECORD) do
25
25
  save_without_newrelic(*args, &blk)
@@ -45,7 +45,7 @@ module NewRelic
45
45
  update_all_without_newrelic(*args, &blk)
46
46
  end
47
47
  end
48
-
48
+
49
49
  alias_method :delete_all_without_newrelic, :delete_all
50
50
 
51
51
  if RUBY_VERSION < "2.7.0"
@@ -70,7 +70,6 @@ module NewRelic
70
70
  end
71
71
  end
72
72
 
73
-
74
73
  alias_method :calculate_without_newrelic, :calculate
75
74
 
76
75
  def calculate(*args, &blk)
@@ -79,7 +78,6 @@ module NewRelic
79
78
  end
80
79
  end
81
80
 
82
-
83
81
  if method_defined?(:pluck)
84
82
  alias_method :pluck_without_newrelic, :pluck
85
83
 
@@ -94,12 +92,12 @@ module NewRelic
94
92
  end
95
93
 
96
94
  ACTIVE_RECORD = "ActiveRecord".freeze
97
- OTHER = "other".freeze
95
+ OTHER = "other".freeze
98
96
 
99
97
  def product_operation_collection_for name, sql, adapter_name
100
- product = map_product(adapter_name)
101
- splits = split_name(name)
102
- model = model_from_splits(splits)
98
+ product = map_product(adapter_name)
99
+ splits = split_name(name)
100
+ model = model_from_splits(splits)
103
101
  operation = operation_from_splits(splits, sql)
104
102
  NewRelic::Agent::Datastores::MetricHelper.product_operation_collection_for product, operation, model, ACTIVE_RECORD
105
103
  end
@@ -118,8 +116,6 @@ module NewRelic
118
116
  def model_from_splits(splits)
119
117
  if splits.length == 2
120
118
  splits.first
121
- else
122
- nil
123
119
  end
124
120
  end
125
121
 
@@ -135,16 +131,16 @@ module NewRelic
135
131
  # known operations coming in. Anything not matching the list is fine,
136
132
  # it just needs to get downcased directly for use.
137
133
  OPERATION_NAMES = {
138
- 'Find' => 'find',
139
- 'Load' => 'find',
140
- 'Count' => 'find',
141
- 'Exists' => 'find',
142
- 'Create' => 'create',
134
+ 'Find' => 'find',
135
+ 'Load' => 'find',
136
+ 'Count' => 'find',
137
+ 'Exists' => 'find',
138
+ 'Create' => 'create',
143
139
  'Columns' => 'columns',
144
140
  'Indexes' => 'indexes',
145
141
  'Destroy' => 'destroy',
146
- 'Update' => 'update',
147
- 'Save' => 'save'
142
+ 'Update' => 'update',
143
+ 'Save' => 'save'
148
144
  }.freeze
149
145
 
150
146
  def map_operation(raw_operation)
@@ -155,41 +151,41 @@ module NewRelic
155
151
  end
156
152
 
157
153
  PRODUCT_NAMES = {
158
- "mysql" => "MySQL",
159
- "mysql2" => "MySQL",
154
+ "mysql" => "MySQL",
155
+ "mysql2" => "MySQL",
160
156
 
161
157
  "postgresql" => "Postgres",
162
158
 
163
- "sqlite3" => "SQLite",
159
+ "sqlite3" => "SQLite",
164
160
 
165
161
  # https://rubygems.org/gems/activerecord-jdbcpostgresql-adapter
166
- "jdbcmysql" => "MySQL",
162
+ "jdbcmysql" => "MySQL",
167
163
 
168
164
  # https://rubygems.org/gems/activerecord-jdbcpostgresql-adapter
169
165
  "jdbcpostgresql" => "Postgres",
170
-
166
+
171
167
  # https://rubygems.org/gems/activerecord-postgis-adapter
172
- "postgis" => "Postgres",
168
+ "postgis" => "Postgres",
173
169
 
174
170
  # https://rubygems.org/gems/activerecord-jdbcsqlite3-adapter
175
- "jdbcsqlite3" => "SQLite",
171
+ "jdbcsqlite3" => "SQLite",
176
172
 
177
173
  # https://rubygems.org/gems/activerecord-jdbcderby-adapter
178
- "derby" => "Derby",
179
- "jdbcderby" => "Derby",
174
+ "derby" => "Derby",
175
+ "jdbcderby" => "Derby",
180
176
 
181
177
  # https://rubygems.org/gems/activerecord-jdbc-adapter
182
- "jdbc" => "JDBC",
178
+ "jdbc" => "JDBC",
183
179
 
184
180
  # https://rubygems.org/gems/activerecord-jdbcmssql-adapter
185
- "jdbcmssql" => "MSSQL",
186
- "mssql" => "MSSQL",
181
+ "jdbcmssql" => "MSSQL",
182
+ "mssql" => "MSSQL",
187
183
 
188
184
  # https://rubygems.org/gems/activerecord-sqlserver-adapter
189
- "sqlserver" => "MSSQL",
185
+ "sqlserver" => "MSSQL",
190
186
 
191
187
  # https://rubygems.org/gems/activerecord-odbc-adapter
192
- "odbc" => "ODBC",
188
+ "odbc" => "ODBC",
193
189
 
194
190
  # https://rubygems.org/gems/activerecord-oracle_enhanced-adapter
195
191
  "oracle_enhanced" => "Oracle"
@@ -199,24 +195,24 @@ module NewRelic
199
195
 
200
196
  def map_product(adapter_name)
201
197
  PRODUCT_NAMES.fetch(adapter_name,
202
- ACTIVE_RECORD_DEFAULT_PRODUCT_NAME)
198
+ ACTIVE_RECORD_DEFAULT_PRODUCT_NAME)
203
199
  end
204
200
 
205
201
  module InstanceIdentification
206
202
  extend self
207
203
 
208
204
  PRODUCT_SYMBOLS = {
209
- "mysql" => :mysql,
210
- "mysql2" => :mysql,
211
- "jdbcmysql" => :mysql,
205
+ "mysql" => :mysql,
206
+ "mysql2" => :mysql,
207
+ "jdbcmysql" => :mysql,
212
208
 
213
- "postgresql" => :postgres,
209
+ "postgresql" => :postgres,
214
210
  "jdbcpostgresql" => :postgres,
215
- "postgis" => :postgres
211
+ "postgis" => :postgres
216
212
  }.freeze
217
213
 
218
214
  DATASTORE_DEFAULT_PORTS = {
219
- :mysql => "3306",
215
+ :mysql => "3306",
220
216
  :postgres => "5432"
221
217
  }.freeze
222
218
 
@@ -228,10 +224,10 @@ module NewRelic
228
224
  def host(config)
229
225
  return UNKNOWN unless config
230
226
 
231
- configured_value = config[:host]
227
+ configured_value = config[:host]
232
228
  adapter = PRODUCT_SYMBOLS[config[:adapter]]
233
229
  if configured_value.nil? ||
234
- postgres_unix_domain_socket_case?(configured_value, adapter)
230
+ postgres_unix_domain_socket_case?(configured_value, adapter)
235
231
 
236
232
  LOCALHOST
237
233
  elsif configured_value.empty?
@@ -239,7 +235,6 @@ module NewRelic
239
235
  else
240
236
  configured_value
241
237
  end
242
-
243
238
  rescue => e
244
239
  NewRelic::Agent.logger.debug "Failed to retrieve ActiveRecord host: #{e}"
245
240
  UNKNOWN
@@ -260,7 +255,6 @@ module NewRelic
260
255
  else
261
256
  UNKNOWN
262
257
  end
263
-
264
258
  rescue => e
265
259
  NewRelic::Agent.logger.debug "Failed to retrieve ActiveRecord port_path_or_id: #{e}"
266
260
  UNKNOWN
@@ -5,7 +5,6 @@
5
5
  require 'new_relic/agent/instrumentation/active_record_subscriber'
6
6
  require 'new_relic/agent/instrumentation/active_record_prepend'
7
7
 
8
-
9
8
  # Provides a way to send :connection through ActiveSupport notifications to avoid
10
9
  # looping through connection handlers to locate a connection by connection_id
11
10
  # This is not needed in Rails 6+: https://github.com/rails/rails/pull/34602
@@ -20,12 +19,13 @@ module NewRelic
20
19
  def log(sql, name = "SQL", binds = [], statement_name = nil)
21
20
  @instrumenter.instrument(
22
21
  SQL_ACTIVE_RECORD,
23
- :sql => sql,
24
- :name => name,
25
- :connection_id => object_id,
26
- :connection => self,
22
+ :sql => sql,
23
+ :name => name,
24
+ :connection_id => object_id,
25
+ :connection => self,
27
26
  :statement_name => statement_name,
28
- :binds => binds) { yield }
27
+ :binds => binds
28
+ ) { yield }
29
29
  rescue => e
30
30
  # The translate_exception_class method got introduced in 4.1
31
31
  if ::ActiveRecord::VERSION::MINOR == 0
@@ -41,13 +41,14 @@ module NewRelic
41
41
  def log(sql, name = "SQL", binds = [], type_casted_binds = [], statement_name = nil)
42
42
  @instrumenter.instrument(
43
43
  SQL_ACTIVE_RECORD,
44
- sql: sql,
45
- name: name,
46
- binds: binds,
44
+ sql: sql,
45
+ name: name,
46
+ binds: binds,
47
47
  type_casted_binds: type_casted_binds,
48
- statement_name: statement_name,
49
- connection_id: object_id,
50
- connection: self) { yield }
48
+ statement_name: statement_name,
49
+ connection_id: object_id,
50
+ connection: self
51
+ ) { yield }
51
52
  rescue => e
52
53
  raise translate_exception_class(e, sql)
53
54
  end
@@ -58,17 +59,18 @@ module NewRelic
58
59
  def log(sql, name = "SQL", binds = [], type_casted_binds = [], statement_name = nil) # :doc:
59
60
  @instrumenter.instrument(
60
61
  SQL_ACTIVE_RECORD,
61
- sql: sql,
62
- name: name,
63
- binds: binds,
62
+ sql: sql,
63
+ name: name,
64
+ binds: binds,
64
65
  type_casted_binds: type_casted_binds,
65
- statement_name: statement_name,
66
- connection_id: object_id,
67
- connection: self) do
68
- @lock.synchronize do
69
- yield
70
- end
66
+ statement_name: statement_name,
67
+ connection_id: object_id,
68
+ connection: self
69
+ ) do
70
+ @lock.synchronize do
71
+ yield
71
72
  end
73
+ end
72
74
  rescue => e
73
75
  raise translate_exception_class(e, sql)
74
76
  end
@@ -104,8 +106,9 @@ DependencyDetection.defer do
104
106
  executes do
105
107
  ActiveSupport.on_load(:active_record) do
106
108
  ::NewRelic::Agent::PrependSupportability.record_metrics_for(
107
- ::ActiveRecord::Base,
108
- ::ActiveRecord::Relation)
109
+ ::ActiveRecord::Base,
110
+ ::ActiveRecord::Relation
111
+ )
109
112
 
110
113
  # Default to .prepending, unless the ActiveRecord version is <=4
111
114
  # **AND** the :prepend_active_record_instrumentation config is false
@@ -113,9 +116,9 @@ DependencyDetection.defer do
113
116
  || ::NewRelic::Agent.config[:prepend_active_record_instrumentation]
114
117
 
115
118
  ::ActiveRecord::Base.send(:prepend,
116
- ::NewRelic::Agent::Instrumentation::ActiveRecordPrepend::BaseExtensions)
119
+ ::NewRelic::Agent::Instrumentation::ActiveRecordPrepend::BaseExtensions)
117
120
  ::ActiveRecord::Relation.send(:prepend,
118
- ::NewRelic::Agent::Instrumentation::ActiveRecordPrepend::RelationExtensions)
121
+ ::NewRelic::Agent::Instrumentation::ActiveRecordPrepend::RelationExtensions)
119
122
  else
120
123
  ::NewRelic::Agent::Instrumentation::ActiveRecordHelper.instrument_additional_methods
121
124
  end
@@ -11,13 +11,13 @@ module NewRelic
11
11
  ACTIVE_RECORD = 'ActiveRecord'.freeze
12
12
 
13
13
  module BaseExtensions
14
-
15
14
  if RUBY_VERSION < "2.7.0"
16
15
  def save(*args, &blk)
17
16
  ::NewRelic::Agent.with_database_metric_name(self.class.name, nil, ACTIVE_RECORD) do
18
17
  super
19
18
  end
20
19
  end
20
+
21
21
  def save!(*args, &blk)
22
22
  ::NewRelic::Agent.with_database_metric_name(self.class.name, nil, ACTIVE_RECORD) do
23
23
  super
@@ -30,11 +30,12 @@ module NewRelic
30
30
  super
31
31
  end
32
32
  end
33
+
33
34
  def save!(*args, **kwargs, &blk)
34
35
  ::NewRelic::Agent.with_database_metric_name(self.class.name, nil, ACTIVE_RECORD) do
35
36
  super
36
37
  end
37
- end
38
+ end
38
39
 
39
40
  end
40
41
  end
@@ -58,7 +59,6 @@ module NewRelic
58
59
  end
59
60
  end
60
61
  end
61
-
62
62
  end
63
63
 
64
64
  module RelationExtensions
@@ -43,7 +43,7 @@ module NewRelic
43
43
  end
44
44
  end
45
45
 
46
- def start(name, id, payload) #THREAD_LOCAL_ACCESS
46
+ def start(name, id, payload) # THREAD_LOCAL_ACCESS
47
47
  return if cached?(payload)
48
48
  return unless NewRelic::Agent.tl_is_execution_traced?
49
49
 
@@ -54,7 +54,7 @@ module NewRelic
54
54
  log_notification_error(e, name, 'start')
55
55
  end
56
56
 
57
- def finish(name, id, payload) #THREAD_LOCAL_ACCESS
57
+ def finish(name, id, payload) # THREAD_LOCAL_ACCESS
58
58
  return if cached?(payload)
59
59
  return unless state.is_execution_traced?
60
60
 
@@ -64,7 +64,6 @@ module NewRelic
64
64
  end
65
65
  segment.finish
66
66
  end
67
-
68
67
  rescue => e
69
68
  log_notification_error(e, name, 'finish')
70
69
  end
@@ -72,12 +71,12 @@ module NewRelic
72
71
  def get_explain_plan(statement)
73
72
  connection = NewRelic::Agent::Database.get_connection(statement.config) do
74
73
  ::ActiveRecord::Base.send("#{statement.config[:adapter]}_connection",
75
- statement.config)
74
+ statement.config)
76
75
  end
77
76
  if connection && connection.respond_to?(:exec_query)
78
77
  return connection.exec_query("EXPLAIN #{statement.sql}",
79
- "Explain #{statement.name}",
80
- statement.binds)
78
+ "Explain #{statement.name}",
79
+ statement.binds)
81
80
  end
82
81
  rescue => e
83
82
  NewRelic::Agent.logger.debug "Couldn't fetch the explain plan for #{statement} due to #{e}"
@@ -8,17 +8,16 @@ module NewRelic
8
8
  module Instrumentation
9
9
  module ActsAsSolrInstrumentation
10
10
  module ParserMethodsInstrumentation
11
-
12
- def parse_query_with_newrelic(*args)
13
- self.class.trace_execution_scoped(["SolrClient/ActsAsSolr/query"]) do
14
- begin
15
- parse_query_without_newrelic(*args)
16
- ensure
17
- return unless txn = ::NewRelic::Agent::Tracer.current_transaction
18
- txn.current_segment.params[:statement] = ::NewRelic::Agent::Database.truncate_query(args.first.inspect) rescue nil
19
- end
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
+ txn.current_segment.params[:statement] = ::NewRelic::Agent::Database.truncate_query(args.first.inspect) rescue nil
20
18
  end
21
19
  end
20
+ end
22
21
  end
23
22
  end
24
23
  end
@@ -42,4 +42,4 @@ module NewRelic::Agent::Instrumentation
42
42
  end
43
43
  end
44
44
  end
45
- end
45
+ end
@@ -12,7 +12,7 @@ module NewRelic
12
12
  LIBRARY = 'RabbitMQ'
13
13
  DEFAULT_NAME = 'Default'
14
14
  DEFAULT_TYPE = :direct
15
- SLASH = '/'
15
+ SLASH = '/'
16
16
 
17
17
  def exchange_name name
18
18
  name.empty? ? DEFAULT_NAME : name
@@ -74,11 +74,11 @@ module NewRelic
74
74
 
75
75
  begin
76
76
  exch_name, exch_type = if delivery_info
77
- [ exchange_name(delivery_info.exchange),
78
- exchange_type(delivery_info, channel) ]
77
+ [exchange_name(delivery_info.exchange),
78
+ exchange_type(delivery_info, channel)]
79
79
  else
80
- [ exchange_name(NewRelic::EMPTY_STR),
81
- exchange_type({}, channel) ]
80
+ [exchange_name(NewRelic::EMPTY_STR),
81
+ exchange_type({}, channel)]
82
82
  end
83
83
 
84
84
  segment = NewRelic::Agent::Messaging.start_amqp_consume_segment(
@@ -139,12 +139,11 @@ module NewRelic
139
139
  delivery_info: delivery_info,
140
140
  message_properties: message_properties,
141
141
  exchange_type: exchange_type(delivery_info, channel),
142
- queue_name: queue_name) do
143
-
142
+ queue_name: queue_name
143
+ ) do
144
144
  yield
145
145
  end
146
146
  end
147
-
148
147
  end
149
148
  end
150
149
  end
@@ -22,7 +22,6 @@ module NewRelic
22
22
  # @api public
23
23
  #
24
24
  module ControllerInstrumentation
25
-
26
25
  def self.included(clazz) # :nodoc:
27
26
  clazz.extend(ClassMethods)
28
27
  end
@@ -30,7 +29,9 @@ module NewRelic
30
29
  # This module is for importing stubs when the agent is disabled
31
30
  module ClassMethodsShim # :nodoc:
32
31
  def newrelic_ignore(*args); end
32
+
33
33
  def newrelic_ignore_apdex(*args); end
34
+
34
35
  def newrelic_ignore_enduser(*args); end
35
36
  end
36
37
 
@@ -38,14 +39,16 @@ module NewRelic
38
39
  def self.included(clazz)
39
40
  clazz.extend(ClassMethodsShim)
40
41
  end
42
+
41
43
  def new_relic_trace_controller_action(*args); yield; end
44
+
42
45
  def perform_action_with_newrelic_trace(*args); yield; end
43
46
  end
44
47
 
45
- NR_DO_NOT_TRACE_KEY = :'@do_not_trace'
46
- NR_IGNORE_APDEX_KEY = :'@ignore_apdex'
48
+ NR_DO_NOT_TRACE_KEY = :'@do_not_trace'
49
+ NR_IGNORE_APDEX_KEY = :'@ignore_apdex'
47
50
  NR_IGNORE_ENDUSER_KEY = :'@ignore_enduser'
48
- NR_DEFAULT_OPTIONS = {}.freeze
51
+ NR_DEFAULT_OPTIONS = {}.freeze
49
52
 
50
53
  # @api public
51
54
  module ClassMethods
@@ -54,31 +57,32 @@ module NewRelic
54
57
  #
55
58
  # @api public
56
59
  #
57
- def newrelic_ignore(specifiers={})
60
+ def newrelic_ignore(specifiers = {})
58
61
  NewRelic::Agent.record_api_supportability_metric(:newrelic_ignore)
59
62
  newrelic_ignore_aspect(NR_DO_NOT_TRACE_KEY, specifiers)
60
63
  end
64
+
61
65
  # Have NewRelic omit apdex measurements on the given actions. Typically used for
62
66
  # actions that are not user facing or that skew your overall apdex measurement.
63
67
  # Accepts :except and :only options, as with #newrelic_ignore.
64
68
  #
65
69
  # @api public
66
70
  #
67
- def newrelic_ignore_apdex(specifiers={})
71
+ def newrelic_ignore_apdex(specifiers = {})
68
72
  NewRelic::Agent.record_api_supportability_metric(:newrelic_ignore_apdex)
69
73
  newrelic_ignore_aspect(NR_IGNORE_APDEX_KEY, specifiers)
70
74
  end
71
75
 
72
76
  # @api public
73
- def newrelic_ignore_enduser(specifiers={})
77
+ def newrelic_ignore_enduser(specifiers = {})
74
78
  NewRelic::Agent.record_api_supportability_metric(:newrelic_ignore_enduser)
75
79
  newrelic_ignore_aspect(NR_IGNORE_ENDUSER_KEY, specifiers)
76
80
  end
77
81
 
78
- def newrelic_ignore_aspect(property, specifiers={}) # :nodoc:
82
+ def newrelic_ignore_aspect(property, specifiers = {}) # :nodoc:
79
83
  if specifiers.empty?
80
84
  self.newrelic_write_attr property, true
81
- elsif ! (Hash === specifiers)
85
+ elsif !(Hash === specifiers)
82
86
  ::NewRelic::Agent.logger.error "newrelic_#{property} takes an optional hash with :only and :except lists of actions (illegal argument type '#{specifiers.class}')"
83
87
  else
84
88
  # symbolize the incoming values
@@ -158,7 +162,7 @@ module NewRelic
158
162
  #
159
163
  # @api public
160
164
  #
161
- def add_transaction_tracer(method, options={})
165
+ def add_transaction_tracer(method, options = {})
162
166
  NewRelic::Agent.record_api_supportability_metric(:add_transaction_tracer)
163
167
 
164
168
  # The metric path:
@@ -202,54 +206,50 @@ module NewRelic
202
206
  elsif key == :params
203
207
  value.to_s
204
208
  else
205
- %Q["#{value.to_s}"]
209
+ %Q("#{value.to_s}")
206
210
  end
207
211
 
208
- %Q[:#{key} => #{value}]
212
+ %Q(:#{key} => #{value})
209
213
  end
210
214
  end
211
215
 
212
216
  def build_method_names(traced_method, punctuation)
213
- [ "#{traced_method.to_s}_with_newrelic_transaction_trace#{punctuation}",
214
- "#{traced_method.to_s}_without_newrelic_transaction_trace#{punctuation}" ]
217
+ ["#{traced_method.to_s}_with_newrelic_transaction_trace#{punctuation}",
218
+ "#{traced_method.to_s}_without_newrelic_transaction_trace#{punctuation}"]
215
219
  end
216
220
 
217
221
  def already_added_transaction_tracer?(target, with_method_name)
218
- if NewRelic::Helper.instance_methods_include?(target, with_method_name)
219
- true
220
- else
221
- false
222
- end
222
+ NewRelic::Helper.instance_methods_include?(target, with_method_name)
223
223
  end
224
224
  end
225
225
 
226
226
  # @!parse extend ClassMethods
227
227
 
228
228
  class TransactionNamer
229
- def self.name_for(txn, traced_obj, category, options={})
229
+ def self.name_for(txn, traced_obj, category, options = {})
230
230
  "#{prefix_for_category(txn, category)}#{path_name(traced_obj, options)}"
231
231
  end
232
232
 
233
233
  def self.prefix_for_category(txn, category = nil)
234
234
  category ||= (txn && txn.category)
235
235
  case category
236
- when :controller then ::NewRelic::Agent::Transaction::CONTROLLER_PREFIX
237
- when :web then ::NewRelic::Agent::Transaction::CONTROLLER_PREFIX
238
- when :task then ::NewRelic::Agent::Transaction::TASK_PREFIX
239
- when :background then ::NewRelic::Agent::Transaction::TASK_PREFIX
240
- when :rack then ::NewRelic::Agent::Transaction::RACK_PREFIX
241
- when :uri then ::NewRelic::Agent::Transaction::CONTROLLER_PREFIX
242
- when :sinatra then ::NewRelic::Agent::Transaction::SINATRA_PREFIX
243
- when :middleware then ::NewRelic::Agent::Transaction::MIDDLEWARE_PREFIX
244
- when :grape then ::NewRelic::Agent::Transaction::GRAPE_PREFIX
245
- when :rake then ::NewRelic::Agent::Transaction::RAKE_PREFIX
246
- when :action_cable then ::NewRelic::Agent::Transaction::ACTION_CABLE_PREFIX
247
- when :message then ::NewRelic::Agent::Transaction::MESSAGE_PREFIX
236
+ when :controller then ::NewRelic::Agent::Transaction::CONTROLLER_PREFIX
237
+ when :web then ::NewRelic::Agent::Transaction::CONTROLLER_PREFIX
238
+ when :task then ::NewRelic::Agent::Transaction::TASK_PREFIX
239
+ when :background then ::NewRelic::Agent::Transaction::TASK_PREFIX
240
+ when :rack then ::NewRelic::Agent::Transaction::RACK_PREFIX
241
+ when :uri then ::NewRelic::Agent::Transaction::CONTROLLER_PREFIX
242
+ when :sinatra then ::NewRelic::Agent::Transaction::SINATRA_PREFIX
243
+ when :middleware then ::NewRelic::Agent::Transaction::MIDDLEWARE_PREFIX
244
+ when :grape then ::NewRelic::Agent::Transaction::GRAPE_PREFIX
245
+ when :rake then ::NewRelic::Agent::Transaction::RAKE_PREFIX
246
+ when :action_cable then ::NewRelic::Agent::Transaction::ACTION_CABLE_PREFIX
247
+ when :message then ::NewRelic::Agent::Transaction::MESSAGE_PREFIX
248
248
  else "#{category.to_s}/" # for internal use only
249
249
  end
250
250
  end
251
251
 
252
- def self.path_name(traced_obj, options={})
252
+ def self.path_name(traced_obj, options = {})
253
253
  return options[:path] if options[:path]
254
254
 
255
255
  class_name = class_name(traced_obj, options)
@@ -266,9 +266,9 @@ module NewRelic
266
266
  end
267
267
  end
268
268
 
269
- def self.class_name(traced_obj, options={})
269
+ def self.class_name(traced_obj, options = {})
270
270
  return options[:class_name] if options[:class_name]
271
- if (traced_obj.is_a?(Class) || traced_obj.is_a?(Module))
271
+ if traced_obj.is_a?(Class) || traced_obj.is_a?(Module)
272
272
  traced_obj.name
273
273
  else
274
274
  traced_obj.class.name
@@ -345,7 +345,7 @@ module NewRelic
345
345
  #
346
346
  # @api public
347
347
  #
348
- def perform_action_with_newrelic_trace(*args, &block) #THREAD_LOCAL_ACCESS
348
+ def perform_action_with_newrelic_trace(*args, &block) # THREAD_LOCAL_ACCESS
349
349
  NewRelic::Agent.record_api_supportability_metric(:perform_action_with_newrelic_trace)
350
350
  state = NewRelic::Agent::Tracer.state
351
351
  request = newrelic_request(args)
@@ -363,8 +363,8 @@ module NewRelic
363
363
  # the *args method signature to ensure backwards compatibility.
364
364
 
365
365
  trace_options = args.last.is_a?(Hash) ? args.last : NR_DEFAULT_OPTIONS
366
- category = trace_options[:category] || :controller
367
- txn_options = create_transaction_options(trace_options, category, state, queue_start_time)
366
+ category = trace_options[:category] || :controller
367
+ txn_options = create_transaction_options(trace_options, category, state, queue_start_time)
368
368
 
369
369
  begin
370
370
  finishable = Tracer.start_transaction_or_segment(
@@ -379,7 +379,6 @@ module NewRelic
379
379
  NewRelic::Agent.notice_error(e)
380
380
  raise
381
381
  end
382
-
383
382
  ensure
384
383
  finishable.finish if finishable
385
384
  end
@@ -434,7 +433,7 @@ module NewRelic
434
433
 
435
434
  def create_transaction_options(trace_options, category, state, queue_start_time)
436
435
  txn_options = {}
437
- txn_options[:request] = trace_options[:request]
436
+ txn_options[:request] = trace_options[:request]
438
437
  txn_options[:request] ||= request if respond_to?(:request) rescue nil
439
438
  # params should have been filtered before calling perform_action_with_newrelic_trace
440
439
  txn_options[:filtered_params] = trace_options[:params]
@@ -457,7 +456,8 @@ module NewRelic
457
456
  NewRelic::Agent::Instrumentation::IgnoreActions.is_filtered?(
458
457
  key,
459
458
  self.class,
460
- name)
459
+ name
460
+ )
461
461
  end
462
462
 
463
463
  def detect_queue_start_time(request)