newrelic_rpm 9.10.2 → 9.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +91 -1
  3. data/README.md +1 -1
  4. data/lib/new_relic/agent/agent_logger.rb +1 -0
  5. data/lib/new_relic/agent/configuration/default_source.rb +114 -3
  6. data/lib/new_relic/agent/database/obfuscator.rb +1 -0
  7. data/lib/new_relic/agent/error_collector.rb +14 -10
  8. data/lib/new_relic/agent/instrumentation/aws_sqs/chain.rb +37 -0
  9. data/lib/new_relic/agent/instrumentation/aws_sqs/instrumentation.rb +67 -0
  10. data/lib/new_relic/agent/instrumentation/aws_sqs/prepend.rb +21 -0
  11. data/lib/new_relic/agent/instrumentation/aws_sqs.rb +25 -0
  12. data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +14 -0
  13. data/lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb +1 -1
  14. data/lib/new_relic/agent/instrumentation/logstasher/chain.rb +21 -0
  15. data/lib/new_relic/agent/instrumentation/logstasher/instrumentation.rb +24 -0
  16. data/lib/new_relic/agent/instrumentation/logstasher/prepend.rb +13 -0
  17. data/lib/new_relic/agent/instrumentation/logstasher.rb +27 -0
  18. data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +3 -0
  19. data/lib/new_relic/agent/instrumentation/rails_notifications/action_controller.rb +9 -5
  20. data/lib/new_relic/agent/instrumentation/redis/cluster_middleware.rb +26 -0
  21. data/lib/new_relic/agent/instrumentation/redis/instrumentation.rb +14 -11
  22. data/lib/new_relic/agent/instrumentation/redis/middleware.rb +3 -0
  23. data/lib/new_relic/agent/instrumentation/redis.rb +5 -0
  24. data/lib/new_relic/agent/instrumentation/stripe_subscriber.rb +22 -1
  25. data/lib/new_relic/agent/local_log_decorator.rb +8 -1
  26. data/lib/new_relic/agent/log_event_aggregator.rb +91 -26
  27. data/lib/new_relic/control/instance_methods.rb +1 -0
  28. data/lib/new_relic/control/private_instance_methods.rb +4 -0
  29. data/lib/new_relic/control/security_interface.rb +57 -0
  30. data/lib/new_relic/control.rb +1 -1
  31. data/lib/new_relic/rack/browser_monitoring.rb +11 -7
  32. data/lib/new_relic/version.rb +2 -2
  33. data/lib/tasks/config.rake +5 -2
  34. data/lib/tasks/gha.rake +31 -0
  35. data/lib/tasks/helpers/config.html.erb +1 -1
  36. data/lib/tasks/helpers/format.rb +1 -1
  37. data/lib/tasks/helpers/newrelicyml.rb +3 -2
  38. data/lib/tasks/instrumentation_generator/instrumentation.thor +1 -0
  39. data/newrelic.yml +202 -135
  40. data/newrelic_rpm.gemspec +2 -0
  41. data/test/agent_helper.rb +9 -0
  42. metadata +42 -3
data/newrelic.yml CHANGED
@@ -26,16 +26,16 @@ common: &default_settings
26
26
  # All of the following configuration options are optional. Review them, and
27
27
  # uncomment or edit them if they appear relevant to your application needs.
28
28
 
29
- # An array of ActiveSupport custom event names to subscribe to and instrument. For
30
- # example,
29
+ # An array of ActiveSupport custom event names to subscribe to and instrument.
30
+ # For example,
31
31
  # - one.custom.event
32
32
  # - another.event
33
33
  # - a.third.event
34
34
  # active_support_custom_events_names: []
35
35
 
36
- # If false, all LLM instrumentation (OpenAI only for now) will be disabled and no
37
- # metrics, events, or spans will be sent. AI Monitoring is automatically disabled
38
- # if high_security mode is enabled.
36
+ # If false, all LLM instrumentation (OpenAI only for now) will be disabled and
37
+ # no metrics, events, or spans will be sent. AI Monitoring is automatically
38
+ # disabled if high_security mode is enabled.
39
39
  # ai_monitoring.enabled: false
40
40
 
41
41
  # If false, LLM instrumentation (OpenAI only for now) will not capture input and
@@ -43,23 +43,23 @@ common: &default_settings
43
43
  # The excluded attributes include:
44
44
  # * content from LlmChatCompletionMessage events
45
45
  # * input from LlmEmbedding events
46
- # This is an optional security setting to prevent recording sensitive data sent to
47
- # and received from your LLMs.
46
+ # This is an optional security setting to prevent recording sensitive data sent
47
+ # to and received from your LLMs.
48
48
  # ai_monitoring.record_content.enabled: true
49
49
 
50
50
  # If true, enables capture of all HTTP request headers for all destinations.
51
51
  # allow_all_headers: false
52
52
 
