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
@@ -94,14 +94,14 @@ module NewRelic
94
94
  elsif type == Array
95
95
  self[config_key] = value.split(/\s*,\s*/)
96
96
  elsif type == NewRelic::Agent::Configuration::Boolean
97
- if value =~ /false|off|no/i
97
+ if /false|off|no/i.match?(value)
98
98
  self[config_key] = false
99
99
  elsif !value.nil?
100
100
  self[config_key] = true
101
101
  end
102
102
  else
103
103
  ::NewRelic::Agent.logger.info("#{environment_key} does not have a corresponding configuration setting (#{config_key} does not exist).")
104
- ::NewRelic::Agent.logger.info("Run `rake newrelic:config:docs` or visit https://newrelic.com/docs/ruby/ruby-agent-configuration to see a list of available configuration settings.")
104
+ ::NewRelic::Agent.logger.info('Run `rake newrelic:config:docs` or visit https://newrelic.com/docs/ruby/ruby-agent-configuration to see a list of available configuration settings.')
105
105
  self[config_key] = value
106
106
  end
107
107
  end
@@ -11,8 +11,6 @@ module NewRelic
11
11
  def initialize(local_settings)
12
12
  super({
13
13
  :capture_params => false,
14
- :'resque.capture_params' => false,
15
- :'sidekiq.capture_params' => false,
16
14
  :'attributes.include' => [],
17
15
 
18
16
  :'transaction_tracer.record_sql' => record_sql_setting(local_settings, :'transaction_tracer.record_sql'),
@@ -26,9 +24,9 @@ module NewRelic
26
24
  })
27
25
  end
28
26
 
29
- OFF = "off".freeze
30
- RAW = "raw".freeze
31
- OBFUSCATED = "obfuscated".freeze
27
+ OFF = 'off'.freeze
28
+ RAW = 'raw'.freeze
29
+ OBFUSCATED = 'obfuscated'.freeze
32
30
 
33
31
  SET_TO_OBFUSCATED = [RAW, OBFUSCATED]
34
32
 
@@ -15,6 +15,8 @@ module NewRelic
15
15
  module Agent
16
16
  module Configuration
17
17
  class Manager
18
+ DEPENDENCY_DETECTION_VALUES = %i[prepend chain].freeze
19
+
18
20
  # Defining these explicitly saves object allocations that we incur
19
21
  # if we use Forwardable and def_delegators.
20
22
  def [](key)
@@ -241,8 +243,8 @@ module NewRelic
241
243
  end
242
244
  end
243
245
 
244
- MALFORMED_LABELS_WARNING = "Skipping malformed labels configuration"
245
- PARSING_LABELS_FAILURE = "Failure during parsing labels. Ignoring and carrying on with connect."
246
+ MALFORMED_LABELS_WARNING = 'Skipping malformed labels configuration'
247
+ PARSING_LABELS_FAILURE = 'Failure during parsing labels. Ignoring and carrying on with connect.'
246
248
 
247
249
  MAX_LABEL_COUNT = 64
248
250
  MAX_LABEL_LENGTH = 255
@@ -357,7 +359,18 @@ module NewRelic
357
359
  reset_cache
358
360
  end
359
361
 
362
+ # reset the configuration hash, but do not replace previously auto
363
+ # determined dependency detection values with nil or 'auto'
360
364
  def reset_cache
365
+ return new_cache unless defined?(@cache) && @cache
366
+
367
+ preserved = @cache.select { |_k, v| DEPENDENCY_DETECTION_VALUES.include?(v) }
368
+ new_cache
369
+ preserved.each { |k, v| @cache[k] = v unless @cache[k] && @cache[k] != 'auto' }
370
+ @cache
371
+ end
372
+
373
+ def new_cache
361
374
  @cache = Hash.new { |hash, key| hash[key] = self.fetch(key) }
362
375
  end
363
376
 
@@ -51,7 +51,7 @@ module NewRelic
51
51
  # permitted by the security policy and is also enabled by the config
52
52
 
