newrelic_rpm 7.1.0 → 8.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/CHANGELOG.md +189 -6
  4. data/README.md +5 -1
  5. data/lib/new_relic/agent/adaptive_sampler.rb +2 -2
  6. data/lib/new_relic/agent/agent.rb +6 -6
  7. data/lib/new_relic/agent/commands/thread_profiler_session.rb +7 -3
  8. data/lib/new_relic/agent/configuration/default_source.rb +86 -15
  9. data/lib/new_relic/agent/configuration/event_harvest_config.rb +28 -12
  10. data/lib/new_relic/agent/configuration/manager.rb +1 -2
  11. data/lib/new_relic/agent/configuration/server_source.rb +3 -2
  12. data/lib/new_relic/agent/configuration/yaml_source.rb +22 -1
  13. data/lib/new_relic/agent/connect/request_builder.rb +4 -2
  14. data/lib/new_relic/agent/custom_event_aggregator.rb +2 -1
  15. data/lib/new_relic/agent/database.rb +5 -2
  16. data/lib/new_relic/agent/datastores/mongo.rb +5 -10
  17. data/lib/new_relic/agent/datastores.rb +7 -7
  18. data/lib/new_relic/agent/distributed_tracing/cross_app_payload.rb +5 -5
  19. data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +10 -6
  20. data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +0 -1
  21. data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +1 -1
  22. data/lib/new_relic/agent/distributed_tracing/trace_context_payload.rb +6 -6
  23. data/lib/new_relic/agent/error_collector.rb +52 -37
  24. data/lib/new_relic/agent/error_filter.rb +175 -0
  25. data/lib/new_relic/agent/event_loop.rb +6 -6
  26. data/lib/new_relic/agent/external.rb +0 -32
  27. data/lib/new_relic/agent/http_clients/abstract.rb +2 -2
  28. data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +7 -1
  29. data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +1 -1
  30. data/lib/new_relic/agent/instrumentation/active_merchant.rb +3 -3
  31. data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +1 -1
  32. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +1 -1
  33. data/lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb +4 -4
  34. data/lib/new_relic/agent/instrumentation/excon.rb +4 -23
  35. data/lib/new_relic/agent/instrumentation/logger/chain.rb +21 -0
  36. data/lib/new_relic/agent/instrumentation/logger/instrumentation.rb +59 -0
  37. data/lib/new_relic/agent/instrumentation/logger/prepend.rb +13 -0
  38. data/lib/new_relic/agent/instrumentation/logger.rb +25 -0
  39. data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +5 -1
  40. data/lib/new_relic/agent/instrumentation/memcache/helper.rb +5 -0
  41. data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +8 -2
  42. data/lib/new_relic/agent/instrumentation/mongo.rb +3 -141
  43. data/lib/new_relic/agent/instrumentation/padrino/chain.rb +23 -19
  44. data/lib/new_relic/agent/instrumentation/padrino/prepend.rb +1 -1
  45. data/lib/new_relic/agent/instrumentation/padrino.rb +4 -2
  46. data/lib/new_relic/agent/instrumentation/queue_time.rb +4 -4
  47. data/lib/new_relic/agent/instrumentation/rack/chain.rb +3 -2
  48. data/lib/new_relic/agent/instrumentation/rack/prepend.rb +2 -1
  49. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +5 -41
  50. data/lib/new_relic/agent/instrumentation/resque.rb +2 -2
  51. data/lib/new_relic/agent/instrumentation/sidekiq.rb +6 -1
  52. data/lib/new_relic/agent/instrumentation/tilt/chain.rb +24 -0
  53. data/lib/new_relic/agent/instrumentation/tilt/instrumentation.rb +41 -0
  54. data/lib/new_relic/agent/instrumentation/tilt/prepend.rb +13 -0
  55. data/lib/new_relic/agent/instrumentation/tilt.rb +25 -0
  56. data/lib/new_relic/agent/javascript_instrumentor.rb +3 -3
  57. data/lib/new_relic/agent/logging.rb +5 -6
  58. data/lib/new_relic/agent/messaging.rb +10 -24
  59. data/lib/new_relic/agent/method_tracer.rb +137 -138
  60. data/lib/new_relic/agent/monitors/cross_app_monitor.rb +8 -1
  61. data/lib/new_relic/agent/new_relic_service.rb +16 -23
  62. data/lib/new_relic/agent/pipe_channel_manager.rb +10 -6
  63. data/lib/new_relic/agent/pipe_service.rb +1 -1
  64. data/lib/new_relic/agent/samplers/cpu_sampler.rb +1 -1
  65. data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +9 -6
  66. data/lib/new_relic/agent/span_event_aggregator.rb +2 -2
  67. data/lib/new_relic/agent/sql_sampler.rb +1 -1
  68. data/lib/new_relic/agent/stats_engine/stats_hash.rb +1 -1
  69. data/lib/new_relic/agent/stats_engine.rb +1 -1
  70. data/lib/new_relic/agent/threading/backtrace_service.rb +4 -5
  71. data/lib/new_relic/agent/threading/thread_profile.rb +1 -1
  72. data/lib/new_relic/agent/tracer.rb +15 -37
  73. data/lib/new_relic/agent/transaction/abstract_segment.rb +3 -3
  74. data/lib/new_relic/agent/transaction/datastore_segment.rb +3 -0
  75. data/lib/new_relic/agent/transaction/distributed_tracer.rb +1 -0
  76. data/lib/new_relic/agent/transaction/external_request_segment.rb +3 -0
  77. data/lib/new_relic/agent/transaction/message_broker_segment.rb +5 -11
  78. data/lib/new_relic/agent/transaction/segment.rb +3 -0
  79. data/lib/new_relic/agent/transaction.rb +7 -28
  80. data/lib/new_relic/agent/transaction_time_aggregator.rb +5 -5
  81. data/lib/new_relic/agent/vm/snapshot.rb +1 -1
  82. data/lib/new_relic/agent/worker_loop.rb +5 -5
  83. data/lib/new_relic/agent.rb +6 -5
  84. data/lib/new_relic/cli/commands/deployments.rb +2 -2
  85. data/lib/new_relic/constants.rb +0 -4
  86. data/lib/new_relic/noticed_error.rb +4 -4
  87. data/lib/new_relic/version.rb +2 -2
  88. data/lib/newrelic_rpm.rb +10 -34
  89. data/lib/tasks/all.rb +1 -1
  90. data/newrelic.yml +580 -3
  91. data/newrelic_rpm.gemspec +1 -1
  92. data/test/agent_helper.rb +27 -2
  93. metadata +12 -11
  94. data/lib/new_relic/agent/datastores/mongo/statement_formatter.rb +0 -53
  95. data/lib/new_relic/agent/instrumentation/excon/connection.rb +0 -49
  96. data/lib/new_relic/agent/instrumentation/merb/controller.rb +0 -44
  97. data/lib/new_relic/agent/instrumentation/merb/errors.rb +0 -33
  98. data/lib/new_relic/agent/instrumentation/rails/action_controller.rb +0 -125
  99. data/lib/new_relic/agent/instrumentation/rails/action_web_service.rb +0 -46
  100. data/lib/new_relic/agent/supported_versions.rb +0 -275
  101. data/lib/new_relic/control/frameworks/merb.rb +0 -29