53
- # Your New Relic userKey. Required when using the New Relic REST API v2 to record
54
- # deployments using the newrelic deployments command.
53
+ # Your New Relic userKey. Required when using the New Relic REST API v2 to
54
+ # record deployments using the newrelic deployments command.
55
55
  # api_key: ""
56
56
 
57
57
  # If true, enables log decoration and the collection of log events and metrics.
58
58
  # application_logging.enabled: true
59
59
 
60
60
  # A hash with key/value pairs to add as custom attributes to all log events
61
- # forwarded to New Relic. If sending using an environment variable, the value must
62
- # be formatted like: "key1=value1,key2=value2"
61
+ # forwarded to New Relic. If sending using an environment variable, the value
62
+ # must be formatted like: "key1=value1,key2=value2"
63
63
  # application_logging.forwarding.custom_attributes: {}
64
64
 
65
65
  # If true, the agent captures log records emitted by your application.
@@ -126,16 +126,16 @@ common: &default_settings
126
126
  # instrument. For example, "assets:precompile,db:migrate".
127
127
  # 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
128
128
 
129
- # Backports the faster ActiveRecord connection lookup introduced in Rails 6, which
130
- # improves agent performance when instrumenting ActiveRecord. Note that this
131
- # setting may not be compatible with other gems that patch ActiveRecord.
129
+ # Backports the faster ActiveRecord connection lookup introduced in Rails 6,
130
+ # which improves agent performance when instrumenting ActiveRecord. Note that
131
+ # this setting may not be compatible with other gems that patch ActiveRecord.
132
132
  # backport_fast_active_record_connection_lookup: false
133
133
 
134
134
  # If true, the agent captures attributes from browser monitoring.
135
135
  # browser_monitoring.attributes.enabled: false
136
136
 
137
- # Prefix of attributes to exclude from browser monitoring. Allows * as wildcard at
138
- # end.
137
+ # Prefix of attributes to exclude from browser monitoring. Allows * as wildcard
138
+ # at end.
139
139
  # browser_monitoring.attributes.exclude: []
140
140
 
141
141
  # Prefix of attributes to include in browser monitoring. Allows * as wildcard at
@@ -160,17 +160,17 @@ common: &default_settings
160
160
 
161
161
  # When true, the agent captures HTTP request parameters and attaches them to
162
162
  # transaction traces, traced errors, and TransactionError events.
163
- # When using the capture_params setting, the Ruby agent will not attempt to filter
164
- # secret information. Recommendation: To filter secret information from request
165
- # parameters, use the attributes.include setting instead. For more information,
166
- # see the Ruby attribute examples.
163
+ # When using the capture_params setting, the Ruby agent will not attempt to
164
+ # filter secret information. Recommendation: To filter secret information from
165
+ # request parameters, use the attributes.include setting instead. For more
166
+ # information, see the Ruby attribute examples.
167
167
  # capture_params: false
168
168
 
169
169
  # If true, the agent will clear Tracer::State in Agent.drop_buffered_data.
170
170
  # clear_transaction_state_after_fork: false
171
171
 
172
172
  # If true, the agent will report source code level metrics for traced methods.
173
- # see:
173
+ # See:
174
174
  # https://docs.newrelic.com/docs/apm/agents/ruby-agent/features/ruby-codestream-integration/
175
175
  # code_level_metrics.enabled: true
176
176
 
@@ -188,17 +188,17 @@ common: &default_settings
188
188
  # If true, the agent captures custom events.
189
189
  # custom_insights_events.enabled: true
190
190
 
191
- # * Specify a maximum number of custom events to buffer in memory at a time.'
191
+ # * Specify a maximum number of custom events to buffer in memory at a time.
192
192
  # * When configuring the agent for AI monitoring, set to max value 100000. This
193
193
  # ensures the agent captures the maximum amount of LLM events.
194
194
  # custom_insights_events.max_samples_stored: 3000
195
195
 
196
- # If false, the agent will not add database_name parameter to transaction or slow
197
- # sql traces.
196
+ # If false, the agent will not add database_name parameter to transaction or
197
+ # slow sql traces.
198
198
  # datastore_tracer.database_name_reporting.enabled: true
199
199
 
200
- # If false, the agent will not report datastore instance metrics, nor add host or
201
- # port_path_or_id parameters to transaction or slow SQL traces.
200
+ # If false, the agent will not report datastore instance metrics, nor add host
201
+ # or port_path_or_id parameters to transaction or slow SQL traces.
202
202
  # datastore_tracer.instance_reporting.enabled: true
203
203
 
204
204
  # If true, disables Action Cable instrumentation.
@@ -244,16 +244,16 @@ common: &default_settings
244
244
  # If true, the agent won't wrap third-party middlewares in instrumentation
245
245
  # (regardless of whether they are installed via Rack::Builder or Rails).
246
246
  # When middleware instrumentation is disabled, if an application is using
