newrelic_rpm 9.0.0 → 9.2.2
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 +7 -81
- data/.rubocop_todo.yml +4 -43
- data/.simplecov +2 -1
- data/Brewfile +1 -0
- data/CHANGELOG.md +101 -2
- data/Gemfile +1 -1
- data/Guardfile +8 -7
- data/README.md +1 -2
- data/Rakefile +8 -8
- data/Thorfile +1 -1
- data/bin/newrelic +1 -0
- data/bin/newrelic_cmd +1 -0
- 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 +106 -118
- 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 +15 -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_merchant.rb +3 -3
- 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/chain.rb +1 -1
- data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +3 -3
- data/lib/new_relic/agent/instrumentation/bunny.rb +1 -1
- 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/chain.rb +1 -0
- 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 +2 -2
- data/lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb +4 -3
- data/lib/new_relic/agent/instrumentation/elasticsearch.rb +2 -2
- 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/fiber/chain.rb +1 -1
- data/lib/new_relic/agent/instrumentation/fiber.rb +1 -1
- 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/chain.rb +1 -1
- data/lib/new_relic/agent/instrumentation/grpc/client/instrumentation.rb +3 -2
- data/lib/new_relic/agent/instrumentation/grpc/client/prepend.rb +1 -1
- data/lib/new_relic/agent/instrumentation/grpc/client/request_wrapper.rb +1 -1
- data/lib/new_relic/agent/instrumentation/grpc/server/instrumentation.rb +4 -4
- 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/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/dalli.rb +3 -1
- data/lib/new_relic/agent/instrumentation/memcache/instrumentation.rb +2 -2
- data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +3 -1
- data/lib/new_relic/agent/instrumentation/memcache.rb +8 -8
- 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 +6 -6
- 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/sidekiq.rb +1 -0
- 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 +7 -7
- 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 -15
- 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 +2 -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 +9 -8
- data/lib/new_relic/agent/transaction/abstract_segment.rb +52 -46
- 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 +13 -14
- 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 +8 -2
- data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +1 -1
- data/lib/new_relic/agent/transaction.rb +43 -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 -15
- data/lib/new_relic/control/private_instance_methods.rb +1 -1
- data/lib/new_relic/dependency_detection.rb +14 -18
- 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 +2 -2
- 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 +4 -4
- 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/instrumentation_generator/instrumentation.thor +8 -8
- data/lib/tasks/instrumentation_generator/templates/chain.tt +1 -1
- data/lib/tasks/instrumentation_generator/templates/dependency_detection.tt +1 -1
- data/lib/tasks/multiverse.rb +13 -6
- data/lib/tasks/newrelic.rb +1 -0
- data/lib/tasks/tests.rake +6 -6
- data/newrelic.yml +5 -5
- data/newrelic_rpm.gemspec +13 -13
- data/test/agent_helper.rb +25 -24
- metadata +73 -4
- data/lib/new_relic/agent/range_extensions.rb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd188401ae5aad975a09ff40578156c88aac17e12320f41ce4bee8149c769aaf
|
4
|
+
data.tar.gz: e32201ee58712dd1520f03ae23a46bd1c804c2991b835151a68643c00cf140e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf9190f9bece2103511dc53071120f3dc758dba82cf042c1892d3376dc73a7b66e8898908bfe8406d85ba49ad67f7c6f5b2826e8e9b2a07d29ea05f5a99b701c
|
7
|
+
data.tar.gz: 5a240785708c245119750b33df64e5467e7f9b8abf9daae8b568a452da1913f40862788323232928ecc6da489fc7b998118f2397293a55e4d371e3f0a1ae0ad5
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -6,7 +6,7 @@ require:
|
|
6
6
|
# Default performance configurations: https://github.com/rubocop/rubocop-performance/blob/master/config/default.yml
|
7
7
|
- rubocop-performance
|
8
8
|
# Default rake configurations: https://github.com/rubocop/rubocop-rake/blob/master/config/default.yml
|
9
|
-
|
9
|
+
- rubocop-rake
|
10
10
|
|
11
11
|
AllCops:
|
12
12
|
TargetRubyVersion: 2.7
|
@@ -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
|
|
@@ -238,10 +239,6 @@ Layout/ClosingParenthesisIndentation:
|
|
238
239
|
Layout/CommentIndentation:
|
239
240
|
Enabled: true
|
240
241
|
|
241
|
-
# Disabling for now
|
242
|
-
Layout/ConditionPosition:
|
243
|
-
Enabled: false
|
244
|
-
|
245
242
|
Layout/DefEndAlignment:
|
246
243
|
Enabled: true
|
247
244
|
EnforcedStyleAlignWith: start_of_line
|
@@ -260,19 +257,9 @@ Layout/EmptyComment:
|
|
260
257
|
AllowBorderComment: true
|
261
258
|
AllowMarginComment: true
|
262
259
|
|
263
|
-
# Disabling for now
|
264
|
-
Layout/EmptyLineAfterMagicComment:
|
265
|
-
Enabled: false
|
266
|
-
|
267
260
|
Layout/EmptyLineAfterMultilineCondition:
|
268
261
|
Enabled: false
|
269
262
|
|
270
|
-
# Disabling for now
|
271
|
-
Layout/EmptyLineBetweenDefs:
|
272
|
-
Enabled: false
|
273
|
-
# AllowAdjacentOneLineDefs: false
|
274
|
-
# NumberOfEmptyLines: 1
|
275
|
-
|
276
263
|
Layout/EmptyLines:
|
277
264
|
Enabled: true
|
278
265
|
|
@@ -361,10 +348,6 @@ Layout/HashAlignment:
|
|
361
348
|
Layout/HeredocArgumentClosingParenthesis:
|
362
349
|
Enabled: false
|
363
350
|
|
364
|
-
# Disabling for now
|
365
|
-
Layout/HeredocIndentation:
|
366
|
-
Enabled: false
|
367
|
-
|
368
351
|
Layout/IndentationConsistency:
|
369
352
|
Enabled: true
|
370
353
|
EnforcedStyle: normal
|
@@ -504,11 +487,6 @@ Layout/SpaceBeforeFirstArg:
|
|
504
487
|
Layout/SpaceBeforeSemicolon:
|
505
488
|
Enabled: true
|
506
489
|
|
507
|
-
# Disabling for now
|
508
|
-
Layout/SpaceInLambdaLiteral:
|
509
|
-
Enabled: false
|
510
|
-
# EnforcedStyle: require_no_space
|
511
|
-
|
512
490
|
Layout/SpaceInsideArrayLiteralBrackets:
|
513
491
|
Enabled: true
|
514
492
|
EnforcedStyle: no_space
|
@@ -532,10 +510,6 @@ Layout/SpaceInsideParens:
|
|
532
510
|
Enabled: true
|
533
511
|
EnforcedStyle: no_space
|
534
512
|
|
535
|
-
# Disabling for now
|
536
|
-
Layout/SpaceInsidePercentLiteralDelimiters:
|
537
|
-
Enabled: false
|
538
|
-
|
539
513
|
Layout/SpaceInsideRangeLiteral:
|
540
514
|
Enabled: true
|
541
515
|
|
@@ -562,40 +536,24 @@ Lint/AmbiguousAssignment:
|
|
562
536
|
Lint/AmbiguousBlockAssociation:
|
563
537
|
Enabled: false
|
564
538
|
|
565
|
-
# Disabling for now
|
566
|
-
Lint/AmbiguousOperator:
|
567
|
-
Enabled: false
|
568
|
-
|
569
539
|
Lint/AmbiguousOperatorPrecedence:
|
570
540
|
Enabled: false
|
571
541
|
|
572
542
|
Lint/AmbiguousRange:
|
573
543
|
Enabled: false
|
574
544
|
|
575
|
-
# Disabling for now
|
576
|
-
Lint/AmbiguousRegexpLiteral:
|
577
|
-
Enabled: false
|
578
|
-
|
579
|
-
# Disabling for now
|
580
545
|
Lint/AssignmentInCondition:
|
581
546
|
Enabled: false
|
582
|
-
# AllowSafeAssignment: true
|
583
547
|
|
584
548
|
Lint/BigDecimalNew:
|
585
549
|
Enabled: true
|
586
550
|
|
587
|
-
# Disabling for now
|
588
551
|
Lint/BinaryOperatorWithIdenticalOperands:
|
589
552
|
Enabled: false
|
590
553
|
|
591
|
-
# Disabling for now
|
592
|
-
Lint/BooleanSymbol:
|
593
|
-
Enabled: false
|
594
|
-
|
595
554
|
Lint/CircularArgumentReference:
|
596
555
|
Enabled: true
|
597
556
|
|
598
|
-
# Disabling for now
|
599
557
|
Lint/ConstantDefinitionInBlock:
|
600
558
|
Enabled: false
|
601
559
|
|
@@ -605,10 +563,6 @@ Lint/ConstantResolution:
|
|
605
563
|
Lint/Debugger:
|
606
564
|
Enabled: true
|
607
565
|
|
608
|
-
# Disabling for now
|
609
|
-
Lint/DeprecatedClassMethods:
|
610
|
-
Enabled: false
|
611
|
-
|
612
566
|
Lint/DeprecatedConstants:
|
613
567
|
Enabled: true
|
614
568
|
|
@@ -621,20 +575,12 @@ Lint/DisjunctiveAssignmentInConstructor:
|
|
621
575
|
Lint/DuplicateBranch:
|
622
576
|
Enabled: false
|
623
577
|
|
624
|
-
# Disabling for now
|
625
|
-
Lint/DuplicateCaseCondition:
|
626
|
-
Enabled: false
|
627
|
-
|
628
578
|
Lint/DuplicateElsifCondition:
|
629
579
|
Enabled: true
|
630
580
|
|
631
581
|
Lint/DuplicateHashKey:
|
632
582
|
Enabled: true
|
633
583
|
|
634
|
-
# Disabling for now
|
635
|
-
Lint/DuplicateMethods:
|
636
|
-
Enabled: false
|
637
|
-
|
638
584
|
Lint/DuplicateRegexpCharacterClassElement:
|
639
585
|
Enabled: true
|
640
586
|
|
@@ -659,11 +605,6 @@ Lint/EmptyClass:
|
|
659
605
|
Lint/EmptyConditionalBody:
|
660
606
|
Enabled: false
|
661
607
|
|
662
|
-
# Disabling for now
|
663
|
-
Lint/EmptyEnsure:
|
664
|
-
Enabled: false
|
665
|
-
# AutoCorrect: true
|
666
|
-
|
667
608
|
Lint/EmptyExpression:
|
668
609
|
Enabled: true
|
669
610
|
|
@@ -680,10 +621,6 @@ Lint/EmptyWhen:
|
|
680
621
|
Enabled: true
|
681
622
|
AllowComments: true
|
682
623
|
|
683
|
-
# Disabling for now
|
684
|
-
Lint/EnsureReturn:
|
685
|
-
Enabled: false
|
686
|
-
|
687
624
|
Lint/ErbNewArguments:
|
688
625
|
Enabled: true
|
689
626
|
|
@@ -1255,9 +1192,6 @@ Style/DocumentationMethod:
|
|
1255
1192
|
Style/DoubleCopDisableDirective:
|
1256
1193
|
Enabled: false
|
1257
1194
|
|
1258
|
-
Style/DoubleNegation:
|
1259
|
-
Enabled: false
|
1260
|
-
|
1261
1195
|
Style/EachForSimpleLoop:
|
1262
1196
|
Enabled: true
|
1263
1197
|
|
@@ -1318,6 +1252,9 @@ Style/ExplicitBlockArgument:
|
|
1318
1252
|
Style/ExponentialNotation:
|
1319
1253
|
Enabled: false
|
1320
1254
|
|
1255
|
+
Style/FetchEnvVar:
|
1256
|
+
Enabled: false
|
1257
|
+
|
1321
1258
|
Style/FloatDivision:
|
1322
1259
|
Enabled: false
|
1323
1260
|
|
@@ -1781,17 +1718,6 @@ Style/StringConcatenation:
|
|
1781
1718
|
Style/StringHashKeys:
|
1782
1719
|
Enabled: false
|
1783
1720
|
|
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
1721
|
Style/StringMethods:
|
1796
1722
|
Enabled: false
|
1797
1723
|
|
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
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'securerandom'
|
3
4
|
|
4
5
|
if ENV['CI']
|
@@ -10,6 +11,6 @@ end
|
|
10
11
|
SimpleCov.start do
|
11
12
|
enable_coverage(:branch)
|
12
13
|
SimpleCov.root(File.join(File.dirname(__FILE__), '/lib'))
|
13
|
-
track_files(
|
14
|
+
track_files('**/*.rb')
|
14
15
|
formatter(SimpleCov::Formatter::SimpleFormatter) if ENV['CI']
|
15
16
|
end
|
data/Brewfile
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,104 @@
|
|
1
1
|
# New Relic Ruby Agent Release Notes
|
2
2
|
|
3
|
+
## v9.2.2
|
4
|
+
|
5
|
+
Version 9.2.2 of the agent fixes a bug with the `Transaction#finished?` method.
|
6
|
+
|
7
|
+
- **Bugfix: Transaction#finished? no longer throws a NoMethodError when initial_segment is nil**
|
8
|
+
|
9
|
+
This change adds a safe navigation operator to `Transaction#finished?` to prevent `NoMethodErrors` when a transaction does not have any segments. Our thanks goes to [@JulienDefrance](https://github.com/JulienDefrance) for reporting this issue. [PR#1983](https://github.com/newrelic/newrelic-ruby-agent/pull/1983)
|
10
|
+
|
11
|
+
## v9.2.1
|
12
|
+
|
13
|
+
Version 9.2.1 fixes a bug causing the agent to continue storing data on finished transactions, and a bug preventing errors from being expected.
|
14
|
+
|
15
|
+
- **Bugfix: Finished transactions continue to store data on different threads**
|
16
|
+
|
17
|
+
Previously, when a new thread was spawned the agent would continue using the current transaction to record data on, even if this transaction had finished already in a different thread. Now the agent will only use the current transaction in the new thread if it is not yet finished. Thank you to [@fcheung](https://github.com/fcheung) for reporting this bug and providing us with an extremely helpful reproduction to debug. [PR#1969](https://github.com/newrelic/newrelic-ruby-agent/pull/1969)
|
18
|
+
|
19
|
+
|
20
|
+
- **Bugfix: Expected Errors passed to notice_error are expected again**
|
21
|
+
|
22
|
+
A bug was introduced in 9.1.0 that caused to agent not to mark errors as expected if the error was passed in to `notice_error` using the `expected: true` parameter. This has been fixed and errors will now be marked as expected, as expected. Thank you very much to [@eiskrenkov](https://github.com/eiskrenkov) for finding this bug and contributing a fix for it! [PR#1954](https://github.com/newrelic/newrelic-ruby-agent/pull/1954)
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
## v9.2.0
|
27
|
+
|
28
|
+
Version 9.2.0 of the agent introduces some performance improvements for working with high numbers of nested actions, and deprecates instrumentation for the `memcached` and `memcache-client` gems (with `dalli` still being supported).
|
29
|
+
|
30
|
+
- **Feature: Enhance performance for handling high numbers of nested actions**
|
31
|
+
|
32
|
+
With [Issue#1910](https://github.com/newrelic/newrelic-ruby-agent/issues/1910) community members [@parkerfinch](https://github.com/parkerfinch) and [@travisbell](https://github.com/travisbell) informed us of some CPU spikes and process hangs seen only when using the agent's thread instrumentation, which was enabled by default with v9.0. When thread instrumentation is enabled, instrumented actions taking place within threads are seen and reported on by the agent whereas they would have previously gone unnoticed. This is a great improvement to the agent's usefulness in an async context, and also makes it easier for higher numbers of nested actions to be observed.
|
33
|
+
For example, if an instrumented background job framework (Sidekiq, Resque) kicks off a job that the agent notices and then that job in turn performs actions such as database queries that the agent also instruments, nested actions are seen. However, with very high (10,000+) numbers of actions nested within a single instrumented outer action, the agent would struggle to efficiently crunch through all of the collected data at the time when the outer action finished.
|
34
|
+
The agent should now be much more efficient when any observed action with lots of nested actions is finished. Our performance testing was conducted with hundreds of thousands of nested actions taking place, and we hope that the benefits of thread tracing can now be enjoyed without any drawbacks. Thanks very much [@parkerfinch](https://github.com/parkerfinch) and [@travisbell](https://github.com/travisbell)! [PR#1927](https://github.com/newrelic/newrelic-ruby-agent/pull/1927)
|
35
|
+
|
36
|
+
- **Feature: The agent configuration will now reflect whether module prepending or method chaining was used for instrumentation**
|
37
|
+
|
38
|
+
For `:'instrumentation.*'` configuration parameters that are set to :auto (the default), the agent will automatically determine whether to use module prepending or method chaining. The agent will now update its in-memory configuration to give each relevant parameter a value of either :prepend or :chain so that the result of the determination can be introspected. This is intended to help 3rd party libraries that wish to further enhance the agent's instrumentation capabilities by prepending or chaining additional logic. Environment variable, YAML file, and server-side configuration based values are not impacted. [PR#1930](https://github.com/newrelic/newrelic-ruby-agent/pull/1930)
|
39
|
+
|
40
|
+
- **Feature: Deprecate memcached and memcache-client instrumentation**
|
41
|
+
|
42
|
+
Instrumentation for the memcached and memcache-client libraries is deprecated and will be removed during the next major release.
|
43
|
+
|
44
|
+
## v9.1.0
|
45
|
+
|
46
|
+
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.
|
47
|
+
|
48
|
+
- **Feature: Error fingerprinting - supply your own errors inbox group names**
|
49
|
+
|
50
|
+
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.
|
51
|
+
|
52
|
+
The customer defined proc will be expected to receive exactly one input argument, a hash. The hash contains the following:
|
53
|
+
|
54
|
+
| Key | Value |
|
55
|
+
| ---------------------| ---------------------------------------------------------------------------- |
|
56
|
+
| `:error` | The Ruby error class instance. Offers `#class`, `#message`, and `#backtrace` |
|
57
|
+
| `:customAttributes` | Any customer defined custom attributes for the current transaction |
|
58
|
+
| `:'request.uri'` | The current request URI if available |
|
59
|
+
| `:'http.statusCode'` | The HTTP status code (200, 404, etc.) if available |
|
60
|
+
| `:'http.method'` | The HTTP method (GET, PUT, etc.) if available |
|
61
|
+
| `:'error.expected'` | Whether (true) or not (false) the error was expected |
|
62
|
+
| `:'options'` | The options hash passed to `NewRelic::Agent.notice_error` |
|
63
|
+
|
64
|
+
The callback only needs to be set once per initialization of the New Relic agent.
|
65
|
+
|
66
|
+
Example usage:
|
67
|
+
|
68
|
+
```
|
69
|
+
proc = proc { |hash| "Access" if hash[:'http.statusCode'] == 401 }
|
70
|
+
NewRelic::Agent.set_error_group_callback(proc)
|
71
|
+
```
|
72
|
+
|
73
|
+
- **Feature: User tracking - associate errors with a user id**
|
74
|
+
|
75
|
+
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.
|
76
|
+
|
77
|
+
- **Identify Amazon Timestream when the amazon_timestream AR adapter is used**
|
78
|
+
|
79
|
+
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)
|
80
|
+
|
81
|
+
- **Bugfix: Remove Distributed Tracing related warnings from agent logs when headers are not present in Sidekiq**
|
82
|
+
|
83
|
+
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)
|
84
|
+
|
85
|
+
- **Bugfix: Log request headers in debug-level logs instead of human-readable Objects**
|
86
|
+
|
87
|
+
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)
|
88
|
+
|
89
|
+
- **Bugfix: Fix undefined method `controller_path` logged in Action Controller Instrumentation**
|
90
|
+
|
91
|
+
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)
|
92
|
+
|
93
|
+
- **Bugfix: Fix Transaction#finish exception and decrease log level for related warning during async transactions**
|
94
|
+
|
95
|
+
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)
|
96
|
+
|
97
|
+
- **CI: Target JRuby 9.4.2.0**
|
98
|
+
|
99
|
+
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.
|
100
|
+
|
101
|
+
|
3
102
|
## v9.0.0
|
4
103
|
|
5
104
|
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 +191,8 @@
|
|
92
191
|
- HttpClient: 2.2.0 - 2.8.0
|
93
192
|
- HttpRb: 0.9.9 - 2.2.1
|
94
193
|
- Typhoeus: 0.5.3 - 1.2.x
|
95
|
-
- Bunny: 2.0.x - 2.6.x
|
96
|
-
- ActiveMerchant: 1.25.0 - 1.64.x
|
194
|
+
- Bunny: 2.0.x - 2.6.x
|
195
|
+
- ActiveMerchant: 1.25.0 - 1.64.x
|
97
196
|
|
98
197
|
|
99
198
|
- **Updated API method `set_transaction_name`**
|
data/Gemfile
CHANGED
data/Guardfile
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require './test/multiverse/lib/multiverse/bundler_patch'
|
3
4
|
|
4
|
-
test_folders = Dir.glob(
|
5
|
-
test_folders += Dir.glob(
|
5
|
+
test_folders = Dir.glob('test/new_relic/*').select { |f| File.directory?(f) }
|
6
|
+
test_folders += Dir.glob('test/new_relic/**/*').select { |f| File.directory?(f) }
|
6
7
|
|
7
|
-
rake_lib_path = Bundler.with_unbundled_env { `bundle exec gem which rake`.chomp.gsub(
|
8
|
+
rake_lib_path = Bundler.with_unbundled_env { `bundle exec gem which rake`.chomp.gsub('lib/rake.rb', 'lib') }
|
8
9
|
ruby_options = %(-w -I"#{rake_lib_path}" "#{rake_lib_path}/rake/rake_test_loader.rb")
|
9
10
|
|
10
11
|
guard_options = {
|
@@ -17,10 +18,10 @@ guard_options = {
|
|
17
18
|
guard :minitest, guard_options do
|
18
19
|
watch(%r{^lib/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
|
19
20
|
watch(%r{^test/.+_test\.rb$})
|
20
|
-
watch(%r{^test/rum/.*}) {
|
21
|
+
watch(%r{^test/rum/.*}) { 'test/new_relic/rack/browser_monitoring_test.rb' }
|
21
22
|
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') {
|
23
|
+
watch('test/test_helper.rb') { 'test/new_relic' }
|
24
|
+
watch('test/agent_helper.rb') { 'test/new_relic' }
|
25
|
+
watch('lib/new_relic/agent/configuration/default_source.rb') { 'test/new_relic/agent/configuration/orphan_configuration_test.rb' }
|
25
26
|
watch(%r{^lib/new_relic/agent/transaction/(.+).rb}) { |m| "test/new_relic/agent/distributed_tracing/#{m[1]}_cross_agent_test.rb" }
|
26
27
|
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/newrelic
CHANGED
data/bin/newrelic_cmd
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.'
|