53
53
  SECURITY_SETTINGS_MAP = {
54
- "record_sql" => [
54
+ 'record_sql' => [
55
55
  {
56
56
  option: :'transaction_tracer.record_sql',
57
57
  supported: true,
@@ -96,7 +96,7 @@ module NewRelic
96
96
  permitted_fn: nil
97
97
  }
98
98
  ],
99
- "attributes_include" => [
99
+ 'attributes_include' => [
100
100
  {
101
101
  option: :'attributes.include',
102
102
  supported: true,
@@ -147,7 +147,7 @@ module NewRelic
147
147
  permitted_fn: nil
148
148
  }
149
149
  ],
150
- "allow_raw_exception_messages" => [
150
+ 'allow_raw_exception_messages' => [
151
151
  {
152
152
  option: :'strip_exception_messages.enabled',
153
153
  supported: true,
@@ -156,7 +156,7 @@ module NewRelic
156
156
  permitted_fn: nil
157
157
  }
158
158
  ],
159
- "custom_events" => [
159
+ 'custom_events' => [
160
160
  {
161
161
  option: :'custom_insights_events.enabled',
162
162
  supported: true,
@@ -165,7 +165,7 @@ module NewRelic
165
165
  permitted_fn: nil
166
166
  }
167
167
  ],
168
- "custom_parameters" => [
168
+ 'custom_parameters' => [
169
169
  {
170
170
  option: :'custom_attributes.enabled',
171
171
  supported: true,
@@ -174,7 +174,7 @@ module NewRelic
174
174
  permitted_fn: nil
175
175
  }
176
176
  ],
177
- "custom_instrumentation_editor" => [
177
+ 'custom_instrumentation_editor' => [
178
178
  {
179
179
  option: nil,
180
180
  supported: false,
@@ -183,7 +183,7 @@ module NewRelic
183
183
  permitted_fn: nil
184
184
  }
185
185
  ],
186
- "message_parameters" => [
186
+ 'message_parameters' => [
187
187
  {
188
188
  option: :'message_tracer.segment_parameters.enabled',
189
189
  supported: true,
@@ -191,22 +191,6 @@ module NewRelic
191
191
  disabled_value: false,
192
192
  permitted_fn: nil
193
193
  }
194
- ],
195
- "job_arguments" => [
196
- {
197
- option: :'resque.capture_params',
198
- supported: true,
199
- enabled_fn: method(:enabled?),
200
- disabled_value: false,
201
- permitted_fn: nil
202
- },
203
- {
204
- option: :'sidekiq.capture_params',
205
- supported: true,
206
- enabled_fn: method(:enabled?),
207
- disabled_value: false,
208
- permitted_fn: nil
209
- }
210
194
  ]
211
195
  }
212
196
 
@@ -214,8 +198,8 @@ module NewRelic
214
198
  super(build_overrides(security_policies))
215
199
  end
216
200
 
217
- ENABLED = "enabled".freeze
218
- COLON_COLON = "::".freeze
201
+ ENABLED = 'enabled'.freeze
202
+ COLON_COLON = '::'.freeze
219
203
 
220
204
  def build_overrides(security_policies)
221
205
  security_policies.inject({}) do |settings, (policy_name, policy_settings)|
@@ -238,7 +222,7 @@ module NewRelic
238
222
  settings[policy[:option]] = policy[:disabled_value]
239
223
  NewRelic::Agent.logger.info( \
240
224
  "Setting applied: {#{policy[:option]}: #{policy[:disabled_value]}}. " \
241
- "Source: SecurityPolicySource"
225
+ 'Source: SecurityPolicySource'
242
226
  )
243
227
  end
244
228
  end
@@ -10,27 +10,27 @@ module NewRelic
10
10
  # response, but should still be merged in as config settings to the
11
11
  # main agent configuration.
12
12
  TOP_LEVEL_KEYS = [
13
- "account_id",
14
- "apdex_t",
15
- "application_id",
16
- "beacon",
17
- "browser_key",
18
- "browser_monitoring.debug",
19
- "browser_monitoring.loader",
20
- "browser_monitoring.loader_version",
21
- "cross_process_id",
22
- "data_report_period",
23
- "encoding_key",
24
- "entity_guid",
25
- "error_beacon",
26
- "js_agent_file",
27
- "js_agent_loader",
28
- "max_payload_size_in_bytes",
29
- "primary_application_id",
30
- "sampling_target",
31
- "sampling_target_period_in_seconds",
32
- "trusted_account_ids",
33
- "trusted_account_key"
13
+ 'account_id',
14
+ 'apdex_t',
15
+ 'application_id',
16
+ 'beacon',
17
+ 'browser_key',
18
+ 'browser_monitoring.debug',
19
+ 'browser_monitoring.loader',
20
+ 'browser_monitoring.loader_version',
21
+ 'cross_process_id',
22
+ 'data_report_period',
23
+ 'encoding_key',
24
+ 'entity_guid',
25
+ 'error_beacon',
26
+ 'js_agent_file',
27
+ 'js_agent_loader',
28
+ 'max_payload_size_in_bytes',
29
+ 'primary_application_id',
30
+ 'sampling_target',
31
+ 'sampling_target_period_in_seconds',
32
+ 'trusted_account_ids',
33
+ 'trusted_account_key'
34
34
  ]
35
35
 
36
36
  def initialize(connect_reply, existing_config = {})
@@ -70,7 +70,7 @@ module NewRelic
70
70
 
71
71
  def fix_transaction_threshold(merged_settings)
72
72
  # when value is "apdex_f" remove the config and defer to default
73
- if merged_settings['transaction_tracer.transaction_threshold'].to_s =~ /apdex_f/i
73
+ if /apdex_f/i.match?(merged_settings['transaction_tracer.transaction_threshold'].to_s)
74
74
  merged_settings.delete('transaction_tracer.transaction_threshold')
75
75
  end
76
76
  end
@@ -102,8 +102,8 @@ module NewRelic
102
102
  if event_harvest_config.nil? \
103
103
  || event_harvest_config['harvest_limits'].values.min < 0 \
104
104
  || (event_harvest_config['report_period_ms'] / 1000) <= 0
105
- NewRelic::Agent.logger.warn("Invalid event harvest config found " \
106
- "in connect response; using default event report period.")
105
+ NewRelic::Agent.logger.warn('Invalid event harvest config found ' \
106
+ 'in connect response; using default event report period.')
107
107
  false
108
108
  else
109
109
  true
@@ -84,7 +84,7 @@ module NewRelic
84
84
  # so warn about it since it's very likely to be unintended.
85
85
  NewRelic::Agent.logger.warn(
86
86
  "No configuration file found. Working directory = #{Dir.pwd}",
87
- "Looked in these locations (based on #{based_on}): #{candidate_paths.join(", ")}"
87
+ "Looked in these locations (based on #{based_on}): #{candidate_paths.join(', ')}"
88
88
  )
89
89
  end
90
90
 
@@ -96,7 +96,7 @@ module NewRelic
96
96
  file.gsub!(/^\s*#.*$/, '#')
97
97
  ERB.new(file).result(binding)
98
98
  rescue ScriptError, StandardError => e
99
- log_failure("Failed ERB processing configuration file. This is typically caused by a Ruby error in <% %> templating blocks in your newrelic.yml file.", e)
99
+ log_failure('Failed ERB processing configuration file. This is typically caused by a Ruby error in <% %> templating blocks in your newrelic.yml file.', e)
100
100
  nil
101
101
  end
102
102
  end
@@ -124,7 +124,7 @@ module NewRelic
124
124
  config['transaction_tracer']['transaction_threshold'].to_s =~ /apdex_f/i
125
125
  # when value is "apdex_f" remove the config and defer to default
126
126
  config['transaction_tracer'].delete('transaction_threshold')
127
- elsif config['transaction_tracer.transaction_threshold'].to_s =~ /apdex_f/i
127
+ elsif /apdex_f/i.match?(config['transaction_tracer.transaction_threshold'].to_s)
128
128
  config.delete('transaction_tracer.transaction_threshold')
129
129
  end
130
130
  end
@@ -135,7 +135,7 @@ module NewRelic
135
135
  if 'auto' == config[option]
136
136
  config.delete(option)
137
137
  elsif !config[option].nil? && !is_boolean?(config[option])
138
- coerced_value = !!(config[option].to_s =~ /yes|on|true/i)
138
+ coerced_value = config[option].to_s.match?(/yes|on|true/i)
139
139
  if !coerced_value
140
140
  log_failure("Unexpected value (#{config[option]}) for '#{option}' in #{@path}")
141
141
  end
@@ -48,7 +48,7 @@ module NewRelic
48
48
 
49
49
  def environment_metadata
50
50
  env_copy = {}
51
- ENV.keys.each { |k| env_copy[k] = ENV[k] if k =~ /^NEW_RELIC_METADATA_/ }
51
+ ENV.keys.each { |k| env_copy[k] = ENV[k] if /^NEW_RELIC_METADATA_/.match?(k) }
52
52
  env_copy
53
53
  end
54
54
 
@@ -37,7 +37,7 @@ module NewRelic
37
37
 
38
38
  def add_server_side_config(config_data)
39
39
  if config_data['agent_config']
40
- ::NewRelic::Agent.logger.debug("Using config from server")
40
+ ::NewRelic::Agent.logger.debug('Using config from server')
41
41
  end
42
42
 
43
43
  ::NewRelic::Agent.logger.debug("Server provided config: #{config_data.inspect}")
@@ -27,7 +27,7 @@ module NewRelic
27
27
  return unless enabled?
28
28
 
29
29
  type = @type_strings[type]
30
- unless type =~ EVENT_TYPE_REGEX
30
+ unless EVENT_TYPE_REGEX.match?(type)
31
31
  note_dropped_event(type)
32
32
  return false
33
33
  end
@@ -71,9 +71,9 @@ module NewRelic
71
71
 
72
72
  def record_supportability_metrics(total_count, captured_count, dropped_count)
73
73
  engine = NewRelic::Agent.instance.stats_engine
74
- engine.tl_record_supportability_metric_count("Events/Customer/Seen", total_count)
75
- engine.tl_record_supportability_metric_count("Events/Customer/Sent", captured_count)
76
- engine.tl_record_supportability_metric_count("Events/Customer/Dropped", dropped_count)
74
+ engine.tl_record_supportability_metric_count('Events/Customer/Seen', total_count)
75
+ engine.tl_record_supportability_metric_count('Events/Customer/Sent', captured_count)
76
+ engine.tl_record_supportability_metric_count('Events/Customer/Dropped', dropped_count)
77
77
  end
78
78
 
79
79
  def note_dropped_event(type)
@@ -36,7 +36,7 @@ module NewRelic
36
36
  rescue => e
37
37
  begin
38
38
  # guarantees no throw from explain_sql
39
- ::NewRelic::Agent.logger.error("Error getting query plan:", e)
39
+ ::NewRelic::Agent.logger.error('Error getting query plan:', e)
40
40
  nil
41
41
  rescue
42
42
  # double exception. throw up your hands
@@ -49,10 +49,10 @@ module NewRelic
49
49
  }
50
50
 
51
51
  PLACEHOLDER = '?'.freeze
52
- FAILED_TO_OBFUSCATE_MESSAGE = "Failed to obfuscate SQL query - quote characters remained after obfuscation".freeze
52
+ FAILED_TO_OBFUSCATE_MESSAGE = 'Failed to obfuscate SQL query - quote characters remained after obfuscation'.freeze
53
53
 
54
54
  def obfuscate_single_quote_literals(sql)
55
- return sql unless sql =~ COMPONENTS_REGEX_MAP[:single_quotes]
55
+ return sql unless sql&.match?(COMPONENTS_REGEX_MAP[:single_quotes])
56
56
 
57
57
  sql.gsub(COMPONENTS_REGEX_MAP[:single_quotes], PLACEHOLDER)
58
58
  end
@@ -13,8 +13,8 @@ module NewRelic
13
13
 
14
14
  attr_reader :obfuscator
15
15
 
16
- QUERY_TOO_LARGE_MESSAGE = "Query too large (over 16k characters) to safely obfuscate".freeze
17
- ELLIPSIS = "...".freeze
16
+ QUERY_TOO_LARGE_MESSAGE = 'Query too large (over 16k characters) to safely obfuscate'.freeze
17
+ ELLIPSIS = '...'.freeze
18
18
 
19
19
  def initialize
20
20
  reset
@@ -7,24 +7,10 @@ require 'new_relic/agent/database/explain_plan_helpers'
7
7
  require 'new_relic/agent/database/obfuscator'
8
8
 
9
9
  module NewRelic
10
- # columns for a mysql explain plan
11
- MYSQL_EXPLAIN_COLUMNS = [
12
- "Id",
13
- "Select Type",
14
- "Table",
15
- "Type",
16
- "Possible Keys",
17
- "Key",
18
- "Key Length",
19
- "Ref",
20
- "Rows",
21
- "Extra"
22
- ].freeze
23
-
24
10
  module Agent
25
11
  module Database
26
12
  MAX_QUERY_LENGTH = 16384
27
- ELLIPSIS = "...".freeze
13
+ ELLIPSIS = '...'.freeze
28
14
 
29
15
  extend self
30
16
 
@@ -164,7 +150,7 @@ module NewRelic
164
150
  begin
165
151
  @connections[config] = yield(config)
166
152
  rescue => e
167
- ::NewRelic::Agent.logger.error("Caught exception trying to get connection to DB for explain.", e)
153
+ ::NewRelic::Agent.logger.error('Caught exception trying to get connection to DB for explain.', e)
168
154
  nil
169
155
  end
170
156
  end
@@ -188,7 +174,7 @@ module NewRelic
188
174
 
189
175
  attr_accessor :sql, :config, :explainer, :binds, :name, :host, :port_path_or_id, :database_name
190
176
 
191
- DEFAULT_QUERY_NAME = "SQL".freeze
177
+ DEFAULT_QUERY_NAME = 'SQL'.freeze
192
178
 
193
179
  def initialize(sql, config = {}, explainer = nil, binds = nil, name = DEFAULT_QUERY_NAME, host = nil, port_path_or_id = nil, database_name = nil)
194
180
  @sql = Database.capture_query(sql)
@@ -233,7 +219,7 @@ module NewRelic
233
219
  start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
234
220
  plan = @explainer.call(self)
235
221
  ::NewRelic::Agent.record_metric(
236
- "Supportability/Database/execute_explain_plan",
222
+ 'Supportability/Database/execute_explain_plan',
237
223
  Process.clock_gettime(Process::CLOCK_MONOTONIC) - start
238
224
  )
239
225
  return process_resultset(plan, adapter) if plan
@@ -6,12 +6,12 @@ module NewRelic
6
6
  module Agent
7
7
  module Datastores
8
8
  module MetricHelper
9
- ROLLUP_METRIC = "Datastore/all".freeze
10
- OTHER = "Other".freeze
9
+ ROLLUP_METRIC = 'Datastore/all'.freeze
10
+ OTHER = 'Other'.freeze
11
11
 
12
- ALL = "all".freeze
13
- ALL_WEB = "allWeb".freeze
14
- ALL_OTHER = "allOther".freeze
12
+ ALL = 'all'.freeze
13
+ ALL_WEB = 'allWeb'.freeze
14
+ ALL_OTHER = 'allOther'.freeze
15
15
 
16
16
  def self.statement_metric_for(product, collection, operation)
17
17
  "Datastore/statement/#{product}/#{collection}/#{operation}"
@@ -53,7 +53,7 @@ module NewRelic
53
53
 
54
54
  [name.to_s, collection]
55
55
  rescue => e
56
- NewRelic::Agent.logger.debug("Failure during Mongo metric generation", e)
56
+ NewRelic::Agent.logger.debug('Failure during Mongo metric generation', e)
57
57
  nil
58
58
  end
59
59
 
@@ -64,10 +64,10 @@ module NewRelic
64
64
  NAMES_IN_SELECTOR = [
65
65
  :findandmodify,
66
66
 
67
- "aggregate",
68
- "count",
69
- "group",
70
- "mapreduce",
67
+ 'aggregate',
68
+ 'count',
69
+ 'group',
70
+ 'mapreduce',
71
71
 
72
72
  :distinct,
73
73
 
@@ -91,18 +91,18 @@ module NewRelic
91
91
  if command_key
92
92
  command_key.to_sym
93
93
  else
94
- NewRelic::Agent.increment_metric("Supportability/Mongo/UnknownCollection")
94
+ NewRelic::Agent.increment_metric('Supportability/Mongo/UnknownCollection')
95
95
  payload[:selector].first.first unless command_key
96
96
  end
97
97
  end
98
98
 
99
- CMD_COLLECTION = "$cmd".freeze
99
+ CMD_COLLECTION = '$cmd'.freeze
100
100
 
101
101
  def self.get_collection_from_selector(command_key, payload)
102
102
  if command_key
103
103
  payload[:selector][command_key]
104
104
  else
105
- NewRelic::Agent.increment_metric("Supportability/Mongo/UnknownCollection")
105
+ NewRelic::Agent.increment_metric('Supportability/Mongo/UnknownCollection')
106
106
  CMD_COLLECTION
107
107
  end
108
108
  end
@@ -124,11 +124,11 @@ module NewRelic
124
124
  end
125
125
 
126
126
  def self.create_index?(name, payload)
127
- name == :insert && payload[:collection] == "system.indexes"
127
+ name == :insert && payload[:collection] == 'system.indexes'
128
128
  end
129
129
 
130
130
  def self.drop_indexes?(name, payload)
131
- name == :deleteIndexes && payload[:selector] && payload[:selector][:index] == "*"
131
+ name == :deleteIndexes && payload[:selector] && payload[:selector][:index] == '*'
132
132
  end
133
133
 
134
134
  def self.drop_index?(name, payload)
@@ -166,7 +166,7 @@ module NewRelic
166
166
  end
167
167
 
168
168
  def self.collection_name_from_group_selector(payload)
169
- payload[:selector]["group"]["ns"]
169
+ payload[:selector]['group']['ns']
170
170
  end
171
171
 
172
172
  def self.collection_name_from_rename_selector(payload)
@@ -6,7 +6,7 @@ module NewRelic
6
6
  module Agent
7
7
  module Datastores
8
8
  module Redis
9
- BINARY_DATA_PLACEHOLDER = "<binary data>"
9
+ BINARY_DATA_PLACEHOLDER = '<binary data>'
10
10
 
11
11
  MAXIMUM_COMMAND_LENGTH = 1000
12
12
  MAXIMUM_ARGUMENT_LENGTH = 64
@@ -25,7 +25,7 @@ module NewRelic
25
25
 
26
26
  def self.format_command(command_with_args)
27
27
  if Agent.config[:'transaction_tracer.record_redis_arguments']
28
- result = String.new('')
28
+ result = +''
29
29
 
30
30
  append_command_with_args(result, command_with_args)
31
31
 
@@ -36,7 +36,7 @@ module NewRelic
36
36
  end
37
37
 
38
38
  def self.format_pipeline_commands(commands_with_args)
39
- result = String.new('')
39
+ result = +''
40
40
 
41
41
  commands_with_args.each do |command|
42
42
  if result.length >= MAXIMUM_COMMAND_LENGTH
@@ -83,7 +83,7 @@ module NewRelic
83
83
  end
84
84
 
85
85
  def self.is_supported_version?
86
- Gem::Version.new(::Redis::VERSION) >= Gem::Version.new("3.0.0")
86
+ Gem::Version.new(::Redis::VERSION) >= Gem::Version.new('3.0.0')
87
87
  end
88
88
 
89
89
  def self.ellipsize(result, string)
@@ -106,8 +106,8 @@ module NewRelic
106
106
  end
107
107
 
108
108
  def self.safe_from_third_party_gem?
109
- if NewRelic::LanguageSupport.bundled_gem?("newrelic-redis")
110
- ::NewRelic::Agent.logger.info("Not installing New Relic supported Redis instrumentation because the third party newrelic-redis gem is present")
109
+ if NewRelic::LanguageSupport.bundled_gem?('newrelic-redis')
110
+ ::NewRelic::Agent.logger.info('Not installing New Relic supported Redis instrumentation because the third party newrelic-redis gem is present')
111
111
  false
112
112
  else
113
113
  true
@@ -1,4 +1,3 @@
1
- # -*- ruby -*-
2
1
  # This file is distributed under New Relic's license terms.
3
2
  # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
4
3
  # frozen_string_literal: true
@@ -28,7 +27,7 @@ module NewRelic
28
27
  end
29
28
 
30
29
  def is_cross_app_callee?
31
- cross_app_payload != nil
30
+ !cross_app_payload.nil?
32
31
  end
33
32
 
34
33
  def is_cross_app?
@@ -36,7 +35,7 @@ module NewRelic
36
35
  end
37
36
 
38
37
  def cat_trip_id
39
- cross_app_payload && cross_app_payload.referring_trip_id || transaction.guid
38
+ cross_app_payload&.referring_trip_id || transaction.guid
40
39
  end
41
40
 
42
41
  def cross_app_monitor
@@ -74,7 +73,7 @@ module NewRelic
74
73
  end
75
74
 
76
75
  def record_cross_app_metrics
77
- if (id = cross_app_payload && cross_app_payload.id)
76
+ if (id = cross_app_payload&.id)
78
77
  app_time_in_seconds = [
79
78
  Process.clock_gettime(Process::CLOCK_REALTIME) - transaction.start_time,
80
79
  0.0
@@ -104,11 +103,11 @@ module NewRelic
104
103
  end
105
104
 
106
105
  def cat_referring_path_hash
107
- cross_app_payload && cross_app_payload.referring_path_hash
106
+ cross_app_payload&.referring_path_hash
108
107
  end
109
108
 
110
109
  def append_cat_info(payload)
111
- if (referring_guid = cross_app_payload && cross_app_payload.referring_guid)
110
+ if (referring_guid = cross_app_payload&.referring_guid)
112
111
  payload[:referring_transaction_guid] = referring_guid
113
112
  end
114
113
 
@@ -150,7 +149,7 @@ module NewRelic
150
149
  if Agent.config[:cross_process_id] && Agent.config[:cross_process_id].length > 0
151
150
  true
152
151
  else
153
- NewRelic::Agent.logger.debug("No cross_process_id configured")
152
+ NewRelic::Agent.logger.debug('No cross_process_id configured')
154
153
  false
155
154
  end
156
155
  end
@@ -159,15 +158,14 @@ module NewRelic
159
158
  if Agent.config[:encoding_key] && Agent.config[:encoding_key].length > 0
160
159
  true
161
160
  else
162
- NewRelic::Agent.logger.debug("No encoding_key set")
161
+ NewRelic::Agent.logger.debug('No encoding_key set')
163
162
  false
164
163
  end
165
164
  end
166
165
 
167
166
  def cross_application_tracer_enabled?
168
167
  !NewRelic::Agent.config[:"distributed_tracing.enabled"] &&
169
- (NewRelic::Agent.config[:"cross_application_tracer.enabled"] ||
170
- NewRelic::Agent.config[:cross_application_tracing])
168
+ NewRelic::Agent.config[:"cross_application_tracer.enabled"]
171
169
  end
172
170
 
173
171
  def obfuscator
@@ -9,16 +9,16 @@ module NewRelic
9
9
 
10
10
  # Intrinsic Keys
11
11
  INTRINSIC_KEYS = [
12
- PARENT_TYPE_KEY = "parent.type",
13
- PARENT_APP_KEY = "parent.app",
14
- PARENT_ACCOUNT_ID_KEY = "parent.account",
15
- PARENT_TRANSPORT_TYPE_KEY = "parent.transportType",
16
- PARENT_TRANSPORT_DURATION_KEY = "parent.transportDuration",
17
- GUID_KEY = "guid",
18
- TRACE_ID_KEY = "traceId",
19
- PARENT_TRANSACTION_ID_KEY = "parentId",
20
- PARENT_SPAN_ID_KEY = "parentSpanId",
21
- SAMPLED_KEY = "sampled"
12
+ PARENT_TYPE_KEY = 'parent.type',
13
+ PARENT_APP_KEY = 'parent.app',
14
+ PARENT_ACCOUNT_ID_KEY = 'parent.account',
15
+ PARENT_TRANSPORT_TYPE_KEY = 'parent.transportType',
16
+ PARENT_TRANSPORT_DURATION_KEY = 'parent.transportDuration',
17
+ GUID_KEY = 'guid',
18
+ TRACE_ID_KEY = 'traceId',
19
+ PARENT_TRANSACTION_ID_KEY = 'parentId',
20
+ PARENT_SPAN_ID_KEY = 'parentSpanId',
21
+ SAMPLED_KEY = 'sampled'
22
22
  ].freeze
23
23
 
24
24
  # This method extracts intrinsics from the transaction_payload and