247
- # middleware that could alter the response code, the HTTP status code reported on
248
- # the transaction may not reflect the altered value.
247
+ # middleware that could alter the response code, the HTTP status code reported
248
+ # on the transaction may not reflect the altered value.
249
249
  # disable_middleware_instrumentation: false
250
250
 
251
- # If true, disables agent middleware for Roda. This middleware is responsible for
252
- # advanced feature support such as page load timing and error collection.
251
+ # If true, disables agent middleware for Roda. This middleware is responsible
252
+ # for advanced feature support such as page load timing and error collection.
253
253
  # disable_roda_auto_middleware: false
254
254
 
255
- # If true, disables the collection of sampler metrics. Sampler metrics are metrics
256
- # that are not event-based (such as CPU time or memory usage).
255
+ # If true, disables the collection of sampler metrics. Sampler metrics are
256
+ # metrics that are not event-based (such as CPU time or memory usage).
257
257
  # disable_samplers: false
258
258
 
259
259
  # If true, disables Sequel instrumentation.
@@ -287,8 +287,8 @@ common: &default_settings
287
287
 
288
288
  # Distributed tracing lets you see the path that a request takes through your
289
289
  # distributed system. Enabling distributed tracing changes the behavior of some
290
- # New Relic features, so carefully consult the transition guide before you enable
291
- # this feature.
290
+ # New Relic features, so carefully consult the transition guide before you
291
+ # enable this feature.
292
292
  # distributed_tracing.enabled: true
293
293
 
294
294
  # If true, the agent captures Elasticsearch queries in transaction traces.
@@ -319,8 +319,8 @@ common: &default_settings
319
319
  # error_collector.expected_classes: []
320
320
 
321
321
  # A map of error classes to a list of messages. When an error of one of the
322
- # classes specified here occurs, if its error message contains one of the strings
323
- # corresponding to it here, that error will be treated as expected.
322
+ # classes specified here occurs, if its error message contains one of the
323
+ # strings corresponding to it here, that error will be treated as expected.
324
324
  # This option can't be set via environment variable.
325
325
  # error_collector.expected_messages: {}
326
326
 
@@ -334,8 +334,8 @@ common: &default_settings
334
334
  # error_collector.ignore_classes: ["ActionController::RoutingError", "Sinatra::NotFound"]
335
335
 
336
336
  # A map of error classes to a list of messages. When an error of one of the
337
- # classes specified here occurs, if its error message contains one of the strings
338
- # corresponding to it here, that error will be ignored.
337
+ # classes specified here occurs, if its error message contains one of the
338
+ # strings corresponding to it here, that error will be ignored.
339
339
  # This option can't be set via environment variable.
340
340
  # error_collector.ignore_messages: {}
341
341
 
@@ -343,9 +343,9 @@ common: &default_settings
343
343
  # associated with these status codes, where applicable, will be ignored.
344
344
  # error_collector.ignore_status_codes: ""
345
345
 
346
- # Defines the maximum number of frames in an error backtrace. Backtraces over this
347
- # amount are truncated in the middle, preserving the beginning and the end of the
348
- # stack trace.
346
+ # Defines the maximum number of frames in an error backtrace. Backtraces over
347
+ # this amount are truncated in the middle, preserving the beginning and the end
348
+ # of the stack trace.
349
349
  # error_collector.max_backtrace_frames: 50
350
350
 
351
351
  # Defines the maximum number of TransactionError events reported per harvest
@@ -357,18 +357,19 @@ common: &default_settings
357
357
  # exclude_newrelic_header: false
358
358
 
359
359
  # The exit handler that sends all cached data to the collector before shutting
360
- # down is forcibly installed. This is true even when it detects scenarios where it
361
- # generally should not be. The known use case for this option is when Sinatra runs
362
- # as an embedded service within another framework. The agent detects the Sinatra
363
- # app and skips the at_exit handler as a result. Sinatra classically runs the
364
- # entire application in an at_exit block and would otherwise misbehave if the
365
- # agent's at_exit handler was also installed in those circumstances. Note:
366
- # send_data_on_exit should also be set to true in tandem with this setting.
360
+ # down is forcibly installed. This is true even when it detects scenarios where
361
+ # it generally should not be. The known use case for this option is when Sinatra
362
+ # runs as an embedded service within another framework. The agent detects the
363
+ # Sinatra app and skips the at_exit handler as a result. Sinatra classically
364
+ # runs the entire application in an at_exit block and would otherwise misbehave
365
+ # if the agent's at_exit handler was also installed in those circumstances.
366
+ # Note: send_data_on_exit should also be set to true in tandem with this
367
+ # setting.
367
368
  # force_install_exit_handler: false
368
369
 
369
- # Ordinarily the agent reports dyno names with a trailing dot and process ID (for
370
- # example, worker.3). You can remove this trailing data by specifying the prefixes
371
- # you want to report without trailing data (for example, worker).
370
+ # Ordinarily the agent reports dyno names with a trailing dot and process ID
371
+ # (for example, worker.3). You can remove this trailing data by specifying the
372
+ # prefixes you want to report without trailing data (for example, worker).
372
373
  # heroku.dyno_name_prefixes_to_shorten: ["scheduler", "run"]
