newrelic_rpm 9.3.0 → 9.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.build_ignore +6 -1
- data/CHANGELOG.md +193 -6
- data/README.md +4 -0
- data/Rakefile +1 -1
- data/lib/new_relic/agent/attribute_pre_filtering.rb +109 -0
- data/lib/new_relic/agent/configuration/default_source.rb +177 -34
- data/lib/new_relic/agent/configuration/environment_source.rb +1 -1
- data/lib/new_relic/agent/distributed_tracing.rb +1 -1
- data/lib/new_relic/agent/http_clients/async_http_wrappers.rb +83 -0
- data/lib/new_relic/agent/http_clients/ethon_wrappers.rb +111 -0
- data/lib/new_relic/agent/http_clients/httpx_wrappers.rb +93 -0
- data/lib/new_relic/agent/instrumentation/action_controller_other_subscriber.rb +1 -1
- data/lib/new_relic/agent/instrumentation/active_record_helper.rb +1 -2
- data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger/chain.rb +69 -0
- data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger/instrumentation.rb +13 -0
- data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger/prepend.rb +37 -0
- data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger.rb +23 -0
- data/lib/new_relic/agent/instrumentation/active_support_logger/instrumentation.rb +4 -0
- data/lib/new_relic/agent/instrumentation/active_support_logger.rb +3 -1
- data/lib/new_relic/agent/instrumentation/async_http/chain.rb +23 -0
- data/lib/new_relic/agent/instrumentation/async_http/instrumentation.rb +37 -0
- data/lib/new_relic/agent/instrumentation/async_http/prepend.rb +15 -0
- data/lib/new_relic/agent/instrumentation/async_http.rb +26 -0
- data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +9 -0
- data/lib/new_relic/agent/instrumentation/concurrent_ruby/instrumentation.rb +2 -2
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +1 -2
- data/lib/new_relic/agent/instrumentation/curb/instrumentation.rb +4 -0
- data/lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb +3 -0
- data/lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb +4 -1
- data/lib/new_relic/agent/instrumentation/ethon/chain.rb +39 -0
- data/lib/new_relic/agent/instrumentation/ethon/instrumentation.rb +105 -0
- data/lib/new_relic/agent/instrumentation/ethon/prepend.rb +35 -0
- data/lib/new_relic/agent/instrumentation/ethon.rb +39 -0
- data/lib/new_relic/agent/instrumentation/excon/middleware.rb +3 -0
- data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +4 -0
- data/lib/new_relic/agent/instrumentation/grpc/client/instrumentation.rb +4 -0
- data/lib/new_relic/agent/instrumentation/grpc/server/instrumentation.rb +4 -0
- data/lib/new_relic/agent/instrumentation/grpc_client.rb +1 -1
- data/lib/new_relic/agent/instrumentation/grpc_server.rb +1 -1
- data/lib/new_relic/agent/instrumentation/httpclient/instrumentation.rb +4 -0
- data/lib/new_relic/agent/instrumentation/httprb/instrumentation.rb +4 -0
- data/lib/new_relic/agent/instrumentation/httpx/chain.rb +20 -0
- data/lib/new_relic/agent/instrumentation/httpx/instrumentation.rb +51 -0
- data/lib/new_relic/agent/instrumentation/httpx/prepend.rb +15 -0
- data/lib/new_relic/agent/instrumentation/httpx.rb +27 -0
- data/lib/new_relic/agent/instrumentation/logger/instrumentation.rb +3 -0
- data/lib/new_relic/agent/instrumentation/memcache/instrumentation.rb +9 -0
- data/lib/new_relic/agent/instrumentation/memcache.rb +2 -2
- data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +1 -3
- data/lib/new_relic/agent/instrumentation/net_http/instrumentation.rb +5 -1
- data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +4 -0
- data/lib/new_relic/agent/instrumentation/padrino/instrumentation.rb +4 -0
- data/lib/new_relic/agent/instrumentation/queue_time.rb +1 -1
- data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +6 -0
- data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +4 -0
- data/lib/new_relic/agent/instrumentation/rails_notifications/action_controller.rb +1 -0
- data/lib/new_relic/agent/instrumentation/rake/instrumentation.rb +4 -0
- data/lib/new_relic/agent/instrumentation/redis/instrumentation.rb +4 -0
- data/lib/new_relic/agent/instrumentation/resque/instrumentation.rb +4 -0
- data/lib/new_relic/agent/instrumentation/roda/chain.rb +43 -0
- data/lib/new_relic/agent/instrumentation/roda/ignorer.rb +45 -0
- data/lib/new_relic/agent/instrumentation/roda/instrumentation.rb +68 -0
- data/lib/new_relic/agent/instrumentation/roda/prepend.rb +24 -0
- data/lib/new_relic/agent/instrumentation/roda/roda_transaction_namer.rb +29 -0
- data/lib/new_relic/agent/instrumentation/roda.rb +36 -0
- data/lib/new_relic/agent/instrumentation/sequel.rb +1 -1
- data/lib/new_relic/agent/instrumentation/sidekiq/client.rb +4 -0
- data/lib/new_relic/agent/instrumentation/sidekiq/server.rb +26 -3
- data/lib/new_relic/agent/instrumentation/sidekiq.rb +5 -3
- data/lib/new_relic/agent/instrumentation/sinatra/instrumentation.rb +4 -0
- data/lib/new_relic/agent/instrumentation/sinatra/transaction_namer.rb +1 -3
- data/lib/new_relic/agent/instrumentation/stripe.rb +28 -0
- data/lib/new_relic/agent/instrumentation/stripe_subscriber.rb +77 -0
- data/lib/new_relic/agent/instrumentation/tilt/instrumentation.rb +4 -0
- data/lib/new_relic/agent/instrumentation/typhoeus/instrumentation.rb +5 -1
- data/lib/new_relic/agent/log_event_attributes.rb +1 -1
- data/lib/new_relic/agent/messaging.rb +2 -2
- data/lib/new_relic/agent/monitors/synthetics_monitor.rb +12 -1
- data/lib/new_relic/agent/new_relic_service.rb +33 -17
- data/lib/new_relic/agent/pipe_service.rb +1 -1
- data/lib/new_relic/agent/rules_engine.rb +1 -1
- data/lib/new_relic/agent/span_event_primitive.rb +16 -4
- data/lib/new_relic/agent/system_info.rb +26 -0
- data/lib/new_relic/agent/tracer.rb +5 -6
- data/lib/new_relic/agent/transaction/abstract_segment.rb +55 -0
- data/lib/new_relic/agent/transaction/external_request_segment.rb +5 -2
- data/lib/new_relic/agent/transaction/message_broker_segment.rb +1 -2
- data/lib/new_relic/agent/transaction/request_attributes.rb +46 -10
- data/lib/new_relic/agent/transaction.rb +30 -6
- data/lib/new_relic/agent/transaction_error_primitive.rb +16 -0
- data/lib/new_relic/agent/transaction_event_primitive.rb +19 -0
- data/lib/new_relic/agent/utilization/gcp.rb +1 -3
- data/lib/new_relic/agent/utilization/vendor.rb +5 -7
- data/lib/new_relic/agent.rb +19 -3
- data/lib/new_relic/cli/command.rb +1 -0
- data/lib/new_relic/constants.rb +3 -0
- data/lib/new_relic/control/class_methods.rb +1 -7
- data/lib/new_relic/control/frameworks/rails.rb +14 -2
- data/lib/new_relic/control/frameworks/roda.rb +20 -0
- data/lib/new_relic/language_support.rb +9 -0
- data/lib/new_relic/noticed_error.rb +5 -2
- data/lib/new_relic/rack/agent_hooks.rb +1 -1
- data/lib/new_relic/rack/agent_middleware.rb +0 -16
- data/lib/new_relic/rack/browser_monitoring.rb +1 -1
- data/lib/new_relic/supportability_helper.rb +1 -0
- data/lib/new_relic/version.rb +1 -1
- data/lib/tasks/bump_version.rake +1 -1
- data/lib/tasks/config.rake +3 -2
- data/lib/tasks/helpers/config.html.erb +93 -0
- data/lib/tasks/helpers/format.rb +11 -7
- data/lib/tasks/helpers/version_bump.rb +2 -2
- data/lib/tasks/instrumentation_generator/instrumentation.thor +3 -3
- data/lib/tasks/newrelicyml.rake +1 -1
- data/lib/tasks/tests.rake +71 -0
- data/newrelic.yml +103 -31
- data/newrelic_rpm.gemspec +12 -6
- data/test/agent_helper.rb +1027 -0
- metadata +63 -8
- data/lib/tasks/helpers/removers.rb +0 -33
- data/lib/tasks/multiverse.rake +0 -6
- data/lib/tasks/multiverse.rb +0 -76
@@ -3,6 +3,7 @@
|
|
3
3
|
# frozen_string_literal: true
|
4
4
|
|
5
5
|
require 'forwardable'
|
6
|
+
require_relative '../../constants'
|
6
7
|
|
7
8
|
module NewRelic
|
8
9
|
module Agent
|
@@ -24,7 +25,7 @@ module NewRelic
|
|
24
25
|
# Does not appear in logs.
|
25
26
|
def self.deprecated_description(new_setting, description)
|
26
27
|
link_ref = new_setting.to_s.tr('.', '-')
|
27
|
-
%{Please see: [#{new_setting}](
|
28
|
+
%{Please see: [#{new_setting}](##{link_ref}). \n\n#{description}}
|
28
29
|
end
|
29
30
|
|
30
31
|
class Boolean
|
@@ -115,6 +116,7 @@ module NewRelic
|
|
115
116
|
:rails_notifications
|
116
117
|
end
|
117
118
|
when defined?(::Sinatra) && defined?(::Sinatra::Base) then :sinatra
|
119
|
+
when defined?(::Roda) then :roda
|
118
120
|
when defined?(::NewRelic::IA) then :external
|
119
121
|
else :ruby
|
120
122
|
end
|
@@ -818,6 +820,13 @@ module NewRelic
|
|
818
820
|
:description => 'If `true`, the agent captures metrics related to logging for your application.'
|
819
821
|
},
|
820
822
|
# Attributes
|
823
|
+
:'allow_all_headers' => {
|
824
|
+
:default => false,
|
825
|
+
:public => true,
|
826
|
+
:type => Boolean,
|
827
|
+
:allowed_from_server => false,
|
828
|
+
:description => 'If `true`, enables capture of all HTTP request headers for all destinations.'
|
829
|
+
},
|
821
830
|
:'attributes.enabled' => {
|
822
831
|
:default => true,
|
823
832
|
:public => true,
|
@@ -1005,7 +1014,20 @@ module NewRelic
|
|
1005
1014
|
},
|
1006
1015
|
# Autostart
|
1007
1016
|
:'autostart.denylisted_constants' => {
|
1008
|
-
:default =>
|
1017
|
+
:default => %w[Rails::Command::ConsoleCommand
|
1018
|
+
Rails::Command::CredentialsCommand
|
1019
|
+
Rails::Command::Db::System::ChangeCommand
|
1020
|
+
Rails::Command::DbConsoleCommand
|
1021
|
+
Rails::Command::DestroyCommand
|
1022
|
+
Rails::Command::DevCommand
|
1023
|
+
Rails::Command::EncryptedCommand
|
1024
|
+
Rails::Command::GenerateCommand
|
1025
|
+
Rails::Command::InitializersCommand
|
1026
|
+
Rails::Command::NotesCommand
|
1027
|
+
Rails::Command::RoutesCommand
|
1028
|
+
Rails::Command::SecretsCommand
|
1029
|
+
Rails::Console
|
1030
|
+
Rails::DBConsole].join(','),
|
1009
1031
|
:public => true,
|
1010
1032
|
:type => String,
|
1011
1033
|
:allowed_from_server => false,
|
@@ -1042,7 +1064,7 @@ module NewRelic
|
|
1042
1064
|
:allowed_from_server => true,
|
1043
1065
|
:deprecated => true,
|
1044
1066
|
:description => deprecated_description(
|
1045
|
-
:'distributed_tracing
|
1067
|
+
:'distributed_tracing.enabled',
|
1046
1068
|
'If `true`, enables [cross-application tracing](/docs/agents/ruby-agent/features/cross-application-tracing-ruby/) when `distributed_tracing.enabled` is set to `false`.'
|
1047
1069
|
)
|
1048
1070
|
},
|
@@ -1204,7 +1226,13 @@ module NewRelic
|
|
1204
1226
|
:public => true,
|
1205
1227
|
:type => Boolean,
|
1206
1228
|
:allowed_from_server => false,
|
1207
|
-
:description =>
|
1229
|
+
:description => <<~DESCRIPTION
|
1230
|
+
If `true`, the agent won't wrap third-party middlewares in instrumentation (regardless of whether they are installed via `Rack::Builder` or Rails).
|
1231
|
+
|
1232
|
+
<Callout variant="important">
|
1233
|
+
When middleware instrumentation is disabled, if an application is using middleware that could alter the response code, the HTTP status code reported on the transaction may not reflect the altered value.
|
1234
|
+
</Callout>
|
1235
|
+
DESCRIPTION
|
1208
1236
|
},
|
1209
1237
|
:disable_samplers => {
|
1210
1238
|
:default => false,
|
@@ -1227,6 +1255,13 @@ module NewRelic
|
|
1227
1255
|
:allowed_from_server => false,
|
1228
1256
|
:description => 'If `true`, disables [Sidekiq instrumentation](/docs/agents/ruby-agent/background-jobs/sidekiq-instrumentation).'
|
1229
1257
|
},
|
1258
|
+
:disable_roda_auto_middleware => {
|
1259
|
+
:default => false,
|
1260
|
+
:public => true,
|
1261
|
+
:type => Boolean,
|
1262
|
+
:allowed_from_server => false,
|
1263
|
+
:description => 'If `true`, disables agent middleware for Roda. This middleware is responsible for advanced feature support such as [page load timing](/docs/browser/new-relic-browser/getting-started/new-relic-browser) and [error collection](/docs/apm/applications-menu/events/view-apm-error-analytics).'
|
1264
|
+
},
|
1230
1265
|
:disable_sinatra_auto_middleware => {
|
1231
1266
|
:default => false,
|
1232
1267
|
:public => true,
|
@@ -1326,6 +1361,15 @@ module NewRelic
|
|
1326
1361
|
:description => 'Configures the TCP/IP port for the trace observer Host'
|
1327
1362
|
},
|
1328
1363
|
# Instrumentation
|
1364
|
+
:'instrumentation.active_support_broadcast_logger' => {
|
1365
|
+
:default => instrumentation_value_from_boolean(:'application_logging.enabled'),
|
1366
|
+
:documentation_default => 'auto',
|
1367
|
+
:dynamic_name => true,
|
1368
|
+
:public => true,
|
1369
|
+
:type => String,
|
1370
|
+
:allowed_from_server => false,
|
1371
|
+
:description => 'Controls auto-instrumentation of `ActiveSupport::BroadcastLogger` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`. Used in Rails versions >= 7.1.'
|
1372
|
+
},
|
1329
1373
|
:'instrumentation.active_support_logger' => {
|
1330
1374
|
:default => instrumentation_value_from_boolean(:'application_logging.enabled'),
|
1331
1375
|
:documentation_default => 'auto',
|
@@ -1333,7 +1377,15 @@ module NewRelic
|
|
1333
1377
|
:public => true,
|
1334
1378
|
:type => String,
|
1335
1379
|
:allowed_from_server => false,
|
1336
|
-
:description => 'Controls auto-instrumentation of `ActiveSupport::Logger` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1380
|
+
:description => 'Controls auto-instrumentation of `ActiveSupport::Logger` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`. Used in Rails versions below 7.1.'
|
1381
|
+
},
|
1382
|
+
:'instrumentation.async_http' => {
|
1383
|
+
:default => 'auto',
|
1384
|
+
:public => true,
|
1385
|
+
:type => String,
|
1386
|
+
:dynamic_name => true,
|
1387
|
+
:allowed_from_server => false,
|
1388
|
+
:description => 'Controls auto-instrumentation of Async::HTTP at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1337
1389
|
},
|
1338
1390
|
:'instrumentation.bunny' => {
|
1339
1391
|
:default => 'auto',
|
@@ -1341,7 +1393,7 @@ module NewRelic
|
|
1341
1393
|
:type => String,
|
1342
1394
|
:dynamic_name => true,
|
1343
1395
|
:allowed_from_server => false,
|
1344
|
-
:description => 'Controls auto-instrumentation of bunny at start
|
1396
|
+
:description => 'Controls auto-instrumentation of bunny at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1345
1397
|
},
|
1346
1398
|
:'instrumentation.fiber' => {
|
1347
1399
|
:default => 'auto',
|
@@ -1349,7 +1401,7 @@ module NewRelic
|
|
1349
1401
|
:type => String,
|
1350
1402
|
:dynamic_name => true,
|
1351
1403
|
:allowed_from_server => false,
|
1352
|
-
:description => 'Controls auto-instrumentation of the Fiber class at start
|
1404
|
+
:description => 'Controls auto-instrumentation of the Fiber class at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1353
1405
|
},
|
1354
1406
|
:'instrumentation.concurrent_ruby' => {
|
1355
1407
|
:default => 'auto',
|
@@ -1357,7 +1409,7 @@ module NewRelic
|
|
1357
1409
|
:type => String,
|
1358
1410
|
:dynamic_name => true,
|
1359
1411
|
:allowed_from_server => false,
|
1360
|
-
:description => 'Controls auto-instrumentation of the concurrent-ruby library at start
|
1412
|
+
:description => 'Controls auto-instrumentation of the concurrent-ruby library at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1361
1413
|
},
|
1362
1414
|
:'instrumentation.curb' => {
|
1363
1415
|
:default => 'auto',
|
@@ -1366,7 +1418,7 @@ module NewRelic
|
|
1366
1418
|
:type => String,
|
1367
1419
|
:dynamic_name => true,
|
1368
1420
|
:allowed_from_server => false,
|
1369
|
-
:description => 'Controls auto-instrumentation of Curb at start
|
1421
|
+
:description => 'Controls auto-instrumentation of Curb at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1370
1422
|
},
|
1371
1423
|
:'instrumentation.delayed_job' => {
|
1372
1424
|
:default => 'auto',
|
@@ -1375,7 +1427,7 @@ module NewRelic
|
|
1375
1427
|
:type => String,
|
1376
1428
|
:dynamic_name => true,
|
1377
1429
|
:allowed_from_server => false,
|
1378
|
-
:description => 'Controls auto-instrumentation of Delayed Job at start
|
1430
|
+
:description => 'Controls auto-instrumentation of Delayed Job at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1379
1431
|
},
|
1380
1432
|
:'instrumentation.elasticsearch' => {
|
1381
1433
|
:default => 'auto',
|
@@ -1383,7 +1435,15 @@ module NewRelic
|
|
1383
1435
|
:type => String,
|
1384
1436
|
:dynamic_name => true,
|
1385
1437
|
:allowed_from_server => false,
|
1386
|
-
:description => 'Controls auto-instrumentation of the elasticsearch library at start
|
1438
|
+
:description => 'Controls auto-instrumentation of the elasticsearch library at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1439
|
+
},
|
1440
|
+
:'instrumentation.ethon' => {
|
1441
|
+
:default => 'auto',
|
1442
|
+
:public => true,
|
1443
|
+
:type => String,
|
1444
|
+
:dynamic_name => true,
|
1445
|
+
:allowed_from_server => false,
|
1446
|
+
:description => 'Controls auto-instrumentation of ethon at start up. May be one of [auto|prepend|chain|disabled]'
|
1387
1447
|
},
|
1388
1448
|
:'instrumentation.excon' => {
|
1389
1449
|
:default => 'enabled',
|
@@ -1392,7 +1452,7 @@ module NewRelic
|
|
1392
1452
|
:type => String,
|
1393
1453
|
:dynamic_name => true,
|
1394
1454
|
:allowed_from_server => false,
|
1395
|
-
:description => 'Controls auto-instrumentation of Excon at start
|
1455
|
+
:description => 'Controls auto-instrumentation of Excon at start-up. May be one of: `enabled`, `disabled`.'
|
1396
1456
|
},
|
1397
1457
|
:'instrumentation.grape' => {
|
1398
1458
|
:default => 'auto',
|
@@ -1400,7 +1460,7 @@ module NewRelic
|
|
1400
1460
|
:type => String,
|
1401
1461
|
:dynamic_name => true,
|
1402
1462
|
:allowed_from_server => false,
|
1403
|
-
:description => 'Controls auto-instrumentation of Grape at start
|
1463
|
+
:description => 'Controls auto-instrumentation of Grape at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1404
1464
|
},
|
1405
1465
|
:'instrumentation.grpc_client' => {
|
1406
1466
|
:default => 'auto',
|
@@ -1409,7 +1469,7 @@ module NewRelic
|
|
1409
1469
|
:type => String,
|
1410
1470
|
:dynamic_name => true,
|
1411
1471
|
:allowed_from_server => false,
|
1412
|
-
:description => 'Controls auto-instrumentation of gRPC clients at start
|
1472
|
+
:description => 'Controls auto-instrumentation of gRPC clients at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1413
1473
|
},
|
1414
1474
|
:'instrumentation.grpc.host_denylist' => {
|
1415
1475
|
:default => [],
|
@@ -1426,7 +1486,7 @@ module NewRelic
|
|
1426
1486
|
:type => String,
|
1427
1487
|
:dynamic_name => true,
|
1428
1488
|
:allowed_from_server => false,
|
1429
|
-
:description => 'Controls auto-instrumentation of gRPC servers at start
|
1489
|
+
:description => 'Controls auto-instrumentation of gRPC servers at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1430
1490
|
},
|
1431
1491
|
:'instrumentation.httpclient' => {
|
1432
1492
|
:default => 'auto',
|
@@ -1435,7 +1495,7 @@ module NewRelic
|
|
1435
1495
|
:type => String,
|
1436
1496
|
:dynamic_name => true,
|
1437
1497
|
:allowed_from_server => false,
|
1438
|
-
:description => 'Controls auto-instrumentation of HTTPClient at start
|
1498
|
+
:description => 'Controls auto-instrumentation of HTTPClient at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1439
1499
|
},
|
1440
1500
|
:'instrumentation.httprb' => {
|
1441
1501
|
:default => 'auto',
|
@@ -1444,7 +1504,16 @@ module NewRelic
|
|
1444
1504
|
:type => String,
|
1445
1505
|
:dynamic_name => true,
|
1446
1506
|
:allowed_from_server => false,
|
1447
|
-
:description => 'Controls auto-instrumentation of http.rb gem at start
|
1507
|
+
:description => 'Controls auto-instrumentation of http.rb gem at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1508
|
+
},
|
1509
|
+
:'instrumentation.httpx' => {
|
1510
|
+
:default => 'auto',
|
1511
|
+
:documentation_default => 'auto',
|
1512
|
+
:public => true,
|
1513
|
+
:type => String,
|
1514
|
+
:dynamic_name => true,
|
1515
|
+
:allowed_from_server => false,
|
1516
|
+
:description => 'Controls auto-instrumentation of httpx at start up. May be one of [auto|prepend|chain|disabled]'
|
1448
1517
|
},
|
1449
1518
|
:'instrumentation.logger' => {
|
1450
1519
|
:default => instrumentation_value_from_boolean(:'application_logging.enabled'),
|
@@ -1453,7 +1522,7 @@ module NewRelic
|
|
1453
1522
|
:type => String,
|
1454
1523
|
:dynamic_name => true,
|
1455
1524
|
:allowed_from_server => false,
|
1456
|
-
:description => 'Controls auto-instrumentation of Ruby standard library Logger at start
|
1525
|
+
:description => 'Controls auto-instrumentation of Ruby standard library Logger at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1457
1526
|
},
|
1458
1527
|
:'instrumentation.memcache' => {
|
1459
1528
|
:default => 'auto',
|
@@ -1461,7 +1530,7 @@ module NewRelic
|
|
1461
1530
|
:type => String,
|
1462
1531
|
:dynamic_name => true,
|
1463
1532
|
:allowed_from_server => false,
|
1464
|
-
:description => 'Controls auto-instrumentation of dalli gem for Memcache at start
|
1533
|
+
:description => 'Controls auto-instrumentation of dalli gem for Memcache at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1465
1534
|
},
|
1466
1535
|
:'instrumentation.memcached' => {
|
1467
1536
|
:default => 'auto',
|
@@ -1470,7 +1539,7 @@ module NewRelic
|
|
1470
1539
|
:type => String,
|
1471
1540
|
:dynamic_name => true,
|
1472
1541
|
:allowed_from_server => false,
|
1473
|
-
:description => 'Controls auto-instrumentation of memcached gem for Memcache at start
|
1542
|
+
:description => 'Controls auto-instrumentation of memcached gem for Memcache at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1474
1543
|
},
|
1475
1544
|
:'instrumentation.memcache_client' => {
|
1476
1545
|
:default => 'auto',
|
@@ -1479,7 +1548,7 @@ module NewRelic
|
|
1479
1548
|
:type => String,
|
1480
1549
|
:dynamic_name => true,
|
1481
1550
|
:allowed_from_server => false,
|
1482
|
-
:description => 'Controls auto-instrumentation of memcache-client gem for Memcache at start
|
1551
|
+
:description => 'Controls auto-instrumentation of memcache-client gem for Memcache at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1483
1552
|
},
|
1484
1553
|
:'instrumentation.mongo' => {
|
1485
1554
|
:default => 'enabled',
|
@@ -1488,7 +1557,7 @@ module NewRelic
|
|
1488
1557
|
:type => String,
|
1489
1558
|
:dynamic_name => true,
|
1490
1559
|
:allowed_from_server => false,
|
1491
|
-
:description => 'Controls auto-instrumentation of Mongo at start
|
1560
|
+
:description => 'Controls auto-instrumentation of Mongo at start-up. May be one of: `enabled`, `disabled`.'
|
1492
1561
|
},
|
1493
1562
|
:'instrumentation.net_http' => {
|
1494
1563
|
:default => 'auto',
|
@@ -1497,7 +1566,7 @@ module NewRelic
|
|
1497
1566
|
:type => String,
|
1498
1567
|
:dynamic_name => true,
|
1499
1568
|
:allowed_from_server => false,
|
1500
|
-
:description => 'Controls auto-instrumentation of `Net::HTTP` at start
|
1569
|
+
:description => 'Controls auto-instrumentation of `Net::HTTP` at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1501
1570
|
},
|
1502
1571
|
:'instrumentation.puma_rack' => {
|
1503
1572
|
:default => value_of(:'instrumentation.rack'),
|
@@ -1517,7 +1586,7 @@ module NewRelic
|
|
1517
1586
|
:type => String,
|
1518
1587
|
:dynamic_name => true,
|
1519
1588
|
:allowed_from_server => false,
|
1520
|
-
:description => 'Controls auto-instrumentation of `Puma::Rack::URLMap` at start
|
1589
|
+
:description => 'Controls auto-instrumentation of `Puma::Rack::URLMap` at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1521
1590
|
},
|
1522
1591
|
:'instrumentation.rack' => {
|
1523
1592
|
:default => 'auto',
|
@@ -1537,7 +1606,7 @@ module NewRelic
|
|
1537
1606
|
:type => String,
|
1538
1607
|
:dynamic_name => true,
|
1539
1608
|
:allowed_from_server => false,
|
1540
|
-
:description => 'Controls auto-instrumentation of `Rack::URLMap` at start
|
1609
|
+
:description => 'Controls auto-instrumentation of `Rack::URLMap` at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1541
1610
|
},
|
1542
1611
|
:'instrumentation.rake' => {
|
1543
1612
|
:default => 'auto',
|
@@ -1545,7 +1614,7 @@ module NewRelic
|
|
1545
1614
|
:type => String,
|
1546
1615
|
:dynamic_name => true,
|
1547
1616
|
:allowed_from_server => false,
|
1548
|
-
:description => 'Controls auto-instrumentation of rake at start
|
1617
|
+
:description => 'Controls auto-instrumentation of rake at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1549
1618
|
},
|
1550
1619
|
:'instrumentation.redis' => {
|
1551
1620
|
:default => 'auto',
|
@@ -1553,7 +1622,7 @@ module NewRelic
|
|
1553
1622
|
:type => String,
|
1554
1623
|
:dynamic_name => true,
|
1555
1624
|
:allowed_from_server => false,
|
1556
|
-
:description => 'Controls auto-instrumentation of Redis at start
|
1625
|
+
:description => 'Controls auto-instrumentation of Redis at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1557
1626
|
},
|
1558
1627
|
:'instrumentation.resque' => {
|
1559
1628
|
:default => 'auto',
|
@@ -1562,7 +1631,15 @@ module NewRelic
|
|
1562
1631
|
:type => String,
|
1563
1632
|
:dynamic_name => true,
|
1564
1633
|
:allowed_from_server => false,
|
1565
|
-
:description => 'Controls auto-instrumentation of resque at start
|
1634
|
+
:description => 'Controls auto-instrumentation of resque at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1635
|
+
},
|
1636
|
+
:'instrumentation.roda' => {
|
1637
|
+
:default => 'auto',
|
1638
|
+
:public => true,
|
1639
|
+
:type => String,
|
1640
|
+
:dynamic_name => true,
|
1641
|
+
:allowed_from_server => false,
|
1642
|
+
:description => 'Controls auto-instrumentation of Roda at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1566
1643
|
},
|
1567
1644
|
:'instrumentation.sinatra' => {
|
1568
1645
|
:default => 'auto',
|
@@ -1570,7 +1647,42 @@ module NewRelic
|
|
1570
1647
|
:type => String,
|
1571
1648
|
:dynamic_name => true,
|
1572
1649
|
:allowed_from_server => false,
|
1573
|
-
:description => 'Controls auto-instrumentation of Sinatra at start
|
1650
|
+
:description => 'Controls auto-instrumentation of Sinatra at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1651
|
+
},
|
1652
|
+
:'instrumentation.stripe' => {
|
1653
|
+
:default => 'enabled',
|
1654
|
+
:public => true,
|
1655
|
+
:type => String,
|
1656
|
+
:allowed_from_server => false,
|
1657
|
+
:description => 'Controls auto-instrumentation of Stripe at startup. May be one of: `enabled`, `disabled`.'
|
1658
|
+
},
|
1659
|
+
:'stripe.user_data.include' => {
|
1660
|
+
default: NewRelic::EMPTY_ARRAY,
|
1661
|
+
public: true,
|
1662
|
+
type: Array,
|
1663
|
+
dynamic_name: true,
|
1664
|
+
allowed_from_server: false,
|
1665
|
+
:transform => DefaultSource.method(:convert_to_list),
|
1666
|
+
:description => <<~DESCRIPTION
|
1667
|
+
An array of strings to specify which keys inside a Stripe event's `user_data` hash should be reported
|
1668
|
+
to New Relic. Each string in this array will be turned into a regular expression via `Regexp.new` to
|
1669
|
+
permit advanced matching. Setting the value to `["."]` will report all `user_data`.
|
1670
|
+
DESCRIPTION
|
1671
|
+
},
|
1672
|
+
:'stripe.user_data.exclude' => {
|
1673
|
+
default: NewRelic::EMPTY_ARRAY,
|
1674
|
+
public: true,
|
1675
|
+
type: Array,
|
1676
|
+
dynamic_name: true,
|
1677
|
+
allowed_from_server: false,
|
1678
|
+
:transform => DefaultSource.method(:convert_to_list),
|
1679
|
+
:description => <<~DESCRIPTION
|
1680
|
+
An array of strings to specify which keys and/or values inside a Stripe event's `user_data` hash should
|
1681
|
+
not be reported to New Relic. Each string in this array will be turned into a regular expression via
|
1682
|
+
`Regexp.new` to permit advanced matching. For each hash pair, if either the key or value is matched the
|
1683
|
+
pair will not be reported. By default, no `user_data` is reported, so this option should only be used if
|
1684
|
+
the `stripe.user_data.include` option is being used.
|
1685
|
+
DESCRIPTION
|
1574
1686
|
},
|
1575
1687
|
:'instrumentation.thread' => {
|
1576
1688
|
:default => 'auto',
|
@@ -1578,14 +1690,14 @@ module NewRelic
|
|
1578
1690
|
:type => String,
|
1579
1691
|
:dynamic_name => true,
|
1580
1692
|
:allowed_from_server => false,
|
1581
|
-
:description => 'Controls auto-instrumentation of the Thread class at start
|
1693
|
+
:description => 'Controls auto-instrumentation of the Thread class at start-up to allow the agent to correctly nest spans inside of an asynchronous transaction. This does not enable the agent to automatically trace all threads created (see `instrumentation.thread.tracing`). May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1582
1694
|
},
|
1583
1695
|
:'instrumentation.thread.tracing' => {
|
1584
1696
|
:default => true,
|
1585
1697
|
:public => true,
|
1586
1698
|
:type => Boolean,
|
1587
1699
|
:allowed_from_server => false,
|
1588
|
-
:description => 'Controls auto-instrumentation of the Thread class at start
|
1700
|
+
:description => 'Controls auto-instrumentation of the Thread class at start-up to automatically add tracing to all Threads created in the application.'
|
1589
1701
|
},
|
1590
1702
|
:'thread_ids_enabled' => {
|
1591
1703
|
:default => false,
|
@@ -1600,7 +1712,7 @@ module NewRelic
|
|
1600
1712
|
:type => String,
|
1601
1713
|
:dynamic_name => true,
|
1602
1714
|
:allowed_from_server => false,
|
1603
|
-
:description => 'Controls auto-instrumentation of the Tilt template rendering library at start
|
1715
|
+
:description => 'Controls auto-instrumentation of the Tilt template rendering library at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1604
1716
|
},
|
1605
1717
|
:'instrumentation.typhoeus' => {
|
1606
1718
|
:default => 'auto',
|
@@ -1609,7 +1721,7 @@ module NewRelic
|
|
1609
1721
|
:type => String,
|
1610
1722
|
:dynamic_name => true,
|
1611
1723
|
:allowed_from_server => false,
|
1612
|
-
:description => 'Controls auto-instrumentation of Typhoeus at start
|
1724
|
+
:description => 'Controls auto-instrumentation of Typhoeus at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
|
1613
1725
|
},
|
1614
1726
|
# Message tracer
|
1615
1727
|
:'message_tracer.segment_parameters.enabled' => {
|
@@ -1686,6 +1798,37 @@ module NewRelic
|
|
1686
1798
|
:transform => DefaultSource.method(:convert_to_regexp_list),
|
1687
1799
|
:description => 'Define transactions you want the agent to ignore, by specifying a list of patterns matching the URI you want to ignore. For more detail, see [the docs on ignoring specific transactions](/docs/agents/ruby-agent/api-guides/ignoring-specific-transactions/#config-ignoring).'
|
1688
1800
|
},
|
1801
|
+
# Sidekiq
|
1802
|
+
:'sidekiq.args.include' => {
|
1803
|
+
default: NewRelic::EMPTY_ARRAY,
|
1804
|
+
public: true,
|
1805
|
+
type: Array,
|
1806
|
+
dynamic_name: true,
|
1807
|
+
allowed_from_server: false,
|
1808
|
+
description: <<~SIDEKIQ_ARGS_INCLUDE.chomp.tr("\n", ' ')
|
1809
|
+
An array of strings that will collectively serve as an allowlist for filtering which Sidekiq
|
1810
|
+
job arguments get reported to New Relic. To capture any Sidekiq arguments,
|
1811
|
+
'job.sidekiq.args.*' must be added to the separate `:'attributes.include'` configuration option. Each
|
1812
|
+
string in this array will be turned into a regular expression via `Regexp.new` to permit advanced
|
1813
|
+
matching. For job argument hashes, if either a key or value matches the pair will be included. All
|
1814
|
+
matching job argument array elements and job argument scalars will be included.
|
1815
|
+
SIDEKIQ_ARGS_INCLUDE
|
1816
|
+
},
|
1817
|
+
:'sidekiq.args.exclude' => {
|
1818
|
+
default: NewRelic::EMPTY_ARRAY,
|
1819
|
+
public: true,
|
1820
|
+
type: Array,
|
1821
|
+
dynamic_name: true,
|
1822
|
+
allowed_from_server: false,
|
1823
|
+
description: <<~SIDEKIQ_ARGS_EXCLUDE.chomp.tr("\n", ' ')
|
1824
|
+
An array of strings that will collectively serve as a denylist for filtering which Sidekiq
|
1825
|
+
job arguments get reported to New Relic. To capture any Sidekiq arguments,
|
1826
|
+
'job.sidekiq.args.*' must be added to the separate `:'attributes.include'` configuration option. Each string
|
1827
|
+
in this array will be turned into a regular expression via `Regexp.new` to permit advanced matching.
|
1828
|
+
For job argument hashes, if either a key or value matches the pair will be excluded. All matching job
|
1829
|
+
argument array elements and job argument scalars will be excluded.
|
1830
|
+
SIDEKIQ_ARGS_EXCLUDE
|
1831
|
+
},
|
1689
1832
|
# Slow SQL
|
1690
1833
|
:'slow_sql.enabled' => {
|
1691
1834
|
:default => value_of(:'transaction_tracer.enabled'),
|
@@ -2211,7 +2354,7 @@ module NewRelic
|
|
2211
2354
|
:public => false,
|
2212
2355
|
:type => Boolean,
|
2213
2356
|
:allowed_from_server => false,
|
2214
|
-
:description => 'Used in tests for the agent to start
|
2357
|
+
:description => 'Used in tests for the agent to start-up, but not connect to the collector. Formerly used `developer_mode` in test config for this purpose.'
|
2215
2358
|
},
|
2216
2359
|
:'thread_profiler.max_profile_overhead' => {
|
2217
2360
|
:default => 0.05,
|
@@ -101,7 +101,7 @@ module NewRelic
|
|
101
101
|
end
|
102
102
|
else
|
103
103
|
::NewRelic::Agent.logger.info("#{environment_key} does not have a corresponding configuration setting (#{config_key} does not exist).")
|
104
|
-
::NewRelic::Agent.logger.info('Run `rake newrelic:config:docs` or visit https://newrelic.com/docs/ruby/ruby-agent-configuration to see a list of available configuration settings.')
|
104
|
+
::NewRelic::Agent.logger.info('Run `rake newrelic:config:docs` or visit https://docs.newrelic.com/docs/apm/agents/ruby-agent/configuration/ruby-agent-configuration to see a list of available configuration settings.')
|
105
105
|
self[config_key] = value
|
106
106
|
end
|
107
107
|
end
|
@@ -87,7 +87,7 @@ module NewRelic
|
|
87
87
|
# header-friendly string returned from
|
88
88
|
# {DistributedTracePayload#http_safe}
|
89
89
|
#
|
90
|
-
# @param
|
90
|
+
# @param transport_type [String] May be one of: +HTTP+, +HTTPS+, +Kafka+, +JMS+,
|
91
91
|
# +IronMQ+, +AMQP+, +Queue+, +Other+. Values are
|
92
92
|
# case sensitive. All other values result in +Unknown+
|
93
93
|
#
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# This file is distributed under New Relic's license terms.
|
2
|
+
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
3
|
+
# frozen_string_literal: true
|
4
|
+
|
5
|
+
require_relative 'abstract'
|
6
|
+
require 'resolv'
|
7
|
+
|
8
|
+
module NewRelic
|
9
|
+
module Agent
|
10
|
+
module HTTPClients
|
11
|
+
class AsyncHTTPResponse < AbstractResponse
|
12
|
+
def get_status_code
|
13
|
+
get_status_code_using(:status)
|
14
|
+
end
|
15
|
+
|
16
|
+
def [](key)
|
17
|
+
to_hash[key.downcase]&.first
|
18
|
+
end
|
19
|
+
|
20
|
+
def to_hash
|
21
|
+
@wrapped_response.headers.to_h
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
class AsyncHTTPRequest < AbstractRequest
|
26
|
+
def initialize(connection, method, url, headers)
|
27
|
+
@connection = connection
|
28
|
+
@method = method
|
29
|
+
@url = ::NewRelic::Agent::HTTPClients::URIUtil.parse_and_normalize_url(url)
|
30
|
+
@headers = headers
|
31
|
+
end
|
32
|
+
|
33
|
+
ASYNC_HTTP = 'Async::HTTP'
|
34
|
+
LHOST = 'host'
|
35
|
+
UHOST = 'Host'
|
36
|
+
COLON = ':'
|
37
|
+
|
38
|
+
def type
|
39
|
+
ASYNC_HTTP
|
40
|
+
end
|
41
|
+
|
42
|
+
def host_from_header
|
43
|
+
if hostname = (self[LHOST] || self[UHOST])
|
44
|
+
hostname.split(COLON).first
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def host
|
49
|
+
host_from_header || uri.host.to_s
|
50
|
+
end
|
51
|
+
|
52
|
+
def [](key)
|
53
|
+
return headers[key] unless headers.is_a?(Array)
|
54
|
+
|
55
|
+
headers.each do |header|
|
56
|
+
return header[1] if header[0].casecmp?(key)
|
57
|
+
end
|
58
|
+
nil
|
59
|
+
end
|
60
|
+
|
61
|
+
def []=(key, value)
|
62
|
+
if headers.is_a?(Array)
|
63
|
+
headers << [key, value]
|
64
|
+
else
|
65
|
+
headers[key] = value
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def uri
|
70
|
+
@url
|
71
|
+
end
|
72
|
+
|
73
|
+
def headers
|
74
|
+
@headers
|
75
|
+
end
|
76
|
+
|
77
|
+
def method
|
78
|
+
@method
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|