data/newrelic.yml CHANGED
@@ -2,7 +2,7 @@
2
2
  # This file configures the New Relic Agent. New Relic monitors Ruby, Java,
3
3
  # .NET, PHP, Python, Node, and Go applications with deep visibility and low
4
4
  # overhead. For more information, visit www.newrelic.com.
5
- #
5
+
6
6
  # Generated <%= Time.now.strftime('%B %d, %Y') %><%= ", for version #{@agent_version}" if @agent_version %>
7
7
  #<%= "\n# #{generated_for_user}\n#" if generated_for_user %>
8
8
  # For full documentation of agent configuration options, please refer to
@@ -13,15 +13,592 @@ common: &default_settings
13
13
  license_key: <%= license_key %>
14
14
 
15
15
  # Your application name. Renaming here affects where data displays in New
16
- # Relic. For more details, see https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/renaming-applications
16
+ # Relic. For more details, see https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/renaming-applications
17
17
  app_name: <%= app_name %>
18
18
 
19
19
  # To disable the agent regardless of other settings, uncomment the following:
20
20
  # agent_enabled: false
21
21
 
22
- # Logging level for log/newrelic_agent.log
22
+ # Logging level for log/newrelic_agent.log; options are error, warn, info, or
23
+ # debug.
23
24
  log_level: info
24
25
 