373
374
 
374
375
  # If true, the agent uses Heroku dyno names as the hostname.
@@ -395,8 +396,8 @@ common: &default_settings
395
396
  # Configures the TCP/IP port for the trace observer Host
396
397
  # infinite_tracing.trace_observer.port: 443
397
398
 
398
- # Controls auto-instrumentation of ActiveSupport::BroadcastLogger at start up. May
399
- # be one of: auto, prepend, chain, disabled. Used in Rails versions >= 7.1.
399
+ # Controls auto-instrumentation of ActiveSupport::BroadcastLogger at start up.
400
+ # May be one of: auto, prepend, chain, disabled. Used in Rails versions >= 7.1.
400
401
  # instrumentation.active_support_broadcast_logger: auto
401
402
 
402
403
  # Controls auto-instrumentation of ActiveSupport::Logger at start up. May be one
@@ -407,16 +408,20 @@ common: &default_settings
407
408
  # prepend, chain, disabled.
408
409
  # instrumentation.async_http: auto
409
410
 
411
+ # Controls auto-instrumentation of the aws-sdk-sqs library at start-up. May be
412
+ # one of: auto, prepend, chain, disabled.
413
+ # instrumentation.aws_sqs: auto
414
+
410
415
  # Controls auto-instrumentation of bunny at start-up. May be one of: auto,
411
416
  # prepend, chain, disabled.
412
417
  # instrumentation.bunny: auto
413
418
 
414
- # Controls auto-instrumentation of the concurrent-ruby library at start-up. May be
415
- # one of: auto, prepend, chain, disabled.
419
+ # Controls auto-instrumentation of the concurrent-ruby library at start-up. May
420
+ # be one of: auto, prepend, chain, disabled.
416
421
  # instrumentation.concurrent_ruby: auto
417
422
 
418
- # Controls auto-instrumentation of Curb at start-up. May be one of: auto, prepend,
419
- # chain, disabled.
423
+ # Controls auto-instrumentation of Curb at start-up. May be one of: auto,
424
+ # prepend, chain, disabled.
420
425
  # instrumentation.curb: auto
421
426
 
422
427
  # Controls auto-instrumentation of Delayed Job at start-up. May be one of: auto,
@@ -431,8 +436,8 @@ common: &default_settings
431
436
  # one of: auto, prepend, chain, disabled.
432
437
  # instrumentation.elasticsearch: auto
433
438
 
434
- # Controls auto-instrumentation of ethon at start up. May be one of auto, prepend,
435
- # chain, disabled
439
+ # Controls auto-instrumentation of ethon at start up. May be one of auto,
440
+ # prepend, chain, disabled
436
441
  # instrumentation.ethon: auto
437
442
 
438
443
  # Controls auto-instrumentation of Excon at start-up. May be one of: enabled,
@@ -450,18 +455,18 @@ common: &default_settings
450
455
  # Specifies a list of hostname patterns separated by commas that will match gRPC
451
456
  # hostnames that traffic is to be ignored by New Relic for. New Relic's gRPC
452
457
  # client instrumentation will ignore traffic streamed to a host matching any of
453
- # these patterns, and New Relic's gRPC server instrumentation will ignore traffic
454
- # for a server running on a host whose hostname matches any of these patterns. By
455
- # default, no traffic is ignored when gRPC instrumentation is itself enabled. For
456
- # example, "private.com$,exception.*"
458
+ # these patterns, and New Relic's gRPC server instrumentation will ignore
459
+ # traffic for a server running on a host whose hostname matches any of these
460
+ # patterns. By default, no traffic is ignored when gRPC instrumentation is
461
+ # itself enabled. For example, "private.com$,exception.*"
457
462
  # instrumentation.grpc.host_denylist: []
458
463
 
459
- # Controls auto-instrumentation of gRPC clients at start-up. May be one of: auto,
460
- # prepend, chain, disabled.
464
+ # Controls auto-instrumentation of gRPC clients at start-up. May be one of:
465
+ # auto, prepend, chain, disabled.
461
466
  # instrumentation.grpc_client: auto
462
467
 
463
- # Controls auto-instrumentation of gRPC servers at start-up. May be one of: auto,
464
- # prepend, chain, disabled.
468
+ # Controls auto-instrumentation of gRPC servers at start-up. May be one of:
469
+ # auto, prepend, chain, disabled.
465
470
  # instrumentation.grpc_server: auto
466
471
 
467
472
  # Controls auto-instrumentation of HTTPClient at start-up. May be one of: auto,
@@ -472,24 +477,28 @@ common: &default_settings
472
477
  # prepend, chain, disabled.
473
478
  # instrumentation.httprb: auto
