newrelic_rpm 7.2.0 → 8.0.0

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