26
+ # All of the following configuration options are optional. Review them, and
27
+ # uncomment or edit them if they appear relevant to your application needs.
28
+
29
+ # If true, enables analytics event sampling.
30
+ # analytics_events.enabled: true
31
+
32
+ # Defines the maximum number of request events reported from a single harvest.
33
+ # analytics_events.max_samples_stored: 1200
34
+
35
+ # Prefix of attributes to exclude from all destinations. Allows * as wildcard at
36
+ # end.
37
+ # attributes_exclude: []
38
+
39
+ # Prefix of attributes to include in all destinations. Allows * as wildcard at
40
+ # end.
41
+ # attributes_include: []
42
+
43
+ # If true, enables capture of attributes for all destinations.
44
+ # attributes.enabled: true
45
+
46
+ # If true, enables an audit log which logs communications with the New Relic
47
+ # collector.
48
+ # audit_log.enabled: false
49
+
50
+ # List of allowed endpoints to include in audit log.
51
+ # audit_log.endpoints: [".*"]
52
+
53
+ # Specifies a path to the audit log file (including the filename).
54
+ # audit_log.path: "/audit_log"
55
+
56
+ # Specify a list of constants that should prevent the agent from starting
57
+ # automatically. Separate individual constants with a comma ,.
58
+ # For example, Rails::Console,UninstrumentedBackgroundJob.
59
+ # autostart.denylisted_constants: "rails::console"
60
+
61
+ # Defines a comma-delimited list of executables that the agent should not
62
+ # instrument. For example, rake,my_ruby_script.rb.
63
+ # autostart.denylisted_executables: "irb,rspec"
64
+
65
+ # Defines a comma-delimited list of Rake tasks that the agent should not
66
+ # instrument. For example, assets:precompile,db:migrate.
67
+ # autostart.denylisted_rake_tasks: "about,assets:clean,assets:clobber,assets:environment,assets:precompile,assets:precompile:all,db:create,db:drop,db:fixtures:load,db:migrate,db:migrate:status,db:rollback,db:schema:cache:clear,db:schema:cache:dump,db:schema:dump,db:schema:load,db:seed,db:setup,db:structure:dump,db:version,doc:app,log:clear,middleware,notes,notes:custom,rails:template,rails:update,routes,secret,spec,spec:features,spec:requests,spec:controllers,spec:helpers,spec:models,spec:views,spec:routing,spec:rcov,stats,test,test:all,test:all:db,test:recent,test:single,test:uncommitted,time:zones:all,tmp:clear,tmp:create,webpacker:compile"
68
+
69
+ # Backports the faster Active Record connection lookup introduced in Rails 6,
70
+ # which improves agent performance when instrumenting Active Record. Note that
71
+ # this setting may not be compatible with other gems that patch Active Record.
72
+ # backport_fast_active_record_connection_lookup: false
73
+
74
+ # If true, the agent captures attributes from browser monitoring.
75
+ # browser_monitoring_attributes.enabled: false
76
+
77
+ # Prefix of attributes to exclude from browser monitoring. Allows * as wildcard
78
+ # at end.
79
+ # browser_monitoring.attributes.exclude: []
80
+
81
+ # Prefix of attributes to include in browser monitoring. Allows * as wildcard at
82
+ # end.
83
+ # browser_monitoring.attributes.include: []
84
+
85
+ # If true, enables auto-injection of the JavaScript header for page load timing
86
+ # (sometimes referred to as real user monitoring or RUM).
87
+ # browser_monitoring.auto_instrument: false
88
+
89
+ # This is true by default, this enables auto-injection of the JavaScript header
90
+ # for page load timing (sometimes referred to as real user monitoring or RUM).
91
+ # browser_monitoring.auto_instrument: true
92
+
93
+ # Manual override for the path to your local CA bundle. This CA bundle will be
94
+ # used to validate the SSL certificate presented by New Relic's data collection
95
+ # service.
96
+ # ca_bundle_path: nil
97
+
98
+ # Enable or disable the capture of memcache keys from transaction traces.
99
+ # capture_memcache_keys: false
100
+
101
+ # When true, the agent captures HTTP request parameters and attaches them to
102
+ # transaction traces, traced errors, and TransactionError events. When using the
103
+ # capture_params setting, the Ruby agent will not attempt to filter secret
104
+ # information. Recommendation: To filter secret information from request
105
+ # parameters,use the attributes.include setting instead. For more information,
106
+ # see the Ruby attribute examples.
107
+ # capture_params: false
108
+
109
+ # If true, the agent will clear Tracer::State in Agent.drop_buffered_data.
110
+ # clear_transaction_state_after_fork: false
111
+
112
+ # Path to newrelic.yml. If undefined, the agent checks the following directories
113
+ # (in order): config/newrelic.yml, newrelic.yml, $HOME/.newrelic/newrelic.yml
114
+ # and $HOME/newrelic.yml.
115
+ # config_path: newrelic.yml
116
+
117
+ # If true, enables cross application tracing. Cross application tracing is now
118
+ # deprecated, and disabled by default. Distributed tracing is replacing cross
119
+ # application tracing as the default means of tracing between services.
120
+ # To continue using it, set `cross_application_tracer.enabled: true` and
121
+ # `distributed_tracing.enabled: false`
122
+ # cross_application_tracer.enabled: false
123
+
124
+ # If false, custom attributes will not be sent on New Relic Insights events.
125
+ # custom_attributes.enabled: true
126
+
127
+ # If true, the agent captures New Relic Insights custom events.
128
+ # custom_insights_events.enabled: true
129
+
130
+ # Specify a maximum number of custom Insights events to buffer in memory at a
131
+ # time.
132
+ # custom_insights_events.max_samples_stored: 1000
133
+
134
+ # If false, the agent will not add database_name parameter to transaction or #
135
+ # slow sql traces.
136
+ # datastore_tracer.database_name_reporting.enabled: true
137
+
138
+ # If false, the agent will not report datastore instance metrics, nor add host
139
+ # or port_path_or_id parameters to transaction or slow SQL traces.
140
+ # datastore_tracer.instance_reporting.enabled: true
141
+
142
+ # If true, disables Action Cable instrumentation.
143
+ # disable_action_cable_instrumentation: false
144
+
145
+ # If true, disables instrumentation for Active Record 4, 5, and 6.
146
+ # disable_active_record_notifications: false
147
+
148
+ # If true, disables Active Storage instrumentation.
149
+ # disable_active_storage: false
150
+
151
+ # If true, disables Active Job instrumentation.
152
+ # disable_activejob: false
153
+
154
+ # If true, disables Active Record instrumentation.
155
+ # disable_active_record_instrumentation: false
156
+
157
+ # If true, the agent won't sample the CPU usage of the host process.
158
+ # disable_cpu_sampler: false
159
+
160
+ # If true, disables DataMapper instrumentation.
161
+ # disable_data_mapper: false
162
+
163
+ # If true, the agent won't measure the depth of Delayed Job queues.
164
+ # disable_delayed_job_sampler: false
165
+
166
+ # If true, disables the use of GC::Profiler to measure time spent in garbage
167
+ # collection
168
+ # disable_gc_profiler: false
169
+
170
+ # If true, the agent won't sample the memory usage of the host process.
171
+ # disable_memory_sampler: false
172
+
173
+ # If true, the agent won't wrap third-party middlewares in instrumentation
174
+ # (regardless of whether they are installed via Rack::Builder or Rails).
175
+ # disable_middleware_instrumentation: false
176
+
177
+ # If true, disables the collection of sampler metrics. Sampler metrics are
178
+ # metrics that are not event-based (such as CPU time or memory usage).
179
+ # disable_samplers: false
180
+
181
+ # If true, disables Sequel instrumentation.
182
+ # disable_sequel_instrumentation: false
183
+
184
+ # If true, disables Sidekiq instrumentation.
185
+ # disable_sidekiq: false
186
+
187
+ # If true, disables agent middleware for Sinatra. This middleware is responsible
188
+ # for advanced feature support such as distributed tracing, page load
189
+ # timing, and error collection.
190
+ # disable_sinatra_auto_middleware: false
191
+
192
+ # If true, disables view instrumentation.
193
+ # disable_view_instrumentation: false
194
+
195
+ # If true, the agent won't sample performance measurements from the Ruby VM.
196
+ # disable_vm_sampler: false
197
+
198
+ # Distributed tracing tracks and observes service requests as they flow through distributed systems.
199
+ # With distributed tracing data, you can quickly pinpoint failures or performance issues and fix them.
200
+ # distributed_tracing.enabled: true
201
+
202
+ # If true, the agent captures attributes from error collection.
203
+ # error_collector.attributes.enabled: false
204
+
205
+ # Prefix of attributes to exclude from error collection.
206
+ # Allows * as wildcard at end.
207
+ # error_collector.attributes.exclude: []
208
+
209
+ # Prefix of attributes to include in error collection.
210
+ # Allows * as wildcard at end.
211
+ # error_collector.attributes.include: []
212
+
213
+ # If true, the agent collects TransactionError events.
214
+ # error_collector.capture_events: true
215
+
216
+ # If true, the agent captures traced errors and error count metrics.
217
+ # error_collector.enabled: true
218
+
219
+ # A list of error classes that the agent should treat as expected.
220
+ # error_collector.expected_classes: []
221
+
222
+ # A map of error classes to a list of messages. When an error of one of the
223
+ # classes specified here occurs, if its error message contains one of the
224
+ # strings corresponding to it here, that error will be treated as expected.
225
+ # error_collector.expected_messages: {}
226
+
227
+ # A comma separated list of status codes, possibly including ranges. Errors
228
+ # associated with these status codes, where applicable, will be treated as
229
+ # expected.
230
+ # error_collector.expected_status_codes: ""
231
+
232
+ # A list of error classes that the agent should ignore.
233
+ # error_collector.ignore_classes: []
234
+
235
+ # A map of error classes to a list of messages. When an error of one of the
236
+ # classes specified here occurs, if its error message contains one of the
237
+ # strings corresponding to it here, that error will be ignored.
238
+ # error_collector.ignore_messages: ""
239
+
240
+ # A comma separated list of status codes, possibly including ranges. Errors
241
+ # associated with these status codes, where applicable, will be ignored.
242
+ # error_collector.ignore_status_codes: ""
243
+
244
+ # Defines the maximum number of frames in an error backtrace. Backtraces over
245
+ # this amount are truncated at the beginning and end.
246
+ # error_collector.max_backtrace_frames: 50
247
+
248
+ # Defines the maximum number of TransactionError events sent to Insights per
249
+ # harvest cycle.
250
+ # error_collector.max_event_samples_stored: 100
251
+
252
+ # Allows newrelic distributed tracing headers to be suppressed on outbound
253
+ # requests.
254
+ # exclude_newrelic_header: false
255
+
256
+ # Forces the exit handler that sends all cached data to collector before
257
+ # shutting down to be installed regardless of detecting scenarios where it
258
+ # generally should bot be. Known use-case for this option is where Sinatra is
259
+ # running as an embedded service within another framework and the agent is
260
+ # detecting the Sinatra app and skipping the at_exit handler as a result.
261
+ # Sinatra classically runs the entire application in an at_exit block and would
262
+ # otherwise misbehave if the Agent's at_exit handler was also installed in
263
+ # those circumstances. Note: send_data_on_exit should also be set to true in
264
+ # tandem with this setting.
265
+ # force_install_exit_handler: false
266
+
267
+ # Ordinarily the agent reports dyno names with a trailing dot and process ID
268
+ # (for example, worker.3). You can remove this trailing data by specifying the
269
+ # prefixes you want to report without trailing data (for example, worker).
270
+ # heroku.dyno_name_prefixes_to_shorten: ["scheduler", "run"]
271
+
272
+ # If true, the agent uses Heroku dyno names as the hostname.
273
+ # heroku.use_dyno_names: true
274
+
275
+ # If true, enables high security mode. Ensure that you understand the
276
+ # implication of enabling high security mode before enabling this setting.
277
+ # https://docs.newrelic.com/docs/agents/manage-apm-agents/configuration/high-security-mode/
278
+ # high_security: false
279
+
280
+ # Configures the hostname for the Trace Observer Host. When configured, enables
281
+ # tail-based sampling by sending all recorded spans to a Trace Observer for
282
+ # further sampling decisions, irrespective of any usual agent sampling decision.
283
+ # infinite_tracing.trace_observer.host: ""
284
+
285
+ # Configures the TCP/IP port for the Trace Observer Host
286
+ # infinite_tracing.trace_observer.port: 443
287
+
288
+ # Controls auto-instrumentation of bunny at start up.
289
+ # May be one of [auto|prepend|chain|disabled].
290
+ # instrumentation.bunny: auto
291
+
292
+ # Controls auto-instrumentation of Curb at start up.
293
+ # May be one of [auto|prepend|chain|disabled].
294
+ # instrumentation.curb: auto
295
+
296
+ # Controls auto-instrumentation of Delayed Job at start up.
297
+ # May be one of [auto|prepend|chain|disabled].
298
+ # instrumentation.delayed_job: auto
299
+
300
+ # Controls auto-instrumentation of Excon at start up.
301
+ # May be one of [enabled|disabled].
302
+ # instrumentation.excon: auto
303
+
304
+ # Controls auto-instrumentation of Grape at start up.
305
+ # May be one of [auto|prepend|chain|disabled].
306
+ # instrumentation.grape: auto
307
+
308
+ # Controls auto-instrumentation of HTTPClient at start up.
309
+ # May be one of [auto|prepend|chain|disabled].
310
+ # instrumentation.httpclient: auto
311
+
312
+ # Controls auto-instrumentation of http.rb gem at start up.
313
+ # May be one of [auto|prepend|chain|disabled].
314
+ # instrumentation.httprb: auto
315
+
316
+ # Controls auto-instrumentation of the Ruby standard library Logger.rb.
317
+ # May be one of [auto|prepend|chain|disabled].
318
+ # instrumentation.logger: auto
319
+
320
+ # Controls auto-instrumentation of memcache-client gem for Memcache at start up.
321
+ # May be one of [auto|prepend|chain|disabled].
322
+ # instrumentation.memcache_client: auto
323
+
324
+ # Controls auto-instrumentation of dalli gem for Memcache at start up.
325
+ # May be one of [auto|prepend|chain|disabled].
326
+ # instrumentation.memcache: auto
327
+
328
+ # Controls auto-instrumentation of memcached gem for Memcache at start up.
329
+ # May be one of [auto|prepend|chain|disabled].
330
+ # instrumentation.memcached: auto
331
+
332
+ # Controls auto-instrumentation of Mongo at start up.
333
+ # May be one of [enabled|disabled].
334
+ # instrumentation.mongo: auto
335
+
336
+ # Controls auto-instrumentation of Net::HTTP at start up.
337
+ # May be one of [auto|prepend|chain|disabled].
338
+ # instrumentation.net_http: auto
339
+
340
+ # Controls auto-instrumentation of Puma::Rack::URLMap at start up.
341
+ # May be one of [auto|prepend|chain|disabled].
342
+ # instrumentation.puma_rack_urlmap: auto
343
+
344
+ # Controls auto-instrumentation of Puma::Rack. When enabled, the agent hooks
345
+ # into the to_app method in Puma::Rack::Builder to find gems to instrument
346
+ # during application startup. May be one of [auto|prepend|chain|disabled].
347
+ # instrumentation.puma_rack: auto
348
+
349
+ # Controls auto-instrumentation of Rack::URLMap at start up.
350
+ # May be one of [auto|prepend|chain|disabled].
351
+ # instrumentation.rack_urlmap: auto
352
+
353
+ # Controls auto-instrumentation of Rack. When enabled, the agent hooks into the
354
+ # to_app method in Rack::Builder to find gems to instrument during application
355
+ # startup. May be one of [auto|prepend|chain|disabled].
356
+ # instrumentation.rack: auto
357
+
358
+ # Controls auto-instrumentation of rake at start up.
359
+ # May be one of [auto|prepend|chain|disabled].
360
+ # instrumentation.rake: auto
361
+
362
+ # Controls auto-instrumentation of Redis at start up.
363
+ # May be one of [auto|prepend|chain|disabled].
364
+ # instrumentation.redis: auto
365
+
366
+ # Controls auto-instrumentation of resque at start up.
367
+ # May be one of [auto|prepend|chain|disabled].
368
+ # instrumentation.resque: auto
369
+
370
+ # Controls auto-instrumentation of Sinatra at start up.
371
+ # May be one of [auto|prepend|chain|disabled].
372
+ # instrumentation.sinatra: auto
373
+
374
+ # Controls auto-instrumentation of Tilt at start up.
375
+ # May be one of [auto|prepend|chain|disabled].
376
+ # instrumentation.tilt: auto
377
+
378
+ # Controls auto-instrumentation of Typhoeus at start up.
379
+ # May be one of [auto|prepend|chain|disabled].
380
+ # instrumentation.typhoeus: auto
381
+
382
+ # A dictionary of label names and values that will be applied to the data sent
383
+ # from this agent. May also be expressed asa semicolon-delimited ; string of
384
+ # colon-separated : pairs.
385
+ # For example,<var>Server</var>:<var>One</var>;<var>Data Center</var>:<var>Primary</var>.
386
+ # labels: ""
387
+
388
+ # Defines a name for the log file.
389
+ # log_file_name: "newrelic_agent.log"
390
+
391
+ # Defines a path to the agent log file, excluding the filename.
392
+ # log_file_path: "log/"
393
+
394
+ # Specifies a marshaller for transmitting data to the New Relic collector.
395
+ # Currently json is the only valid value for this setting.
396
+ # marshaller: json
397
+
398
+ # If true, the agent will collect metadata about messages and attach them as
399
+ # segment parameters.
400
+ # message_tracer.segment_parameters.enabled: true
401
+
402
+ # If true, the agent captures Mongo queries in transaction traces.
403
+ # mongo.capture_queries: true
404
+
405
+ # If true, the agent obfuscates Mongo queries in transaction traces.
406
+ # mongo.obfuscate_queries: true
407
+
408
+ # When true, the agent transmits data about your app to the New Relic collector.
409
+ # monitor_mode: true
410
+
411
+ # If true, uses Module#prepend rather than alias_method for Active Record
412
+ # instrumentation.
413
+ # prepend_active_record_instrumentation: false
414
+
415
+ # Specify a custom host name for display in the New Relic UI
416
+ # Be be aware that you cannot rename a hostname, so please rename
417
+ # process_host.display_name: "default hostname"
418
+
419
+ # Defines a host for communicating with the New Relic collector via a proxy
420
+ # server.
421
+ # proxy_host: nil
422
+
423
+ # Defines a password for communicating with the New Relic collector via a proxy
424
+ # server.
425
+ # proxy_pass: nil
426
+
427
+ # Defines a port for communicating with the New Relic collector via a proxy
428
+ # server.
429
+ # proxy_port: nil
430
+
431
+ # Defines a user for communicating with the New Relic collector via a proxy
432
+ # server.
433
+ # proxy_user: nil
434
+
435
+ # Timeout for waiting on connect to complete before a rake task
436
+ # rake.connect_timeout: 10
437
+
438
+ # Specify an array of Rake tasks to automatically instrument.
439
+ # rake.tasks: []
440
+
441
+ # Define transactions you want the agent to ignore, by specifying a list of
442
+ # patterns matching the URI you want to ignore.
443
+ # rules.ignore_url_regexes: []
444
+
445
+ # Applies Language Agent Security Policy settings.
446
+ # security_policies_token: ""
447
+
448
+ # If true, enables the exit handler that sends data to the New Relic collector
449
+ # before shutting down.
450
+ # send_data_on_exit: true
451
+
452
+ # If true, the agent collects slow SQL queries.
453
+ # slow_sql.enabled: false
454
+
455
+ # If true, the agent collects explain plans in slow SQL queries. If this setting
456
+ # is omitted, the transaction_tracer.explain.enabled setting will be applied as
457
+ # the default setting for explain plans in slow SQL as well.
458
+ # slow_sql.explain_enabled: false
459
+
460
+ # Specify a threshold in seconds. The agent collects slow SQL queries and
461
+ # explain plans that exceed this threshold.
462
+ # slow_sql.explain_threshold: 1.0
463
+
464
+ # Defines an obfuscation level for slow SQL queries.
465
+ # Valid options are obfuscated, raw, or none.
466
+ # slow_sql.record_sql: none
467
+
468
+ # Generate a longer sql_id for slow SQL traces. sql_id is used for aggregation
469
+ # of similar queries.
470
+ # slow_sql.use_longer_sql_id: false
471
+
472
+ # If true, the agent captures attributes on span events.
473
+ # span_events_attributes.enabled: true
474
+
475
+ # Defines the maximum number of span events reported from a single harvest.
476
+ # This can be any integer between 1 and 10000. Increasing this value may impact
477
+ # memory usage.
478
+ # span_events.max_samples_stored: 2000
479
+
480
+ # Prefix of attributes to exclude from span events. Allows * as wildcard at end.
481
+ # span_events.attributes.exclude: []
482
+
483
+ # Prefix of attributes to include on span events. Allows * as wildcard at end.
484
+ # span_events.attributes.include: []
485
+
486
+ # If true, enables span event sampling.
487
+ # span_events.enabled: true
488
+
489
+ # Sets the maximum number of span events to buffer when streaming to the trace
490
+ # observer.
491
+ # span_events.queue_size: 10000
492
+
493
+ # Specify a list of exceptions you do not want the agent to strip when
494
+ # strip_exception_messages is true. Separate exceptions with a comma. For
495
+ # example, "ImportantException,PreserveMessageException".
496
+ # strip_exception_messages.allowed_classes: ""
497
+
498
+ # If true, the agent strips messages from all exceptions except those in the
499
+ # allowlist. Enabled automatically in high security mode.
500
+ # strip_exception_messages.enabled: true
501
+
502
+ # When set to true, forces a synchronous connection to the New Relic collector
503
+ # during application startup. For very short-lived processes, this helps ensure # the New Relic agent has time to report.
504
+ # sync_startup: false
505
+
506
+ # If true, enables use of the thread profiler.
507
+ # thread_profiler.enabled: false
508
+
509
+ # Defines the maximum number of seconds the agent should spend attempting to
510
+ # connect to the collector.
511
+ # timeout: 120
512
+
513
+ # If true, the agent captures attributes from transaction events.
514
+ # transaction_events_attributes.enabled: false
515
+
516
+ # Prefix of attributes to exclude from transaction events.
517
+ # Allows * as wildcard at end.
518
+ # transaction_events.attributes.exclude: []
519
+
520
+ # Prefix of attributes to include in transaction events.
521
+ # Allows * as wildcard at end.
522
+ # transaction_events.attributes.include: []
523
+
524
+ # If true, the agent captures attributes on transaction segments.
525
+ # transaction_segments_attributes.enabled: true
526
+
527
+ # Prefix of attributes to exclude from transaction segments.
528
+ # Allows * as wildcard at end.
529
+ # transaction_segments.attributes.exclude: []
530
+
531
+ # Prefix of attributes to include on transaction segments.
532
+ # Allows * as wildcard at end.
533
+ # transaction_segments.attributes.include: []
534
+
535
+ # If true, the agent captures attributes from transaction traces.
536
+ # transaction_tracer.attributes.enabled: false
537
+
538
+ # Prefix of attributes to exclude from transaction traces.
539
+ # Allows * as wildcard at end.
540
+ # transaction_tracer.attributes.exclude: []
541
+
542
+ # Prefix of attributes to include in transaction traces.
543
+ # Allows * as wildcard at end.
544
+ # transaction_tracer.attributes.include: []
545
+
546
+ # If true, enables collection of transaction traces.
547
+ # transaction_tracer.enabled: true
548
+
549
+ # Threshold (in seconds) above which the agent will collect explain plans.
550
+ # Relevant only when explain.enabled is true.
551
+ # transaction_tracer.explain_threshold: 0.5
552
+
553
+ # If true, enables the collection of explain plans in transaction traces.
554
+ # This setting will also apply to explain plans in slow SQL traces if
555
+ # slow_sql.explain enabled is not set separately.
556
+ # transaction_tracer.explain.enabled: true
557
+
558
+ # Maximum number of transaction trace nodes to record in a single transaction
559
+ # trace.
560
+ # transaction_tracer.limit_segments: 4000
561
+
562
+ # If true, the agent records Redis command arguments in transaction traces.
563
+ # transaction_tracer.record_redis_arguments: false
564
+
565
+ # Obfuscation level for SQL queries reported in transaction trace nodes.
566
+ # By default, this is set to obfuscated, which strips out the numeric and string
567
+ # literals. If you do not want the agent to capture query information, set this
568
+ # to 'none'. If you want the agent to capture all query information in its
569
+ # original form, set this to 'raw'. When you enable high security mode this is
570
+ # automatically set to 'obfuscated'
571
+ # transaction_tracer.record_sql: 'obfuscated'
572
+
573
+ # Specify a threshold in seconds. The agent includes stack traces in transaction
574
+ # trace nodes when the stack trace duration exceeds this threshold.
575
+ # transaction_tracer.stack_trace_threshold: 0.5
576
+
577
+ # Specify a threshold in seconds. Transactions with a duration longer than this
578
+ # threshold are eligible for transaction traces. Specify a float value or the
579
+ # string apdex_f.
580
+ # transaction_tracer.transaction_threshold: 1.0
581
+
582
+ # If true, the agent automatically detects that it is running in an AWS
583
+ # environment.
584
+ # utilization.detect_aws: true
585
+
586
+ # If true, the agent automatically detects that it is running in an Azure
587
+ # environment.
588
+ # utilization.detect_azure: true
589
+
590
+ # If true, the agent automatically detects that it is running in Docker.
591
+ # utilization.detect_docker: true
592
+
593
+ # If true, the agent automatically detects that it is running in an Google Cloud
594
+ # Platform environment.
595
+ # utilization.detect_gcp: true
596
+
597
+ # If true, the agent automatically detects that it is running in Kubernetes.
598
+ # utilization.detect_kubernetes: true
599
+
600
+ # If true, the agent automatically detects that it is running in a Pivotal Cloud Foundry environment.
601
+ # utilization.detect_pcf: true
25
602
 