474
479
 
475
- # Controls auto-instrumentation of httpx at start up. May be one of auto, prepend,
476
- # chain, disabled
480
+ # Controls auto-instrumentation of httpx at start up. May be one of auto,
481
+ # prepend, chain, disabled
477
482
  # instrumentation.httpx: auto
478
483
 
479
484
  # Controls auto-instrumentation of Ruby standard library Logger at start-up. May
480
485
  # be one of: auto, prepend, chain, disabled.
481
486
  # instrumentation.logger: auto
482
487
 
483
- # Controls auto-instrumentation of dalli gem for Memcache at start-up. May be one
484
- # of: auto, prepend, chain, disabled.
488
+ # Controls auto-instrumentation of the LogStasher library at start-up. May be
489
+ # one of: auto, prepend, chain, disabled.
490
+ # instrumentation.logstasher: auto
491
+
492
+ # Controls auto-instrumentation of dalli gem for Memcache at start-up. May be
493
+ # one of: auto, prepend, chain, disabled.
485
494
  # instrumentation.memcache: auto
486
495
 
487
496
  # Controls auto-instrumentation of memcache-client gem for Memcache at start-up.
488
497
  # May be one of: auto, prepend, chain, disabled.
489
498
  # instrumentation.memcache_client: auto
490
499
 
491
- # Controls auto-instrumentation of memcached gem for Memcache at start-up. May be
492
- # one of: auto, prepend, chain, disabled.
500
+ # Controls auto-instrumentation of memcached gem for Memcache at start-up. May
501
+ # be one of: auto, prepend, chain, disabled.
493
502
  # instrumentation.memcached: auto
494
503
 
495
504
  # Controls auto-instrumentation of Mongo at start-up. May be one of: enabled,
@@ -500,13 +509,13 @@ common: &default_settings
500
509
  # prepend, chain, disabled.
501
510
  # instrumentation.net_http: auto
502
511
 
503
- # Controls auto-instrumentation of Puma::Rack. When enabled, the agent hooks into
504
- # the to_app method in Puma::Rack::Builder to find gems to instrument during
505
- # application startup. May be one of: auto, prepend, chain, disabled.
512
+ # Controls auto-instrumentation of Puma::Rack. When enabled, the agent hooks
513
+ # into the to_app method in Puma::Rack::Builder to find gems to instrument
514
+ # during application startup. May be one of: auto, prepend, chain, disabled.
506
515
  # instrumentation.puma_rack: auto
507
516
 
508
- # Controls auto-instrumentation of Puma::Rack::URLMap at start-up. May be one of:
509
- # auto, prepend, chain, disabled.
517
+ # Controls auto-instrumentation of Puma::Rack::URLMap at start-up. May be one
518
+ # of: auto, prepend, chain, disabled.
510
519
  # instrumentation.puma_rack_urlmap: auto
511
520
 
512
521
  # Controls auto-instrumentation of Rack. When enabled, the agent hooks into the
@@ -514,12 +523,12 @@ common: &default_settings
514
523
  # startup. May be one of: auto, prepend, chain, disabled.
515
524
  # instrumentation.rack: auto
516
525
 
517
- # Controls auto-instrumentation of Rack::URLMap at start-up. May be one of: auto,
518
- # prepend, chain, disabled.
526
+ # Controls auto-instrumentation of Rack::URLMap at start-up. May be one of:
527
+ # auto, prepend, chain, disabled.
519
528
  # instrumentation.rack_urlmap: auto
520
529
 
521
- # Controls auto-instrumentation of rake at start-up. May be one of: auto, prepend,
522
- # chain, disabled.
530
+ # Controls auto-instrumentation of rake at start-up. May be one of: auto,
531
+ # prepend, chain, disabled.
523
532
  # instrumentation.rake: auto
524
533
 
525
534
  # Controls auto-instrumentation of Redis at start-up. May be one of: auto,
@@ -530,12 +539,13 @@ common: &default_settings
530
539
  # prepend, chain, disabled.
531
540
  # instrumentation.resque: auto
532
541
 
533
- # Controls auto-instrumentation of Roda at start-up. May be one of: auto, prepend,
534
- # chain, disabled.
542
+ # Controls auto-instrumentation of Roda at start-up. May be one of: auto,
543
+ # prepend, chain, disabled.
535
544
  # instrumentation.roda: auto
536
545
 
537
- # Controls auto-instrumentation of the ruby-openai gem at start-up. May be one of:
538
- # auto, prepend, chain, disabled. Defaults to disabled in high security mode.
546
+ # Controls auto-instrumentation of the ruby-openai gem at start-up. May be one
547
+ # of: auto, prepend, chain, disabled. Defaults to disabled in high security
548
+ # mode.
539
549
  # instrumentation.ruby_openai: auto
540
550
 
541
551
  # Controls auto-instrumentation of Sinatra at start-up. May be one of: auto,
