newrelic_rpm 9.0.0 → 9.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +6 -16
- data/.rubocop_todo.yml +4 -43
- data/.simplecov +1 -1
- data/CHANGELOG.md +60 -2
- data/Gemfile +1 -1
- data/Guardfile +7 -7
- data/README.md +1 -2
- data/Rakefile +8 -8
- data/Thorfile +1 -1
- data/bin/nrdebug +20 -20
- data/init.rb +1 -1
- data/lib/new_relic/agent/agent.rb +3 -16
- data/lib/new_relic/agent/agent_helpers/connect.rb +4 -9
- data/lib/new_relic/agent/agent_helpers/harvest.rb +4 -4
- data/lib/new_relic/agent/agent_helpers/shutdown.rb +5 -5
- data/lib/new_relic/agent/agent_helpers/special_startup.rb +2 -2
- data/lib/new_relic/agent/agent_helpers/start_worker_thread.rb +47 -39
- data/lib/new_relic/agent/agent_helpers/startup.rb +13 -13
- data/lib/new_relic/agent/agent_helpers/transmit.rb +6 -6
- data/lib/new_relic/agent/agent_logger.rb +9 -9
- data/lib/new_relic/agent/attribute_filter.rb +2 -2
- data/lib/new_relic/agent/attribute_processing.rb +2 -2
- data/lib/new_relic/agent/audit_logger.rb +5 -5
- data/lib/new_relic/agent/autostart.rb +1 -1
- data/lib/new_relic/agent/commands/agent_command.rb +2 -2
- data/lib/new_relic/agent/commands/agent_command_router.rb +5 -4
- data/lib/new_relic/agent/commands/thread_profiler_session.rb +5 -5
- data/lib/new_relic/agent/configuration/default_source.rb +57 -56
- data/lib/new_relic/agent/configuration/environment_source.rb +2 -2
- data/lib/new_relic/agent/configuration/high_security_source.rb +3 -3
- data/lib/new_relic/agent/configuration/manager.rb +2 -2
- data/lib/new_relic/agent/configuration/security_policy_source.rb +10 -10
- data/lib/new_relic/agent/configuration/server_source.rb +24 -24
- data/lib/new_relic/agent/configuration/yaml_source.rb +4 -4
- data/lib/new_relic/agent/connect/request_builder.rb +1 -1
- data/lib/new_relic/agent/connect/response_handler.rb +1 -1
- data/lib/new_relic/agent/custom_event_aggregator.rb +4 -4
- data/lib/new_relic/agent/database/explain_plan_helpers.rb +1 -1
- data/lib/new_relic/agent/database/obfuscation_helpers.rb +2 -2
- data/lib/new_relic/agent/database/obfuscator.rb +2 -2
- data/lib/new_relic/agent/database.rb +4 -4
- data/lib/new_relic/agent/datastores/metric_helper.rb +5 -5
- data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +11 -11
- data/lib/new_relic/agent/datastores/redis.rb +6 -6
- data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +7 -8
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +10 -10
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_metrics.rb +7 -7
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +1 -1
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb +6 -6
- data/lib/new_relic/agent/distributed_tracing/trace_context.rb +7 -7
- data/lib/new_relic/agent/distributed_tracing/trace_context_payload.rb +4 -4
- data/lib/new_relic/agent/distributed_tracing.rb +5 -5
- data/lib/new_relic/agent/error_collector.rb +35 -7
- data/lib/new_relic/agent/error_filter.rb +2 -2
- data/lib/new_relic/agent/error_trace_aggregator.rb +5 -4
- data/lib/new_relic/agent/event_loop.rb +3 -3
- data/lib/new_relic/agent/external.rb +1 -1
- data/lib/new_relic/agent/harvester.rb +1 -3
- data/lib/new_relic/agent/heap.rb +2 -1
- data/lib/new_relic/agent/hostname.rb +1 -1
- data/lib/new_relic/agent/http_clients/abstract.rb +9 -21
- data/lib/new_relic/agent/http_clients/curb_wrappers.rb +7 -3
- data/lib/new_relic/agent/http_clients/excon_wrappers.rb +7 -5
- data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +4 -0
- data/lib/new_relic/agent/http_clients/httpclient_wrappers.rb +6 -2
- data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +5 -1
- data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +8 -5
- data/lib/new_relic/agent/http_clients/uri_util.rb +2 -2
- data/lib/new_relic/agent/instrumentation/action_controller_other_subscriber.rb +5 -2
- data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +3 -2
- data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +3 -3
- data/lib/new_relic/agent/instrumentation/active_job.rb +1 -1
- data/lib/new_relic/agent/instrumentation/active_record.rb +3 -2
- data/lib/new_relic/agent/instrumentation/active_record_helper.rb +38 -35
- data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +3 -3
- data/lib/new_relic/agent/instrumentation/active_record_prepend.rb +2 -2
- data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +3 -2
- data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +3 -3
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +5 -3
- data/lib/new_relic/agent/instrumentation/curb/chain.rb +1 -1
- data/lib/new_relic/agent/instrumentation/curb/instrumentation.rb +5 -5
- data/lib/new_relic/agent/instrumentation/curb.rb +1 -1
- data/lib/new_relic/agent/instrumentation/custom_events_subscriber.rb +2 -1
- data/lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb +1 -1
- data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +2 -1
- data/lib/new_relic/agent/instrumentation/elasticsearch/chain.rb +1 -1
- data/lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb +3 -3
- data/lib/new_relic/agent/instrumentation/elasticsearch.rb +1 -1
- data/lib/new_relic/agent/instrumentation/excon/middleware.rb +2 -1
- data/lib/new_relic/agent/instrumentation/excon.rb +3 -3
- data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +4 -4
- data/lib/new_relic/agent/instrumentation/grape.rb +3 -3
- data/lib/new_relic/agent/instrumentation/grpc/client/instrumentation.rb +2 -1
- data/lib/new_relic/agent/instrumentation/grpc/server/instrumentation.rb +3 -3
- data/lib/new_relic/agent/instrumentation/httprb.rb +1 -1
- data/lib/new_relic/agent/instrumentation/ignore_actions.rb +1 -1
- data/lib/new_relic/agent/instrumentation/logger.rb +1 -1
- data/lib/new_relic/agent/instrumentation/memcache/instrumentation.rb +2 -2
- data/lib/new_relic/agent/instrumentation/memcache.rb +6 -6
- data/lib/new_relic/agent/instrumentation/middleware_proxy.rb +3 -3
- data/lib/new_relic/agent/instrumentation/middleware_tracing.rb +1 -1
- data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +5 -5
- data/lib/new_relic/agent/instrumentation/net_http.rb +1 -1
- data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +1 -1
- data/lib/new_relic/agent/instrumentation/padrino/instrumentation.rb +3 -3
- data/lib/new_relic/agent/instrumentation/passenger_instrumentation.rb +2 -2
- data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +1 -1
- data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +3 -2
- data/lib/new_relic/agent/instrumentation/rails_middleware.rb +1 -1
- data/lib/new_relic/agent/instrumentation/rake/instrumentation.rb +7 -7
- data/lib/new_relic/agent/instrumentation/rake.rb +2 -2
- data/lib/new_relic/agent/instrumentation/redis/constants.rb +1 -1
- data/lib/new_relic/agent/instrumentation/redis/instrumentation.rb +2 -1
- data/lib/new_relic/agent/instrumentation/resque/helper.rb +1 -1
- data/lib/new_relic/agent/instrumentation/sequel.rb +4 -4
- data/lib/new_relic/agent/instrumentation/sequel_helper.rb +10 -10
- data/lib/new_relic/agent/instrumentation/sidekiq/extensions/delayed_class.rb +1 -1
- data/lib/new_relic/agent/instrumentation/sidekiq/server.rb +1 -1
- data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +1 -1
- data/lib/new_relic/agent/instrumentation/sinatra/instrumentation.rb +6 -5
- data/lib/new_relic/agent/instrumentation/sinatra/transaction_namer.rb +1 -1
- data/lib/new_relic/agent/instrumentation/tilt/instrumentation.rb +2 -1
- data/lib/new_relic/agent/instrumentation/typhoeus/instrumentation.rb +5 -5
- data/lib/new_relic/agent/javascript_instrumentor.rb +29 -24
- data/lib/new_relic/agent/linking_metadata.rb +2 -2
- data/lib/new_relic/agent/log_event_aggregator.rb +15 -15
- data/lib/new_relic/agent/logging.rb +73 -33
- data/lib/new_relic/agent/messaging.rb +7 -5
- data/lib/new_relic/agent/method_tracer.rb +6 -6
- data/lib/new_relic/agent/method_tracer_helpers.rb +1 -1
- data/lib/new_relic/agent/monitors/cross_app_monitor.rb +4 -4
- data/lib/new_relic/agent/monitors/distributed_tracing_monitor.rb +1 -1
- data/lib/new_relic/agent/new_relic_service/encoders.rb +1 -1
- data/lib/new_relic/agent/new_relic_service/json_marshaller.rb +2 -2
- data/lib/new_relic/agent/new_relic_service.rb +14 -14
- data/lib/new_relic/agent/obfuscator.rb +1 -1
- data/lib/new_relic/agent/parameter_filtering.rb +6 -6
- data/lib/new_relic/agent/pipe_channel_manager.rb +7 -6
- data/lib/new_relic/agent/pipe_service.rb +5 -3
- data/lib/new_relic/agent/priority_sampled_buffer.rb +1 -1
- data/lib/new_relic/agent/sampler.rb +1 -1
- data/lib/new_relic/agent/sampler_collection.rb +1 -1
- data/lib/new_relic/agent/samplers/cpu_sampler.rb +5 -5
- data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +9 -9
- data/lib/new_relic/agent/samplers/memory_sampler.rb +9 -9
- data/lib/new_relic/agent/samplers/object_sampler.rb +1 -1
- data/lib/new_relic/agent/span_event_aggregator.rb +4 -4
- data/lib/new_relic/agent/span_event_primitive.rb +2 -2
- data/lib/new_relic/agent/sql_sampler.rb +2 -2
- data/lib/new_relic/agent/stats.rb +1 -1
- data/lib/new_relic/agent/synthetics_event_aggregator.rb +1 -1
- data/lib/new_relic/agent/system_info.rb +10 -10
- data/lib/new_relic/agent/threading/agent_thread.rb +1 -1
- data/lib/new_relic/agent/threading/backtrace_node.rb +3 -3
- data/lib/new_relic/agent/threading/backtrace_service.rb +3 -7
- data/lib/new_relic/agent/threading/thread_profile.rb +5 -5
- data/lib/new_relic/agent/timestamp_sampled_buffer.rb +1 -1
- data/lib/new_relic/agent/tracer.rb +8 -7
- data/lib/new_relic/agent/transaction/abstract_segment.rb +7 -7
- data/lib/new_relic/agent/transaction/datastore_segment.rb +1 -1
- data/lib/new_relic/agent/transaction/distributed_tracer.rb +7 -6
- data/lib/new_relic/agent/transaction/distributed_tracing.rb +6 -6
- data/lib/new_relic/agent/transaction/external_request_segment.rb +11 -11
- data/lib/new_relic/agent/transaction/message_broker_segment.rb +1 -1
- data/lib/new_relic/agent/transaction/request_attributes.rb +2 -2
- data/lib/new_relic/agent/transaction/segment.rb +1 -1
- data/lib/new_relic/agent/transaction/synthetics_sample_buffer.rb +1 -1
- data/lib/new_relic/agent/transaction/trace.rb +1 -1
- data/lib/new_relic/agent/transaction/trace_context.rb +4 -4
- data/lib/new_relic/agent/transaction/trace_node.rb +8 -7
- data/lib/new_relic/agent/transaction/tracing.rb +2 -2
- data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +1 -1
- data/lib/new_relic/agent/transaction.rb +39 -36
- data/lib/new_relic/agent/transaction_error_primitive.rb +5 -5
- data/lib/new_relic/agent/transaction_event_aggregator.rb +4 -4
- data/lib/new_relic/agent/transaction_event_primitive.rb +3 -3
- data/lib/new_relic/agent/transaction_sampler.rb +3 -3
- data/lib/new_relic/agent/transaction_time_aggregator.rb +7 -3
- data/lib/new_relic/agent/utilization/aws.rb +1 -1
- data/lib/new_relic/agent/utilization/azure.rb +3 -3
- data/lib/new_relic/agent/utilization/gcp.rb +3 -3
- data/lib/new_relic/agent/utilization/pcf.rb +1 -1
- data/lib/new_relic/agent/utilization/vendor.rb +1 -1
- data/lib/new_relic/agent/vm/monotonic_gc_profiler.rb +1 -1
- data/lib/new_relic/agent/vm/mri_vm.rb +9 -8
- data/lib/new_relic/agent/worker_loop.rb +1 -1
- data/lib/new_relic/agent.rb +78 -16
- data/lib/new_relic/cli/command.rb +3 -3
- data/lib/new_relic/cli/commands/deployments.rb +26 -25
- data/lib/new_relic/cli/commands/install.rb +14 -14
- data/lib/new_relic/collection_helper.rb +2 -2
- data/lib/new_relic/constants.rb +7 -8
- data/lib/new_relic/control/class_methods.rb +3 -3
- data/lib/new_relic/control/frameworks/rails.rb +30 -18
- data/lib/new_relic/control/instance_methods.rb +5 -5
- data/lib/new_relic/control/instrumentation.rb +1 -1
- data/lib/new_relic/control/private_instance_methods.rb +1 -1
- data/lib/new_relic/dependency_detection.rb +4 -17
- data/lib/new_relic/environment_report.rb +4 -4
- data/lib/new_relic/helper.rb +2 -1
- data/lib/new_relic/language_support.rb +1 -1
- data/lib/new_relic/latest_changes.rb +5 -5
- data/lib/new_relic/noticed_error.rb +20 -18
- data/lib/new_relic/rack/browser_monitoring.rb +20 -16
- data/lib/new_relic/recipes/capistrano3.rb +1 -1
- data/lib/new_relic/recipes/capistrano_legacy.rb +6 -6
- data/lib/new_relic/recipes/helpers/send_deployment.rb +5 -5
- data/lib/new_relic/supportability_helper.rb +2 -0
- data/lib/new_relic/version.rb +1 -1
- data/lib/newrelic_rpm.rb +3 -3
- data/lib/sequel/extensions/new_relic_instrumentation.rb +3 -3
- data/lib/sequel/plugins/new_relic_instrumentation.rb +1 -1
- data/lib/tasks/config.rake +12 -12
- data/lib/tasks/coverage_report.rake +3 -3
- data/lib/tasks/helpers/format.rb +9 -9
- data/lib/tasks/helpers/removers.rb +5 -5
- data/lib/tasks/install.rake +4 -4
- data/lib/tasks/multiverse.rb +12 -6
- data/lib/tasks/tests.rake +6 -6
- data/newrelic_rpm.gemspec +13 -13
- data/test/agent_helper.rb +25 -24
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86b089be72e8fdf6af07082365c42ecfcbc6cc0c88df45cbac8238dca375af9c
|
4
|
+
data.tar.gz: e41f270e6d423755657678a0211cab7cb2a294d7f514d486b447b4c09c650fd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f58684a973dd62ac5fb9b50309fd9ffc71ad2d14d2120902c8de8a3c1647abc99c376caeec6955708c5bbbc6989c687b753684523e02a0624dccc0a894285380
|
7
|
+
data.tar.gz: 4e6e538da76646d35f55af94bc037603cf3bb643396a21304ddc887d56d02802cd36a50aaaeafad03ea4c1f579248710919eff2e458b78d610c5820e219d8f34
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -66,7 +66,7 @@ Style/RedundantEach: # new in 1.38
|
|
66
66
|
Enabled: true
|
67
67
|
Style/RedundantInitialize: # new in 1.27
|
68
68
|
Enabled: true
|
69
|
-
Style/RedundantStringEscape: # new in 1.37
|
69
|
+
Style/RedundantStringEscape: # new in 1.37, 'pending' by default so enabled to make sure it's applied
|
70
70
|
Enabled: true
|
71
71
|
Style/YodaExpression: # new in 1.42
|
72
72
|
Enabled: true
|
@@ -140,7 +140,8 @@ Performance/StringIdentifierArgument: # new in 1.13
|
|
140
140
|
Enabled: true
|
141
141
|
Performance/StringInclude: # new in 1.7
|
142
142
|
Enabled: true
|
143
|
-
|
143
|
+
Performance/Sum: # new in 1.8, pending so left enabled explicitly until 2.0
|
144
|
+
Enabled: true
|
144
145
|
|
145
146
|
# Old cops
|
146
147
|
|
@@ -1255,9 +1256,6 @@ Style/DocumentationMethod:
|
|
1255
1256
|
Style/DoubleCopDisableDirective:
|
1256
1257
|
Enabled: false
|
1257
1258
|
|
1258
|
-
Style/DoubleNegation:
|
1259
|
-
Enabled: false
|
1260
|
-
|
1261
1259
|
Style/EachForSimpleLoop:
|
1262
1260
|
Enabled: true
|
1263
1261
|
|
@@ -1318,6 +1316,9 @@ Style/ExplicitBlockArgument:
|
|
1318
1316
|
Style/ExponentialNotation:
|
1319
1317
|
Enabled: false
|
1320
1318
|
|
1319
|
+
Style/FetchEnvVar:
|
1320
|
+
Enabled: false
|
1321
|
+
|
1321
1322
|
Style/FloatDivision:
|
1322
1323
|
Enabled: false
|
1323
1324
|
|
@@ -1781,17 +1782,6 @@ Style/StringConcatenation:
|
|
1781
1782
|
Style/StringHashKeys:
|
1782
1783
|
Enabled: false
|
1783
1784
|
|
1784
|
-
# Disabling for now
|
1785
|
-
Style/StringLiterals:
|
1786
|
-
Enabled: false
|
1787
|
-
# EnforcedStyle: double_quotes
|
1788
|
-
# ConsistentQuotesInMultiline: false
|
1789
|
-
|
1790
|
-
# Disabling for now
|
1791
|
-
Style/StringLiteralsInInterpolation:
|
1792
|
-
Enabled: false
|
1793
|
-
# EnforcedStyle: double_quotes
|
1794
|
-
|
1795
1785
|
Style/StringMethods:
|
1796
1786
|
Enabled: false
|
1797
1787
|
|
data/.rubocop_todo.yml
CHANGED
@@ -9,10 +9,11 @@
|
|
9
9
|
# Offense count: 422
|
10
10
|
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes.
|
11
11
|
Metrics/AbcSize:
|
12
|
-
Max:
|
12
|
+
Max: 40
|
13
13
|
Exclude:
|
14
|
-
- test/**/*
|
15
14
|
- infinite_tracing/test/**/*
|
15
|
+
- lib/new_relic/cli/commands/deployments.rb
|
16
|
+
- test/**/*
|
16
17
|
|
17
18
|
# This cop supports safe autocorrection (--autocorrect).
|
18
19
|
Minitest/AssertInDelta:
|
@@ -36,6 +37,7 @@ Minitest/DuplicateTestRun:
|
|
36
37
|
Minitest/EmptyLineBeforeAssertionMethods:
|
37
38
|
Exclude:
|
38
39
|
- 'test/new_relic/agent_test.rb'
|
40
|
+
- 'test/new_relic/cli/commands/deployments_test.rb'
|
39
41
|
|
40
42
|
# Offense count: 269
|
41
43
|
Minitest/MultipleAssertions:
|
@@ -57,44 +59,3 @@ Style/ConcatArrayLiterals:
|
|
57
59
|
Minitest/RefuteRespondTo:
|
58
60
|
Exclude:
|
59
61
|
- 'test/new_relic/cli/commands/deployments_test.rb'
|
60
|
-
|
61
|
-
Minitest/EmptyLineBeforeAssertionMethods:
|
62
|
-
Exclude:
|
63
|
-
- 'test/new_relic/agent_test.rb'
|
64
|
-
- 'test/new_relic/cli/commands/deployments_test.rb'
|
65
|
-
|
66
|
-
# Offense count: 23
|
67
|
-
# This cop supports safe autocorrection (--autocorrect).
|
68
|
-
Performance/RegexpMatch:
|
69
|
-
Enabled: false
|
70
|
-
|
71
|
-
# Offense count: 1
|
72
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
73
|
-
# Configuration parameters: OnlySumOrWithInitialValue.
|
74
|
-
Performance/Sum:
|
75
|
-
Exclude:
|
76
|
-
- 'lib/new_relic/agent/system_info.rb'
|
77
|
-
|
78
|
-
# Offense count: 72
|
79
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
80
|
-
Performance/UnfreezeString:
|
81
|
-
Enabled: false
|
82
|
-
|
83
|
-
# Offense count: 21
|
84
|
-
# This cop supports safe autocorrection (--autocorrect).
|
85
|
-
# Configuration parameters: AllowedVars.
|
86
|
-
Style/FetchEnvVar:
|
87
|
-
Enabled: false
|
88
|
-
|
89
|
-
# Offense count: 1
|
90
|
-
# This cop supports safe autocorrection (--autocorrect).
|
91
|
-
Style/RedundantStringEscape:
|
92
|
-
Exclude:
|
93
|
-
- 'test/new_relic/agent/logging_test.rb'
|
94
|
-
|
95
|
-
# Offense count: 115
|
96
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
97
|
-
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
|
98
|
-
# AllowedMethods: present?, blank?, presence, try, try!
|
99
|
-
Style/SafeNavigation:
|
100
|
-
Enabled: false
|
data/.simplecov
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,63 @@
|
|
1
1
|
# New Relic Ruby Agent Release Notes
|
2
2
|
|
3
|
+
## v9.1.0
|
4
|
+
|
5
|
+
Version 9.1.0 of the agent delivers support for two new [errors inbox](https://docs.newrelic.com/docs/errors-inbox/errors-inbox/) features: error fingerprinting and user tracking, identifies the Amazon Timestream data store, removes Distributed Tracing warnings from agent logs when using Sidekiq, fixes bugs, and is tested against the recently released JRuby 9.4.2.0.
|
6
|
+
|
7
|
+
- **Feature: Error fingerprinting - supply your own errors inbox group names**
|
8
|
+
|
9
|
+
Are your error occurrences grouped poorly? Set your own error fingerprint via a callback function. A new `set_error_group_callback` public API method has been added that will accept a user defined proc. The proc will be invoked for each noticed error and whenever it returns a string, that string will be used as the error group name for the error and will take precedence over any server-side grouping that takes place with the New Relic errors inbox. This gives users much greater control over the grouping of their errors.
|
10
|
+
|
11
|
+
The customer defined proc will be expected to receive exactly one input argument, a hash. The hash contains the following:
|
12
|
+
|
13
|
+
| Key | Value |
|
14
|
+
| ---------------------| ---------------------------------------------------------------------------- |
|
15
|
+
| `:error` | The Ruby error class instance. Offers `#class`, `#message`, and `#backtrace` |
|
16
|
+
| `:customAttributes` | Any customer defined custom attributes for the current transaction |
|
17
|
+
| `:'request.uri'` | The current request URI if available |
|
18
|
+
| `:'http.statusCode'` | The HTTP status code (200, 404, etc.) if available |
|
19
|
+
| `:'http.method'` | The HTTP method (GET, PUT, etc.) if available |
|
20
|
+
| `:'error.expected'` | Whether (true) or not (false) the error was expected |
|
21
|
+
| `:'options'` | The options hash passed to `NewRelic::Agent.notice_error` |
|
22
|
+
|
23
|
+
The callback only needs to be set once per initialization of the New Relic agent.
|
24
|
+
|
25
|
+
Example usage:
|
26
|
+
|
27
|
+
```
|
28
|
+
proc = proc { |hash| "Access" if hash[:'http.statusCode'] == 401 }
|
29
|
+
NewRelic::Agent.set_error_group_callback(proc)
|
30
|
+
```
|
31
|
+
|
32
|
+
- **Feature: User tracking - associate errors with a user id**
|
33
|
+
|
34
|
+
You can now see the number of users impacted by an error group. Identify the end user with a new `set_user_id` public API method that will accept a string representation of a user id and associate that user id with the current transaction. Transactions and errors will then have a new `enduser.id` agent attribute associated with them. This will allow agent users to tag transactions and errors as belonging to given user ids in support of greater filtering and alerting capabilities.
|
35
|
+
|
36
|
+
- **Identify Amazon Timestream when the amazon_timestream AR adapter is used**
|
37
|
+
|
38
|
+
When the agent sees the [activerecord-amazon-timestream-adapter](https://rubygems.org/gems/activerecord-amazon-timestream-adapter) gem being used, it will now identify the data store as "Timestream". Thanks very much to [@wagner](https://github.com/wagner) for contributing this enhancement! [PR#1872](https://github.com/newrelic/newrelic-ruby-agent/pull/1872)
|
39
|
+
|
40
|
+
- **Bugfix: Remove Distributed Tracing related warnings from agent logs when headers are not present in Sidekiq**
|
41
|
+
|
42
|
+
Previously, the agent would log a warning to `newrelic_agent.log` every time it attempted to accept empty Distributed Tracing headers from Sidekiq jobs which could result in an excessive number of warnings. Now the agent will no longer create these warnings when using Sidekiq. [PR#1834](https://github.com/newrelic/newrelic-ruby-agent/pull/1834)
|
43
|
+
|
44
|
+
- **Bugfix: Log request headers in debug-level logs instead of human-readable Objects**
|
45
|
+
|
46
|
+
Previously, the agent sometimes received children of the `NewRelic::Agent::HTTPClients::AbstractRequest` class as an argument when `NewRelic::Agent::Transaction::DistributedTracers#log_request_headers` was called. This caused debug-level log messages that print the request headers to show human-readable Objects (ex. `#<NewRelic::Agent::HTTPClients::HTTPClientRequest:0x00007fd0dda983e0>`) instead of the request headers. Now, the hash of the request headers should always be logged. [PR#1839](https://github.com/newrelic/newrelic-ruby-agent/pull/1839)
|
47
|
+
|
48
|
+
- **Bugfix: Fix undefined method `controller_path` logged in Action Controller Instrumentation**
|
49
|
+
|
50
|
+
Previously, the agent could log an error when trying to determine the metric name in the Action Controller instrumentation if the controller class did not respond to `controller_path`. This has been resolved and the agent will no longer call this method unless the class responds to it. Thank you to [@gsar](https://github.com/gsar) for letting us know about this issue. [PR#1844](https://github.com/newrelic/newrelic-ruby-agent/pull/1844)
|
51
|
+
|
52
|
+
- **Bugfix: Fix Transaction#finish exception and decrease log level for related warning during async transactions**
|
53
|
+
|
54
|
+
Previously, the agent would raise a non-fatal error when a segment without a parent was unfinished when the transaction completed. This error was raised while constructing a `warn`-level log message. Now that Thread instrumentation is on by default, this log message emits more frequently and is less concerning. In cases where we see a Thread, Fiber, or concurrent-ruby segment in a transaction, the message will be degraded to a `debug`-level. Thanks to [@NielsKSchjoedt](https://github.com/NielsKSchjoedt) for creating the issue and [@boomer196](https://github.com/boomer196) for testing solutions. [PR#1876](https://github.com/newrelic/newrelic-ruby-agent/pull/1876)
|
55
|
+
|
56
|
+
- **CI: Target JRuby 9.4.2.0**
|
57
|
+
|
58
|
+
The agent is now actively being tested against JRuby 9.4.2.0. NOTE that this release does not contain any non-CI related changes for JRuby. Old agent versions are still expected to work with newer JRubies and the newest agent version is still expected to work with older JRubies.
|
59
|
+
|
60
|
+
|
3
61
|
## v9.0.0
|
4
62
|
|
5
63
|
Version 9.0.0 of the agent removes several deprecated configuration options and API methods, enables Thread tracing by default, adds Fiber instrumentation, removes support for Ruby versions 2.2 and 2.3, removes instrumentation for several deprecated gems, changes how the API method `set_transaction_name` works, and updates `rails_defer_initialization` to be an environment variable only configuration option.
|
@@ -92,8 +150,8 @@
|
|
92
150
|
- HttpClient: 2.2.0 - 2.8.0
|
93
151
|
- HttpRb: 0.9.9 - 2.2.1
|
94
152
|
- Typhoeus: 0.5.3 - 1.2.x
|
95
|
-
- Bunny: 2.0.x - 2.6.x
|
96
|
-
- ActiveMerchant: 1.25.0 - 1.64.x
|
153
|
+
- Bunny: 2.0.x - 2.6.x
|
154
|
+
- ActiveMerchant: 1.25.0 - 1.64.x
|
97
155
|
|
98
156
|
|
99
157
|
- **Updated API method `set_transaction_name`**
|
data/Gemfile
CHANGED
data/Guardfile
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require './test/multiverse/lib/multiverse/bundler_patch'
|
3
3
|
|
4
|
-
test_folders = Dir.glob(
|
5
|
-
test_folders += Dir.glob(
|
4
|
+
test_folders = Dir.glob('test/new_relic/*').select { |f| File.directory?(f) }
|
5
|
+
test_folders += Dir.glob('test/new_relic/**/*').select { |f| File.directory?(f) }
|
6
6
|
|
7
|
-
rake_lib_path = Bundler.with_unbundled_env { `bundle exec gem which rake`.chomp.gsub(
|
7
|
+
rake_lib_path = Bundler.with_unbundled_env { `bundle exec gem which rake`.chomp.gsub('lib/rake.rb', 'lib') }
|
8
8
|
ruby_options = %(-w -I"#{rake_lib_path}" "#{rake_lib_path}/rake/rake_test_loader.rb")
|
9
9
|
|
10
10
|
guard_options = {
|
@@ -17,10 +17,10 @@ guard_options = {
|
|
17
17
|
guard :minitest, guard_options do
|
18
18
|
watch(%r{^lib/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
|
19
19
|
watch(%r{^test/.+_test\.rb$})
|
20
|
-
watch(%r{^test/rum/.*}) {
|
20
|
+
watch(%r{^test/rum/.*}) { 'test/new_relic/rack/browser_monitoring_test.rb' }
|
21
21
|
watch(%r{^test/fixtures/cross_agent_tests/distributed_tracing/(.+).json}) { |m| "test/new_relic/agent/distributed_tracing/#{m[1]}_cross_agent_test.rb" }
|
22
|
-
watch('test/test_helper.rb') {
|
23
|
-
watch('test/agent_helper.rb') {
|
24
|
-
watch('lib/new_relic/agent/configuration/default_source.rb') {
|
22
|
+
watch('test/test_helper.rb') { 'test/new_relic' }
|
23
|
+
watch('test/agent_helper.rb') { 'test/new_relic' }
|
24
|
+
watch('lib/new_relic/agent/configuration/default_source.rb') { 'test/new_relic/agent/configuration/orphan_configuration_test.rb' }
|
25
25
|
watch(%r{^lib/new_relic/agent/transaction/(.+).rb}) { |m| "test/new_relic/agent/distributed_tracing/#{m[1]}_cross_agent_test.rb" }
|
26
26
|
end
|
data/README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
<a href="https://opensource.newrelic.com/oss-category/#community-plus"><picture><source media="(prefers-color-scheme: dark)" srcset="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/dark/Community_Plus.png"><source media="(prefers-color-scheme: light)" srcset="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/Community_Plus.png"><img alt="New Relic Open Source community plus project banner." src="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/Community_Plus.png"></picture></a>
|
3
2
|
|
4
3
|
# New Relic Ruby Agent
|
5
4
|
|
data/Rakefile
CHANGED
@@ -15,11 +15,11 @@ task :default => :test
|
|
15
15
|
task :test => ['test:newrelic']
|
16
16
|
|
17
17
|
namespace :test do
|
18
|
-
desc
|
18
|
+
desc 'Run all tests'
|
19
19
|
task :all => %w[newrelic multiverse all_compatible_envs]
|
20
20
|
agent_home = File.expand_path(File.dirname(__FILE__))
|
21
21
|
|
22
|
-
desc
|
22
|
+
desc 'Run agent performance tests'
|
23
23
|
task :performance, [:suite, :name] => [] do |t, args|
|
24
24
|
require File.expand_path(File.join(File.dirname(__FILE__), 'test', 'performance', 'lib', 'performance'))
|
25
25
|
options = {}
|
@@ -28,13 +28,13 @@ namespace :test do
|
|
28
28
|
Performance::Runner.new(options).run_and_report
|
29
29
|
end
|
30
30
|
|
31
|
-
desc
|
31
|
+
desc 'Run agent within existing mini environment(s): env[name1,name2,name3,etc.]'
|
32
32
|
task :env do |t, args|
|
33
33
|
require File.expand_path(File.join(File.dirname(__FILE__), 'test', 'environments', 'lib', 'environments', 'runner'))
|
34
34
|
Environments::Runner.new(args.to_a).run_and_report
|
35
35
|
end
|
36
36
|
|
37
|
-
desc
|
37
|
+
desc 'Run all mini environment tests known to work with the current Ruby version'
|
38
38
|
task :all_compatible_envs do |t, args|
|
39
39
|
require File.expand_path(File.join(File.dirname(__FILE__), 'test', 'helpers', 'ruby_rails_mappings'))
|
40
40
|
rails_versions = rails_versions_for_ruby_version(RUBY_VERSION)
|
@@ -62,10 +62,10 @@ task :record_build, [:build_number, :stage] do |t, args|
|
|
62
62
|
build_string = args.build_number
|
63
63
|
build_string << ".#{args.stage}" unless args.stage.nil? || args.stage.empty?
|
64
64
|
|
65
|
-
gitsha = File.exist?(
|
65
|
+
gitsha = File.exist?('.git') ? `git rev-parse HEAD` : 'Unknown'
|
66
66
|
gitsha.chomp!
|
67
67
|
|
68
|
-
File.open(
|
68
|
+
File.open('lib/new_relic/build.rb', 'w') do |f|
|
69
69
|
f.write("# GITSHA: #{gitsha}\n")
|
70
70
|
f.write("module NewRelic; module VERSION; BUILD='#{build_string}'; end; end\n")
|
71
71
|
end
|
@@ -93,14 +93,14 @@ task :update_ca_bundle do |t|
|
|
93
93
|
bundle_last_update = `cd #{ca_bundle_path} && git show -s --format=%ci HEAD`
|
94
94
|
puts "Source CA bundle last updated #{bundle_last_update}"
|
95
95
|
|
96
|
-
bundle_path =
|
96
|
+
bundle_path = 'cert/cacert.pem'
|
97
97
|
cert_paths = []
|
98
98
|
Dir.glob("#{ca_bundle_path}/*.pem").each { |p| cert_paths << p }
|
99
99
|
cert_paths.sort!
|
100
100
|
|
101
101
|
puts "Writing #{cert_paths.size} certs to bundle at #{bundle_path}..."
|
102
102
|
|
103
|
-
File.open(bundle_path,
|
103
|
+
File.open(bundle_path, 'w') do |f|
|
104
104
|
cert_paths.each do |cert_path|
|
105
105
|
cert_name = File.basename(cert_path, '.pem')
|
106
106
|
puts "Adding #{cert_name}"
|
data/Thorfile
CHANGED
data/bin/nrdebug
CHANGED
@@ -96,7 +96,7 @@ class LinuxProcessDataProvider < ProcessDataProvider
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def procline
|
99
|
-
File.read(proc_path('cmdline')).tr("\000",
|
99
|
+
File.read(proc_path('cmdline')).tr("\000", ' ')
|
100
100
|
end
|
101
101
|
|
102
102
|
def environment
|
@@ -189,7 +189,7 @@ class ProcessReport
|
|
189
189
|
|
190
190
|
def open
|
191
191
|
if @path
|
192
|
-
File.open(@path,
|
192
|
+
File.open(@path, 'w') do |f|
|
193
193
|
yield(f)
|
194
194
|
end
|
195
195
|
else
|
@@ -216,16 +216,16 @@ class ProcessReport
|
|
216
216
|
|
217
217
|
section(f) do
|
218
218
|
c_backtraces, ruby_backtraces = @target.gather_backtraces
|
219
|
-
if
|
220
|
-
fail(
|
219
|
+
if /could not attach/i.match?(c_backtraces)
|
220
|
+
fail('Failed to attach to target process. Please try again with sudo.')
|
221
221
|
end
|
222
222
|
|
223
|
-
section(f,
|
224
|
-
section(f,
|
223
|
+
section(f, 'C Backtraces') { c_backtraces }
|
224
|
+
section(f, 'Ruby Backtrace(s)') { ruby_backtraces }
|
225
225
|
end
|
226
226
|
|
227
|
-
section(f,
|
228
|
-
section(f,
|
227
|
+
section(f, 'Open files') { @target.open_files }
|
228
|
+
section(f, 'Log') do
|
229
229
|
commands = Logger.messages.map { |(_, msg)| msg }
|
230
230
|
commands.join("\n")
|
231
231
|
end
|
@@ -235,14 +235,14 @@ class ProcessReport
|
|
235
235
|
private
|
236
236
|
|
237
237
|
def add_environment_sections(handle)
|
238
|
-
section(handle,
|
239
|
-
section(handle,
|
240
|
-
section(handle,
|
241
|
-
section(handle,
|
242
|
-
section(handle,
|
243
|
-
section(handle,
|
244
|
-
section(handle,
|
245
|
-
section(handle,
|
238
|
+
section(handle, 'Time') { Time.now }
|
239
|
+
section(handle, 'PID') { @target.pid }
|
240
|
+
section(handle, 'Command') { @target.procline }
|
241
|
+
section(handle, 'RSS') { @target.rss }
|
242
|
+
section(handle, 'CPU') { @target.cpu }
|
243
|
+
section(handle, 'Parent PID') { @target.ppid }
|
244
|
+
section(handle, 'OS') { ShellWrapper.execute('uname -a') }
|
245
|
+
section(handle, 'Environment') { @target.environment }
|
246
246
|
end
|
247
247
|
end
|
248
248
|
|
@@ -270,10 +270,10 @@ def prompt_for_confirmation(target_pid, target_cmd)
|
|
270
270
|
end
|
271
271
|
|
272
272
|
target_pid = ARGV[0]
|
273
|
-
fail(
|
273
|
+
fail('Please provide a PID for the target process', :usage => true) unless target_pid
|
274
274
|
|
275
275
|
gdb_path = `which gdb`
|
276
|
-
fail(
|
276
|
+
fail('Could not find gdb, please ensure it is installed and in your PATH') if gdb_path.empty?
|
277
277
|
|
278
278
|
target = RubyProcess.new(target_pid)
|
279
279
|
if !target.attachable?
|
@@ -298,5 +298,5 @@ report.generate
|
|
298
298
|
|
299
299
|
puts "Generated '#{report_filename}'"
|
300
300
|
puts ''
|
301
|
-
puts
|
302
|
-
puts
|
301
|
+
puts 'Please examine the output file for potentially sensitive information and'
|
302
|
+
puts 'remove it before sharing this file with anyone.'
|
data/init.rb
CHANGED
@@ -26,5 +26,5 @@ begin
|
|
26
26
|
|
27
27
|
NewRelic::Control.instance.init_plugin(:config => current_config)
|
28
28
|
rescue => e
|
29
|
-
NewRelic::Agent.logger.error(
|
29
|
+
NewRelic::Agent.logger.error('Error initializing New Relic plugin. Agent is disabled.', e)
|
30
30
|
end
|
@@ -142,20 +142,16 @@ module NewRelic
|
|
142
142
|
# the transaction sampler that handles recording transactions
|
143
143
|
attr_reader :transaction_sampler
|
144
144
|
attr_reader :sql_sampler
|
145
|
-
# manages agent commands we receive from the collector, and the handlers
|
146
|
-
attr_reader :agent_command_router
|
147
145
|
# error collector is a simple collection of recorded errors
|
148
146
|
attr_reader :error_collector
|
149
|
-
attr_reader :harvest_samplers
|
150
147
|
# whether we should record raw, obfuscated, or no sql
|
151
148
|
attr_reader :record_sql
|
152
149
|
# builder for JS agent scripts to inject
|
153
150
|
attr_reader :javascript_instrumentor
|
154
151
|
# cross application tracing ids and encoding
|
155
152
|
attr_reader :cross_process_id
|
156
|
-
attr_reader :cross_app_encoding_bytes
|
157
153
|
# service for communicating with collector
|
158
|
-
|
154
|
+
attr_reader :service
|
159
155
|
# Global events dispatcher. This will provides our primary mechanism
|
160
156
|
# for agent-wide events, such as finishing configuration, error notification
|
161
157
|
# and request before/after from Rack.
|
@@ -168,8 +164,6 @@ module NewRelic
|
|
168
164
|
# collector on connect. The former are applied during txns,
|
169
165
|
# the latter during harvest.
|
170
166
|
attr_accessor :transaction_rules
|
171
|
-
# Responsible for restarting the harvest thread
|
172
|
-
attr_reader :harvester
|
173
167
|
# GC::Profiler.total_time is not monotonic so we wrap it.
|
174
168
|
attr_reader :monotonic_gc_profiler
|
175
169
|
attr_reader :custom_event_aggregator
|
@@ -178,7 +172,6 @@ module NewRelic
|
|
178
172
|
attr_reader :transaction_event_recorder
|
179
173
|
attr_reader :attribute_filter
|
180
174
|
attr_reader :adaptive_sampler
|
181
|
-
attr_reader :environment_report
|
182
175
|
|
183
176
|
def transaction_event_aggregator
|
184
177
|
@transaction_event_recorder.transaction_event_aggregator
|
@@ -262,8 +255,8 @@ module NewRelic
|
|
262
255
|
# if litespeed, then ignore all future SIGUSR1 - it's
|
263
256
|
# litespeed trying to shut us down
|
264
257
|
if Agent.config[:dispatcher] == :litespeed
|
265
|
-
Signal.trap(
|
266
|
-
Signal.trap(
|
258
|
+
Signal.trap('SIGUSR1', 'IGNORE')
|
259
|
+
Signal.trap('SIGTERM', 'IGNORE')
|
267
260
|
end
|
268
261
|
end
|
269
262
|
|
@@ -355,12 +348,6 @@ module NewRelic
|
|
355
348
|
end
|
356
349
|
|
357
350
|
public :merge_data_for_endpoint
|
358
|
-
|
359
|
-
# Delegates to the control class to determine the root
|
360
|
-
# directory of this project
|
361
|
-
def determine_home_directory
|
362
|
-
control.root
|
363
|
-
end
|
364
351
|
end
|
365
352
|
|
366
353
|
extend ClassMethods
|
@@ -64,7 +64,7 @@ module NewRelic
|
|
64
64
|
def handle_license_error(error)
|
65
65
|
::NewRelic::Agent.logger.error( \
|
66
66
|
error.message, \
|
67
|
-
|
67
|
+
'Visit NewRelic.com to obtain a valid license key, or to upgrade your account.'
|
68
68
|
)
|
69
69
|
disconnect
|
70
70
|
end
|
@@ -115,7 +115,7 @@ module NewRelic
|
|
115
115
|
::NewRelic::Agent.logger.debug("Connected to NewRelic Service at #{@service.collector.name}")
|
116
116
|
::NewRelic::Agent.logger.debug("Agent Run = #{@service.agent_id}.")
|
117
117
|
::NewRelic::Agent.logger.debug("Connection data = #{config_data.inspect}")
|
118
|
-
if config_data['messages']
|
118
|
+
if config_data['messages']&.any?
|
119
119
|
log_collector_messages(config_data['messages'])
|
120
120
|
end
|
121
121
|
end
|
@@ -126,11 +126,6 @@ module NewRelic
|
|
126
126
|
end
|
127
127
|
end
|
128
128
|
|
129
|
-
# apdex_f is always 4 times the apdex_t
|
130
|
-
def apdex_f
|
131
|
-
(Agent.config[:apdex_t] * 4).to_f
|
132
|
-
end
|
133
|
-
|
134
129
|
class WaitOnConnectTimeout < StandardError
|
135
130
|
end
|
136
131
|
|
@@ -149,7 +144,7 @@ module NewRelic
|
|
149
144
|
return if connected?
|
150
145
|
|
151
146
|
@waited_on_connect = true
|
152
|
-
NewRelic::Agent.logger.debug(
|
147
|
+
NewRelic::Agent.logger.debug('Waiting on connect to complete.')
|
153
148
|
|
154
149
|
@wait_on_connect_mutex.synchronize do
|
155
150
|
@wait_on_connect_condition.wait(@wait_on_connect_mutex, timeout)
|
@@ -203,7 +198,7 @@ module NewRelic
|
|
203
198
|
rescue StandardError, Timeout::Error, NewRelic::Agent::ServerConnectionException => e
|
204
199
|
retry if retry_from_error?(e, opts)
|
205
200
|
rescue Exception => e
|
206
|
-
::NewRelic::Agent.logger.error(
|
201
|
+
::NewRelic::Agent.logger.error('Exception of unexpected type during Agent#connect():', e)
|
207
202
|
|
208
203
|
raise
|
209
204
|
end
|
@@ -133,18 +133,18 @@ module NewRelic
|
|
133
133
|
rescue ForceRestartException, ForceDisconnectException
|
134
134
|
raise
|
135
135
|
rescue UnrecoverableServerException => e
|
136
|
-
NewRelic::Agent.logger.warn(
|
137
|
-
|
136
|
+
NewRelic::Agent.logger.warn('get_agent_commands message was rejected by remote service, discarding. ' \
|
137
|
+
'Error: ', e)
|
138
138
|
rescue ServerConnectionException => e
|
139
139
|
log_remote_unavailable(:get_agent_commands, e)
|
140
140
|
rescue => e
|
141
|
-
NewRelic::Agent.logger.info(
|
141
|
+
NewRelic::Agent.logger.info('Error during check_for_and_handle_agent_commands, will retry later: ', e)
|
142
142
|
end
|
143
143
|
end
|
144
144
|
|
145
145
|
def log_remote_unavailable(endpoint, e)
|
146
146
|
NewRelic::Agent.logger.debug("Unable to send #{endpoint} data, will try again later. Error: ", e)
|
147
|
-
NewRelic::Agent.record_metric(
|
147
|
+
NewRelic::Agent.record_metric('Supportability/remote_unavailable', 0.0)
|
148
148
|
NewRelic::Agent.record_metric("Supportability/remote_unavailable/#{endpoint.to_s}", 0.0)
|
149
149
|
end
|
150
150
|
end
|
@@ -11,7 +11,7 @@ module NewRelic
|
|
11
11
|
def shutdown
|
12
12
|
return unless started?
|
13
13
|
|
14
|
-
::NewRelic::Agent.logger.info(
|
14
|
+
::NewRelic::Agent.logger.info('Starting Agent shutdown')
|
15
15
|
|
16
16
|
stop_event_loop
|
17
17
|
trap_signals_for_litespeed
|
@@ -48,22 +48,22 @@ module NewRelic
|
|
48
48
|
transmit_data_types
|
49
49
|
shutdown_service
|
50
50
|
|
51
|
-
::NewRelic::Agent.logger.debug(
|
51
|
+
::NewRelic::Agent.logger.debug('Graceful disconnect complete')
|
52
52
|
rescue Timeout::Error, StandardError => e
|
53
53
|
::NewRelic::Agent.logger.debug("Error when disconnecting #{e.class.name}: #{e.message}")
|
54
54
|
end
|
55
55
|
else
|
56
|
-
::NewRelic::Agent.logger.debug(
|
56
|
+
::NewRelic::Agent.logger.debug('Bypassing graceful disconnect - agent not connected')
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
60
|
def shutdown_service
|
61
61
|
if @connected_pid == $$ && !@service.kind_of?(NewRelic::Agent::NewRelicService)
|
62
|
-
::NewRelic::Agent.logger.debug(
|
62
|
+
::NewRelic::Agent.logger.debug('Sending New Relic service agent run shutdown message')
|
63
63
|
@service.shutdown
|
64
64
|
else
|
65
65
|
::NewRelic::Agent.logger.debug("This agent connected from parent process #{@connected_pid}--not sending " \
|
66
|
-
|
66
|
+
'shutdown')
|
67
67
|
end
|
68
68
|
end
|
69
69
|
end
|
@@ -11,7 +11,7 @@ module NewRelic
|
|
11
11
|
# before connecting, otherwise the parent process sends useless data
|
12
12
|
def using_forking_dispatcher?
|
13
13
|
if [:puma, :passenger, :unicorn].include?(Agent.config[:dispatcher])
|
14
|
-
::NewRelic::Agent.logger.info(
|
14
|
+
::NewRelic::Agent.logger.info('Deferring startup of agent reporting thread because ' \
|
15
15
|
"#{Agent.config[:dispatcher]} may fork.")
|
16
16
|
true
|
17
17
|
else
|
@@ -65,7 +65,7 @@ module NewRelic
|
|
65
65
|
def install_exit_handler
|
66
66
|
return unless should_install_exit_handler?
|
67
67
|
|
68
|
-
NewRelic::Agent.logger.debug(
|
68
|
+
NewRelic::Agent.logger.debug('Installing at_exit handler')
|
69
69
|
at_exit { shutdown }
|
70
70
|
end
|
71
71
|
end
|