26
603
  # Environment-specific settings are in this section.
27
604
  # RAILS_ENV or RACK_ENV (as appropriate) is used to determine the environment.
data/newrelic_rpm.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.version = NewRelic::VERSION::STRING
11
11
  s.required_ruby_version = '>= 2.0.0'
12
12
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
13
- s.authors = [ "Aaron Huntsman", "Tanna McClure", "Michael Lang" ]
13
+ s.authors = [ "Aaron Huntsman", "Tanna McClure", "Kayla Reopelle" ]
14
14
  s.date = Time.now.strftime('%Y-%m-%d')
15
15
  s.licenses = ['Apache-2.0']
16
16
  s.description = <<-EOS
data/test/agent_helper.rb CHANGED
@@ -594,6 +594,31 @@ def advance_time seconds
594
594
  Time.__frozen_now = Time.now + seconds
595
595
  end
596
596
 
597
+ unless Process.respond_to?(:__original_clock_gettime)
598
+ Process.instance_eval do
599
+ class << self
600
+ attr_accessor :__frozen_clock_gettime
601
+ alias_method :__original_clock_gettime, :clock_gettime
602
+
603
+ def clock_gettime(clock_id, unit = :float_second)
604
+ __frozen_clock_gettime || __original_clock_gettime(clock_id, unit)
605
+ end
606
+ end
607
+ end
608
+ end
609
+
610
+ def advance_process_time(seconds, clock_id=Process::CLOCK_REALTIME)
611
+ Process.__frozen_clock_gettime = Process.clock_gettime(clock_id) + seconds
612
+ end
613
+
614
+ def nr_freeze_process_time(now=Process.clock_gettime(Process::CLOCK_REALTIME))
615
+ Process.__frozen_clock_gettime = now
616
+ end
617
+
618
+ def nr_unfreeze_process_time
619
+ Process.__frozen_clock_gettime = nil
620
+ end
621
+
597
622
  def with_constant_defined constant_symbol, implementation=Module.new
598
623
  const_path = constant_path(constant_symbol.to_s)
599
624
 
@@ -668,7 +693,7 @@ def wait_for_backtrace_service_poll opts={}
668
693
  :iterations => 1
669
694
  }
670
695
  opts = defaults.merge(opts)
671
- deadline = Time.now + opts[:timeout]
696
+ deadline = Process.clock_gettime(Process::CLOCK_REALTIME) + opts[:timeout]
672
697
 
673
698
  service = opts[:service]
674
699
  worker_loop = service.worker_loop
@@ -676,7 +701,7 @@ def wait_for_backtrace_service_poll opts={}
676
701
 
677
702
  until worker_loop.iterations > opts[:iterations]
678
703
  sleep(0.01)
679
- if Time.now > deadline
704
+ if Process.clock_gettime(Process::CLOCK_REALTIME) > deadline
680
705
  raise "Timed out waiting #{opts[:timeout]} s for backtrace service poll\n" +
681
706
  "Worker loop ran for #{opts[:service].worker_loop.iterations} iterations\n\n" +
682
707
  Thread.list.map { |t|