@@ -546,10 +556,11 @@ common: &default_settings
546
556
  # disabled.
547
557
  # instrumentation.stripe: enabled
548
558
 
549
- # Controls auto-instrumentation of the Thread class at start-up to allow the agent
550
- # to correctly nest spans inside of an asynchronous transaction. This does not
551
- # enable the agent to automatically trace all threads created (see
552
- # instrumentation.thread.tracing). May be one of: auto, prepend, chain, disabled.
559
+ # Controls auto-instrumentation of the Thread class at start-up to allow the
560
+ # agent to correctly nest spans inside of an asynchronous transaction. This does
561
+ # not enable the agent to automatically trace all threads created (see
562
+ # instrumentation.thread.tracing). May be one of: auto, prepend, chain,
563
+ # disabled.
553
564
  # instrumentation.thread: auto
554
565
 
555
566
  # Controls auto-instrumentation of the Thread class at start-up to automatically
@@ -564,8 +575,8 @@ common: &default_settings
564
575
  # prepend, chain, disabled.
565
576
  # instrumentation.typhoeus: auto
566
577
 
567
- # Controls auto-instrumentation of ViewComponent at startup. May be one of: auto,
568
- # prepend, chain, disabled.
578
+ # Controls auto-instrumentation of ViewComponent at startup. May be one of:
579
+ # auto, prepend, chain, disabled.
569
580
  # instrumentation.view_component: auto
570
581
 
571
582
  # A dictionary of label names and values that will be applied to the data sent
@@ -624,8 +635,8 @@ common: &default_settings
624
635
 
625
636
  # Specify an Array of Rake tasks to automatically instrument. This configuration
626
637
  # option converts the Array to a RegEx list. If you'd like to allow all tasks by
627
- # default, use rake.tasks: [.+]. No rake tasks will be instrumented unless they're
628
- # added to this list. For more information, visit the New Relic Rake
638
+ # default, use rake.tasks: [.+]. No rake tasks will be instrumented unless
639
+ # they're added to this list. For more information, visit the New Relic Rake
629
640
  # Instrumentation docs.
630
641
  # rake.tasks: []
631
642
 
@@ -634,6 +645,60 @@ common: &default_settings
634
645
  # ignoring specific transactions.
635
646
  # rules.ignore_url_regexes: []
636
647
 
648
+ # BEGIN security agent
649
+ #
650
+ # NOTE: At this time, the security agent is intended for use only within
651
+ # a dedicated security testing environment with data that can tolerate
652
+ # modification or deletion. The security agent is available as a
653
+ # separate Ruby gem, newrelic_security. It is recommended that this
654
+ # separate gem only be introduced to a security testing environment
655
+ # by leveraging Bundler grouping like so:
656
+ #
657
+ # # Gemfile
658
+ # gem 'newrelic_rpm' # New Relic APM observability agent
659
+ # gem 'newrelic-infinite_tracing' # New Relic Infinite Tracing
660
+ #
661
+ # group :security do
662
+ # gem 'newrelic_security', require: false # New Relic security agent
663
+ # end
664
+ #
665
+ # NOTE: All "security.*" configuration parameters are related only to the
666
+ # security agent, and all other configuration parameters that may
667
+ # have "security" in the name some where are related to the APM agent.
668
+ #
669
+
670
+ # If true, the security agent is loaded (a Ruby 'require' is performed)
671
+ # security.agent.enabled: false
672
+
673
+ # The port the application is listening on. This setting is mandatory for
674
+ # Passenger servers. Other servers should be detected by default.
675
+ # security.application_info.port: nil
676
+
677
+ # If true, enables deserialization detection
678
+ # security.detection.deserialization.enabled: true
679
+
680
+ # If true, enables RCI (remote code injection) detection
681
+ # security.detection.rci.enabled: true
682
+
683
+ # If true, enables RXSS (reflected cross-site scripting) detection
684
+ # security.detection.rxss.enabled: true
685
+
686
+ # If true, the security agent is started (the agent runs in its event loop)
687
+ # security.enabled: false
688
+
689
+ # Defines the mode for the security agent to operate in. Currently only IAST is
690
+ # supported
691
+ # security.mode: IAST
692
+
693
+ # Defines the request body limit to process in security events (in KB). The
694
+ # default value is 300, for 300KB.
695
+ # security.request.body_limit: 300
696
+
697
+ # Defines the endpoint URL for posting security-related data
698
+ # security.validator_service_url: wss://csec.nr-data.net
699
+
700
+ # END security agent
701
+
637
702
  # Applies Language Agent Security Policy settings.
638
703
  # security_policies_token: ""
639
704
 
@@ -642,29 +707,29 @@ common: &default_settings
642
707
  # send_data_on_exit: true
643
708
 
644
709
  # If true, the agent will operate in a streamlined mode suitable for use with
645
- # short-lived serverless functions. NOTE: Only AWS Lambda functions are supported
646
- # currently and this option is not intended for use without New Relic's Ruby
647
- # Lambda layer offering.
710
+ # short-lived serverless functions. NOTE: Only AWS Lambda functions are
711
+ # supported currently and this option is not intended for use without New
712
+ # Relic's Ruby Lambda layer offering.
648
713
  # serverless_mode.enabled: false
649
714
 
650
715
  # An array of strings that will collectively serve as a denylist for filtering
651
716
  # which Sidekiq job arguments get reported to New Relic. To capture any Sidekiq
652
717
  # arguments, 'job.sidekiq.args.*' must be added to the separate
653
718
  # :'attributes.include' configuration option. Each string in this array will be
654
- # turned into a regular expression via Regexp.new to permit advanced matching. For
655
- # job argument hashes, if either a key or value matches the pair will be excluded.
656
- # All matching job argument array elements and job argument scalars will be
657
- # excluded.
719
+ # turned into a regular expression via Regexp.new to permit advanced matching.
720
+ # For job argument hashes, if either a key or value matches the pair will be
721
+ # excluded. All matching job argument array elements and job argument scalars
722
+ # will be excluded.
658
723
  # sidekiq.args.exclude: []
659
724
 
660
725
  # An array of strings that will collectively serve as an allowlist for filtering
661
726
  # which Sidekiq job arguments get reported to New Relic. To capture any Sidekiq
662
727
  # arguments, 'job.sidekiq.args.*' must be added to the separate
663
728
  # :'attributes.include' configuration option. Each string in this array will be
664
- # turned into a regular expression via Regexp.new to permit advanced matching. For
665
- # job argument hashes, if either a key or value matches the pair will be included.
666
- # All matching job argument array elements and job argument scalars will be
667
- # included.
729
+ # turned into a regular expression via Regexp.new to permit advanced matching.
730
+ # For job argument hashes, if either a key or value matches the pair will be
731
+ # included. All matching job argument array elements and job argument scalars
732
+ # will be included.
668
733
  # sidekiq.args.include: []
669
734
 
670
735
  # If true, the agent collects slow SQL queries.
@@ -675,16 +740,16 @@ common: &default_settings
675
740
  # the default setting for explain plans in slow SQL as well.
676
741
  # slow_sql.explain_enabled: true
677
742
 
678
- # Specify a threshold in seconds. The agent collects slow SQL queries and explain
679
- # plans that exceed this threshold.
743
+ # Specify a threshold in seconds. The agent collects slow SQL queries and
744
+ # explain plans that exceed this threshold.
680
745
  # slow_sql.explain_threshold: 0.5
681
746
 
682
- # Defines an obfuscation level for slow SQL queries. Valid options are obfuscated,
683
- # raw, or none.
747
+ # Defines an obfuscation level for slow SQL queries. Valid options are
748
+ # obfuscated, raw, or none.
684
749
  # slow_sql.record_sql: obfuscated
685
750
 
686
- # Generate a longer sql_id for slow SQL traces. sql_id is used for aggregation of
687
- # similar queries.
751
+ # Generate a longer sql_id for slow SQL traces. sql_id is used for aggregation
752
+ # of similar queries.
688
753
  # slow_sql.use_longer_sql_id: false
689
754
 
690
755
  # If true, the agent captures attributes on span events.
@@ -699,8 +764,8 @@ common: &default_settings
699
764
  # If true, enables span event sampling.
700
765
  # span_events.enabled: true
701
766
 
702
- # * Defines the maximum number of span events reported from a single harvest. Any
703
- # Integer between 1 and 10000 is valid.'
767
+ # * Defines the maximum number of span events reported from a single harvest.
768
+ # Any Integer between 1 and 10000 is valid.'
704
769
  # * When configuring the agent for AI monitoring, set to max value 10000.This
705
770
  # ensures the agent captures the maximum amount of distributed traces.
706
771
  # span_events.max_samples_stored: 2000
@@ -710,30 +775,31 @@ common: &default_settings
710
775
  # span_events.queue_size: 10000
711
776
 
712
777
  # Specify a list of exceptions you do not want the agent to strip when
713
- # strip_exception_messages is true. Separate exceptions with a comma. For example,
714
- # "ImportantException,PreserveMessageException".
778
+ # strip_exception_messages is true. Separate exceptions with a comma. For
779
+ # example, "ImportantException,PreserveMessageException".
715
780
  # strip_exception_messages.allowed_classes: ""
716
781
 
717
782
  # If true, the agent strips messages from all exceptions except those in the
718
783
  # allowlist. Enabled automatically in high security mode.
719
784
  # strip_exception_messages.enabled: false
720
785
 
721
- # An array of strings to specify which keys and/or values inside a Stripe event's
722
- # user_data hash should
786
+ # An array of strings to specify which keys and/or values inside a Stripe
787
+ # event's user_data hash should
723
788
  # not be reported to New Relic. Each string in this array will be turned into a
724
789
  # regular expression via
725
- # Regexp.new to permit advanced matching. For each hash pair, if either the key or
726
- # value is matched the
727
- # pair will not be reported. By default, no user_data is reported, so this option
728
- # should only be used if
790
+ # Regexp.new to permit advanced matching. For each hash pair, if either the key
791
+ # or value is matched the
792
+ # pair will not be reported. By default, no user_data is reported, so this
793
+ # option should only be used if
729
794
  # the stripe.user_data.include option is being used.
730
795
  # stripe.user_data.exclude: []
731
796
 
732
- # An array of strings to specify which keys inside a Stripe event's user_data hash
733
- # should be reported
734
- # to New Relic. Each string in this array will be turned into a regular expression
735
- # via Regexp.new to
736
- # permit advanced matching. Setting the value to ["."] will report all user_data.
797
+ # An array of strings to specify which keys inside a Stripe event's user_data
798
+ # hash should be reported
799
+ # to New Relic. Each string in this array will be turned into a regular
800
+ # expression via Regexp.new to
801
+ # permit advanced matching. Setting the value to ["."] will report all
802
+ # user_data.
737
803
  # stripe.user_data.include: []
738
804
 
739
805
  # When set to true, forces a synchronous connection to the New Relic collector
@@ -754,8 +820,8 @@ common: &default_settings
754
820
  # If true, the agent captures attributes from transaction events.
755
821
  # transaction_events.attributes.enabled: true
756
822
 
757
- # Prefix of attributes to exclude from transaction events. Allows * as wildcard at
758
- # end.
823
+ # Prefix of attributes to exclude from transaction events. Allows * as wildcard
824
+ # at end.
759
825
  # transaction_events.attributes.exclude: []
760
826
 
761
827
  # Prefix of attributes to include in transaction events. Allows * as wildcard at
@@ -765,25 +831,26 @@ common: &default_settings
765
831
  # If true, enables transaction event sampling.
766
832
  # transaction_events.enabled: true
767
833
 
768
- # Defines the maximum number of transaction events reported from a single harvest.
834
+ # Defines the maximum number of transaction events reported from a single
835
+ # harvest.
769
836
  # transaction_events.max_samples_stored: 1200
770
837
 
771
838
  # If true, the agent captures attributes on transaction segments.
772
839
  # transaction_segments.attributes.enabled: true
773
840
 
774
- # Prefix of attributes to exclude from transaction segments. Allows * as wildcard
775
- # at end.
841
+ # Prefix of attributes to exclude from transaction segments. Allows * as
842
+ # wildcard at end.
776
843
  # transaction_segments.attributes.exclude: []
777
844
 
778
- # Prefix of attributes to include on transaction segments. Allows * as wildcard at
779
- # end.
845
+ # Prefix of attributes to include on transaction segments. Allows * as wildcard
846
+ # at end.
780
847
  # transaction_segments.attributes.include: []
781
848
 
782
849
  # If true, the agent captures attributes from transaction traces.
783
850
  # transaction_tracer.attributes.enabled: true
784
851
 
785
- # Prefix of attributes to exclude from transaction traces. Allows * as wildcard at
786
- # end.
852
+ # Prefix of attributes to exclude from transaction traces. Allows * as wildcard
853
+ # at end.
787
854
  # transaction_tracer.attributes.exclude: []
788
855
 
789
856
  # Prefix of attributes to include in transaction traces. Allows * as wildcard at
data/newrelic_rpm.gemspec CHANGED
@@ -56,6 +56,8 @@ Gem::Specification.new do |s|
56
56
  s.add_development_dependency 'minitest', "#{RUBY_VERSION >= '2.7.0' ? '5.3.3' : '4.7.5'}"
57
57
  s.add_development_dependency 'minitest-stub-const', '0.6'
58
58
  s.add_development_dependency 'mocha', '~> 1.16'
59
+ s.add_development_dependency 'mutex_m' # used by Minitest, not included in Rubies above v3.3
60
+ s.add_development_dependency 'ostruct' # used by Rack, not included in Rubies above v3.4
59
61
  s.add_development_dependency 'pry' if ENV['ENABLE_PRY']
60
62
  s.add_development_dependency 'rack'
61
63
  s.add_development_dependency 'rake', '12.3.3'
data/test/agent_helper.rb CHANGED
@@ -1043,3 +1043,12 @@ end
1043
1043
  def ruby_version_float
1044
1044
  RUBY_VERSION.split('.')[0..1].join('.').to_f
1045
1045
  end
1046
+
1047
+ def rails_version
1048
+ @rails_version ||= Gem::Version.new(Rails::VERSION::STRING)
1049
+ end
1050
+
1051
+ def rails_version_at_least?(version_string)
1052
+ version_string += '.0' until version_string.count('.') >= 2 # '7' => '7.0.0'
1053
+ rails_version >= Gem::Version.new(version_string)
1054
+ end