newrelic_rpm 8.10.1 → 8.11.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 -1
- data/.rubocop.yml +20 -187
- data/.rubocop_todo.yml +11 -202
- data/.simplecov +6 -4
- data/CHANGELOG.md +68 -25
- data/Gemfile +0 -1
- data/README.md +1 -1
- data/Rakefile +3 -20
- data/Thorfile +0 -1
- data/bin/nrdebug +63 -43
- data/config.dot +5 -5
- data/init.rb +1 -2
- data/install.rb +1 -2
- data/lib/new_relic/agent/adaptive_sampler.rb +0 -1
- data/lib/new_relic/agent/agent/shutdown.rb +0 -1
- data/lib/new_relic/agent/agent/special_startup.rb +0 -1
- data/lib/new_relic/agent/agent/start_worker_thread.rb +0 -1
- data/lib/new_relic/agent/agent/startup.rb +0 -1
- data/lib/new_relic/agent/agent.rb +100 -73
- data/lib/new_relic/agent/agent_logger.rb +4 -5
- data/lib/new_relic/agent/attribute_filter.rb +39 -21
- data/lib/new_relic/agent/attribute_processing.rb +3 -4
- data/lib/new_relic/agent/attributes.rb +0 -1
- data/lib/new_relic/agent/audit_logger.rb +2 -3
- data/lib/new_relic/agent/autostart.rb +0 -1
- data/lib/new_relic/agent/chained_call.rb +0 -1
- data/lib/new_relic/agent/commands/agent_command.rb +0 -1
- data/lib/new_relic/agent/commands/agent_command_router.rb +3 -4
- data/lib/new_relic/agent/commands/thread_profiler_session.rb +0 -1
- data/lib/new_relic/agent/configuration/default_source.rb +56 -27
- data/lib/new_relic/agent/configuration/dotted_hash.rb +1 -2
- data/lib/new_relic/agent/configuration/environment_source.rb +3 -4
- data/lib/new_relic/agent/configuration/event_harvest_config.rb +0 -1
- data/lib/new_relic/agent/configuration/high_security_source.rb +0 -1
- data/lib/new_relic/agent/configuration/manager.rb +1 -2
- data/lib/new_relic/agent/configuration/manual_source.rb +0 -1
- data/lib/new_relic/agent/configuration/mask_defaults.rb +2 -3
- data/lib/new_relic/agent/configuration/security_policy_source.rb +0 -1
- data/lib/new_relic/agent/configuration/server_source.rb +0 -1
- data/lib/new_relic/agent/configuration/yaml_source.rb +2 -3
- data/lib/new_relic/agent/configuration.rb +0 -1
- data/lib/new_relic/agent/connect/request_builder.rb +1 -2
- data/lib/new_relic/agent/connect/response_handler.rb +1 -2
- data/lib/new_relic/agent/custom_event_aggregator.rb +0 -1
- data/lib/new_relic/agent/database/explain_plan_helpers.rb +0 -1
- data/lib/new_relic/agent/database/obfuscation_helpers.rb +0 -1
- data/lib/new_relic/agent/database/obfuscator.rb +0 -1
- data/lib/new_relic/agent/database/postgres_explain_obfuscator.rb +0 -1
- data/lib/new_relic/agent/database.rb +13 -14
- data/lib/new_relic/agent/database_adapter.rb +0 -1
- data/lib/new_relic/agent/datastores/metric_helper.rb +0 -4
- data/lib/new_relic/agent/datastores/mongo/event_formatter.rb +2 -3
- data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +1 -4
- data/lib/new_relic/agent/datastores/mongo/obfuscator.rb +0 -1
- data/lib/new_relic/agent/datastores/mongo.rb +0 -1
- data/lib/new_relic/agent/datastores/redis.rb +0 -1
- data/lib/new_relic/agent/datastores.rb +0 -1
- data/lib/new_relic/agent/deprecator.rb +0 -1
- data/lib/new_relic/agent/distributed_tracing/cross_app_payload.rb +0 -1
- data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +0 -1
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +0 -1
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_metrics.rb +0 -1
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +0 -2
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb +0 -1
- data/lib/new_relic/agent/distributed_tracing/trace_context.rb +0 -1
- data/lib/new_relic/agent/distributed_tracing/trace_context_payload.rb +0 -1
- data/lib/new_relic/agent/distributed_tracing.rb +0 -1
- data/lib/new_relic/agent/encoding_normalizer.rb +0 -1
- data/lib/new_relic/agent/error_collector.rb +0 -1
- data/lib/new_relic/agent/error_event_aggregator.rb +0 -1
- data/lib/new_relic/agent/error_filter.rb +4 -5
- data/lib/new_relic/agent/error_trace_aggregator.rb +1 -2
- data/lib/new_relic/agent/event_aggregator.rb +0 -1
- data/lib/new_relic/agent/event_buffer.rb +0 -1
- data/lib/new_relic/agent/event_listener.rb +0 -1
- data/lib/new_relic/agent/event_loop.rb +2 -3
- data/lib/new_relic/agent/external.rb +1 -2
- data/lib/new_relic/agent/guid_generator.rb +0 -1
- data/lib/new_relic/agent/harvester.rb +0 -1
- data/lib/new_relic/agent/heap.rb +2 -3
- data/lib/new_relic/agent/hostname.rb +0 -1
- data/lib/new_relic/agent/http_clients/abstract.rb +0 -1
- data/lib/new_relic/agent/http_clients/curb_wrappers.rb +0 -1
- data/lib/new_relic/agent/http_clients/excon_wrappers.rb +0 -1
- data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +1 -2
- data/lib/new_relic/agent/http_clients/httpclient_wrappers.rb +1 -2
- data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +0 -1
- data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +1 -2
- data/lib/new_relic/agent/http_clients/uri_util.rb +0 -1
- data/lib/new_relic/agent/instrumentation/action_cable_subscriber.rb +0 -1
- data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +0 -1
- data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +1 -2
- data/lib/new_relic/agent/instrumentation/active_job.rb +0 -1
- data/lib/new_relic/agent/instrumentation/active_merchant.rb +2 -2
- data/lib/new_relic/agent/instrumentation/active_record.rb +0 -1
- data/lib/new_relic/agent/instrumentation/active_record_helper.rb +0 -1
- data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +0 -1
- data/lib/new_relic/agent/instrumentation/active_record_prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +0 -1
- data/lib/new_relic/agent/instrumentation/active_storage.rb +0 -1
- data/lib/new_relic/agent/instrumentation/active_storage_subscriber.rb +0 -1
- data/lib/new_relic/agent/instrumentation/active_support_logger/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/active_support_logger/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/active_support_logger/prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/active_support_logger.rb +0 -1
- data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +0 -1
- data/lib/new_relic/agent/instrumentation/authlogic.rb +0 -1
- data/lib/new_relic/agent/instrumentation/bunny/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/bunny/prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/bunny.rb +0 -1
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +2 -3
- data/lib/new_relic/agent/instrumentation/curb/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/curb/instrumentation.rb +14 -11
- data/lib/new_relic/agent/instrumentation/curb/prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/curb.rb +0 -1
- data/lib/new_relic/agent/instrumentation/data_mapper.rb +1 -2
- data/lib/new_relic/agent/instrumentation/delayed_job/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/delayed_job/prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/excon/middleware.rb +0 -1
- data/lib/new_relic/agent/instrumentation/excon.rb +0 -1
- data/lib/new_relic/agent/instrumentation/grape/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/grape/prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/grape.rb +0 -1
- data/lib/new_relic/agent/instrumentation/grpc/client/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/grpc/client/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/grpc/client/prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/grpc/client/request_wrapper.rb +0 -1
- data/lib/new_relic/agent/instrumentation/grpc/helper.rb +0 -1
- data/lib/new_relic/agent/instrumentation/grpc/server/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/grpc/server/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/grpc/server/rpc_desc_prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/grpc/server/rpc_server_prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/grpc_client.rb +0 -1
- data/lib/new_relic/agent/instrumentation/grpc_server.rb +0 -1
- data/lib/new_relic/agent/instrumentation/httpclient/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/httpclient/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/httpclient/prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/httpclient.rb +0 -1
- data/lib/new_relic/agent/instrumentation/httprb/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/httprb/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/httprb/prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/httprb.rb +0 -1
- data/lib/new_relic/agent/instrumentation/ignore_actions.rb +0 -1
- data/lib/new_relic/agent/instrumentation/logger/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/logger/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/logger/prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/logger.rb +0 -1
- data/lib/new_relic/agent/instrumentation/memcache/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +1 -2
- data/lib/new_relic/agent/instrumentation/memcache/helper.rb +0 -1
- data/lib/new_relic/agent/instrumentation/memcache/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +1 -2
- data/lib/new_relic/agent/instrumentation/memcache.rb +4 -5
- data/lib/new_relic/agent/instrumentation/middleware_proxy.rb +1 -2
- data/lib/new_relic/agent/instrumentation/middleware_tracing.rb +0 -1
- data/lib/new_relic/agent/instrumentation/mongo.rb +0 -1
- data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +1 -2
- data/lib/new_relic/agent/instrumentation/net_http/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/net_http/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/net_http/prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/net_http.rb +0 -1
- data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +2 -3
- data/lib/new_relic/agent/instrumentation/padrino/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/padrino/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/padrino/prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/padrino.rb +0 -1
- data/lib/new_relic/agent/instrumentation/passenger_instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/queue_time.rb +0 -2
- data/lib/new_relic/agent/instrumentation/rack/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/rack/helpers.rb +0 -1
- data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/rack/prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/rack.rb +0 -1
- data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +0 -1
- data/lib/new_relic/agent/instrumentation/rails_middleware.rb +0 -1
- data/lib/new_relic/agent/instrumentation/rails_notifications/action_cable.rb +0 -1
- data/lib/new_relic/agent/instrumentation/rails_notifications/action_controller.rb +0 -1
- data/lib/new_relic/agent/instrumentation/rails_notifications/action_view.rb +0 -1
- data/lib/new_relic/agent/instrumentation/rainbows_instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/rake/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/rake/instrumentation.rb +5 -1
- data/lib/new_relic/agent/instrumentation/rake/prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/rake.rb +0 -1
- data/lib/new_relic/agent/instrumentation/redis/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/redis/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/redis/prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/redis.rb +0 -1
- data/lib/new_relic/agent/instrumentation/resque/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/resque/helper.rb +0 -1
- data/lib/new_relic/agent/instrumentation/resque/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/resque/prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/resque.rb +0 -1
- data/lib/new_relic/agent/instrumentation/sequel.rb +0 -1
- data/lib/new_relic/agent/instrumentation/sequel_helper.rb +0 -1
- data/lib/new_relic/agent/instrumentation/sidekiq.rb +1 -2
- data/lib/new_relic/agent/instrumentation/sinatra/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +0 -1
- data/lib/new_relic/agent/instrumentation/sinatra/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/sinatra/prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/sinatra/transaction_namer.rb +0 -1
- data/lib/new_relic/agent/instrumentation/sinatra.rb +0 -1
- data/lib/new_relic/agent/instrumentation/sunspot.rb +0 -1
- data/lib/new_relic/agent/instrumentation/thread/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/thread/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/thread/prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/thread.rb +0 -1
- data/lib/new_relic/agent/instrumentation/tilt/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/tilt/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/tilt/prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/tilt.rb +0 -1
- data/lib/new_relic/agent/instrumentation/typhoeus/chain.rb +0 -1
- data/lib/new_relic/agent/instrumentation/typhoeus/instrumentation.rb +3 -4
- data/lib/new_relic/agent/instrumentation/typhoeus/prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/typhoeus.rb +0 -1
- data/lib/new_relic/agent/instrumentation.rb +0 -1
- data/lib/new_relic/agent/internal_agent_error.rb +0 -1
- data/lib/new_relic/agent/javascript_instrumentor.rb +1 -2
- data/lib/new_relic/agent/linking_metadata.rb +0 -1
- data/lib/new_relic/agent/local_log_decorator.rb +0 -1
- data/lib/new_relic/agent/log_event_aggregator.rb +0 -1
- data/lib/new_relic/agent/log_once.rb +0 -1
- data/lib/new_relic/agent/log_priority.rb +0 -1
- data/lib/new_relic/agent/logging.rb +0 -1
- data/lib/new_relic/agent/memory_logger.rb +0 -1
- data/lib/new_relic/agent/messaging.rb +1 -2
- data/lib/new_relic/agent/method_tracer.rb +0 -1
- data/lib/new_relic/agent/method_tracer_helpers.rb +1 -2
- data/lib/new_relic/agent/monitors/cross_app_monitor.rb +0 -1
- data/lib/new_relic/agent/monitors/distributed_tracing_monitor.rb +0 -1
- data/lib/new_relic/agent/monitors/inbound_request_monitor.rb +0 -1
- data/lib/new_relic/agent/monitors/synthetics_monitor.rb +0 -1
- data/lib/new_relic/agent/monitors.rb +0 -1
- data/lib/new_relic/agent/new_relic_service/encoders.rb +0 -1
- data/lib/new_relic/agent/new_relic_service/json_marshaller.rb +0 -1
- data/lib/new_relic/agent/new_relic_service/marshaller.rb +0 -1
- data/lib/new_relic/agent/new_relic_service/security_policy_settings.rb +0 -1
- data/lib/new_relic/agent/new_relic_service.rb +193 -142
- data/lib/new_relic/agent/{noticible_error.rb → noticeable_error.rb} +1 -2
- data/lib/new_relic/agent/null_logger.rb +0 -1
- data/lib/new_relic/agent/obfuscator.rb +1 -2
- data/lib/new_relic/agent/parameter_filtering.rb +0 -1
- data/lib/new_relic/agent/payload_metric_mapping.rb +0 -1
- data/lib/new_relic/agent/pipe_channel_manager.rb +0 -1
- data/lib/new_relic/agent/pipe_service.rb +0 -1
- data/lib/new_relic/agent/prepend_supportability.rb +0 -1
- data/lib/new_relic/agent/priority_sampled_buffer.rb +2 -3
- data/lib/new_relic/agent/range_extensions.rb +0 -1
- data/lib/new_relic/agent/rules_engine/replacement_rule.rb +0 -1
- data/lib/new_relic/agent/rules_engine/segment_terms_rule.rb +0 -1
- data/lib/new_relic/agent/rules_engine.rb +0 -1
- data/lib/new_relic/agent/sampler.rb +0 -1
- data/lib/new_relic/agent/sampler_collection.rb +0 -1
- data/lib/new_relic/agent/samplers/cpu_sampler.rb +0 -1
- data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +0 -1
- data/lib/new_relic/agent/samplers/memory_sampler.rb +5 -6
- data/lib/new_relic/agent/samplers/object_sampler.rb +0 -1
- data/lib/new_relic/agent/samplers/vm_sampler.rb +2 -1
- data/lib/new_relic/agent/span_event_aggregator.rb +0 -1
- data/lib/new_relic/agent/span_event_primitive.rb +0 -2
- data/lib/new_relic/agent/sql_sampler.rb +0 -1
- data/lib/new_relic/agent/stats.rb +12 -3
- data/lib/new_relic/agent/stats_engine/gc_profiler.rb +0 -2
- data/lib/new_relic/agent/stats_engine/stats_hash.rb +1 -2
- data/lib/new_relic/agent/stats_engine.rb +0 -1
- data/lib/new_relic/agent/synthetics_event_aggregator.rb +0 -1
- data/lib/new_relic/agent/system_info.rb +1 -2
- data/lib/new_relic/agent/threading/agent_thread.rb +2 -3
- data/lib/new_relic/agent/threading/backtrace_node.rb +0 -1
- data/lib/new_relic/agent/threading/backtrace_service.rb +0 -1
- data/lib/new_relic/agent/threading/thread_profile.rb +1 -2
- data/lib/new_relic/agent/timestamp_sampled_buffer.rb +0 -1
- data/lib/new_relic/agent/tracer.rb +2 -3
- data/lib/new_relic/agent/transaction/abstract_segment.rb +2 -3
- data/lib/new_relic/agent/transaction/datastore_segment.rb +0 -1
- data/lib/new_relic/agent/transaction/distributed_tracer.rb +0 -1
- data/lib/new_relic/agent/transaction/distributed_tracing.rb +0 -1
- data/lib/new_relic/agent/transaction/external_request_segment.rb +1 -2
- data/lib/new_relic/agent/transaction/message_broker_segment.rb +0 -1
- data/lib/new_relic/agent/transaction/request_attributes.rb +0 -1
- data/lib/new_relic/agent/transaction/segment.rb +0 -1
- data/lib/new_relic/agent/transaction/slowest_sample_buffer.rb +0 -1
- data/lib/new_relic/agent/transaction/synthetics_sample_buffer.rb +0 -1
- data/lib/new_relic/agent/transaction/trace.rb +0 -1
- data/lib/new_relic/agent/transaction/trace_builder.rb +0 -1
- data/lib/new_relic/agent/transaction/trace_context.rb +0 -1
- data/lib/new_relic/agent/transaction/trace_node.rb +2 -3
- data/lib/new_relic/agent/transaction/tracing.rb +0 -1
- data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +0 -2
- data/lib/new_relic/agent/transaction.rb +3 -5
- data/lib/new_relic/agent/transaction_error_primitive.rb +0 -1
- data/lib/new_relic/agent/transaction_event_aggregator.rb +0 -1
- data/lib/new_relic/agent/transaction_event_primitive.rb +0 -1
- data/lib/new_relic/agent/transaction_event_recorder.rb +1 -2
- data/lib/new_relic/agent/transaction_metrics.rb +1 -2
- data/lib/new_relic/agent/transaction_sampler.rb +0 -1
- data/lib/new_relic/agent/transaction_time_aggregator.rb +1 -2
- data/lib/new_relic/agent/utilization/aws.rb +0 -1
- data/lib/new_relic/agent/utilization/azure.rb +1 -2
- data/lib/new_relic/agent/utilization/gcp.rb +1 -2
- data/lib/new_relic/agent/utilization/pcf.rb +1 -2
- data/lib/new_relic/agent/utilization/vendor.rb +1 -2
- data/lib/new_relic/agent/utilization_data.rb +0 -1
- data/lib/new_relic/agent/vm/jruby_vm.rb +0 -1
- data/lib/new_relic/agent/vm/monotonic_gc_profiler.rb +0 -1
- data/lib/new_relic/agent/vm/mri_vm.rb +35 -23
- data/lib/new_relic/agent/vm/snapshot.rb +1 -2
- data/lib/new_relic/agent/vm.rb +0 -1
- data/lib/new_relic/agent/worker_loop.rb +0 -1
- data/lib/new_relic/agent.rb +13 -16
- data/lib/new_relic/cli/command.rb +1 -2
- data/lib/new_relic/cli/commands/deployments.rb +72 -21
- data/lib/new_relic/cli/commands/install.rb +0 -1
- data/lib/new_relic/coerce.rb +0 -1
- data/lib/new_relic/collection_helper.rb +1 -2
- data/lib/new_relic/constants.rb +0 -1
- data/lib/new_relic/control/class_methods.rb +0 -1
- data/lib/new_relic/control/frameworks/external.rb +0 -1
- data/lib/new_relic/control/frameworks/rails.rb +0 -1
- data/lib/new_relic/control/frameworks/rails3.rb +0 -1
- data/lib/new_relic/control/frameworks/rails4.rb +0 -1
- data/lib/new_relic/control/frameworks/rails_notifications.rb +0 -1
- data/lib/new_relic/control/frameworks/ruby.rb +0 -1
- data/lib/new_relic/control/frameworks/sinatra.rb +0 -1
- data/lib/new_relic/control/frameworks.rb +0 -1
- data/lib/new_relic/control/instance_methods.rb +17 -40
- data/lib/new_relic/control/instrumentation.rb +0 -1
- data/lib/new_relic/control/private_instance_methods.rb +48 -0
- data/lib/new_relic/control/server_methods.rb +0 -1
- data/lib/new_relic/control.rb +0 -1
- data/lib/new_relic/delayed_job_injection.rb +0 -1
- data/lib/new_relic/dependency_detection.rb +3 -4
- data/lib/new_relic/environment_report.rb +23 -14
- data/lib/new_relic/helper.rb +1 -2
- data/lib/new_relic/language_support.rb +2 -3
- data/lib/new_relic/latest_changes.rb +3 -4
- data/lib/new_relic/local_environment.rb +3 -4
- data/lib/new_relic/metric_data.rb +27 -22
- data/lib/new_relic/metric_spec.rb +0 -1
- data/lib/new_relic/noticed_error.rb +3 -6
- data/lib/new_relic/rack/agent_hooks.rb +0 -1
- data/lib/new_relic/rack/agent_middleware.rb +0 -1
- data/lib/new_relic/rack/browser_monitoring.rb +131 -123
- data/lib/new_relic/rack.rb +0 -1
- data/lib/new_relic/recipes/capistrano3.rb +2 -59
- data/lib/new_relic/recipes/capistrano_legacy.rb +1 -2
- data/lib/new_relic/recipes/helpers/send_deployment.rb +69 -0
- data/lib/new_relic/recipes.rb +0 -1
- data/lib/new_relic/supportability_helper.rb +1 -2
- data/lib/new_relic/traced_thread.rb +0 -1
- data/lib/new_relic/version.rb +2 -3
- data/lib/newrelic_rpm.rb +0 -1
- data/lib/sequel/extensions/newrelic_instrumentation.rb +2 -3
- data/lib/sequel/plugins/newrelic_instrumentation.rb +0 -1
- data/lib/tasks/all.rb +0 -1
- data/lib/tasks/config.rake +4 -113
- data/lib/tasks/coverage_report.rake +14 -19
- data/lib/tasks/{config.html.erb → helpers/config.html.erb} +0 -0
- data/lib/tasks/{config.text.erb → helpers/config.text.erb} +0 -0
- data/lib/tasks/helpers/format.rb +120 -0
- data/lib/tasks/helpers/matches.rb +12 -0
- data/lib/tasks/helpers/prompt.rb +24 -0
- data/lib/tasks/helpers/removers.rb +33 -0
- data/lib/tasks/install.rake +0 -1
- data/lib/tasks/instrumentation_generator/README.md +1 -1
- data/lib/tasks/instrumentation_generator/instrumentation.thor +22 -16
- data/lib/tasks/instrumentation_generator/templates/Envfile.tt +0 -1
- data/lib/tasks/instrumentation_generator/templates/chain.tt +0 -1
- data/lib/tasks/instrumentation_generator/templates/dependency_detection.tt +0 -1
- data/lib/tasks/instrumentation_generator/templates/instrumentation.tt +0 -1
- data/lib/tasks/instrumentation_generator/templates/prepend.tt +0 -1
- data/lib/tasks/instrumentation_generator/templates/test.tt +0 -1
- data/lib/tasks/multiverse.rake +0 -1
- data/lib/tasks/multiverse.rb +3 -29
- data/lib/tasks/newrelic.rb +0 -1
- data/lib/tasks/tests.rake +3 -8
- data/newrelic.yml +10 -1
- data/newrelic_rpm.gemspec +6 -7
- data/recipes/newrelic.rb +0 -1
- data/test/agent_helper.rb +17 -35
- metadata +11 -5
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# This file is distributed under New Relic's license terms.
|
3
2
|
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
3
|
# frozen_string_literal: true
|
@@ -7,12 +6,15 @@ require 'new_relic/agent/null_logger'
|
|
7
6
|
require 'new_relic/agent/memory_logger'
|
8
7
|
require 'new_relic/agent/agent_logger'
|
9
8
|
|
9
|
+
require_relative 'private_instance_methods'
|
10
|
+
|
10
11
|
module NewRelic
|
11
12
|
class Control
|
12
13
|
# Contains methods that relate to the runtime usage of the control
|
13
14
|
# object. Note that these are subject to override in the
|
14
15
|
# NewRelic::Control::Framework classes that are actually instantiated
|
15
16
|
module InstanceMethods
|
17
|
+
include PrivateInstanceMethods
|
16
18
|
# The env is the setting used to identify which section of the newrelic.yml
|
17
19
|
# to load. This defaults to a framework specific value, such as ENV['RAILS_ENV']
|
18
20
|
# but can be overridden as long as you set it before calling #init_plugin
|
@@ -53,9 +55,7 @@ module NewRelic
|
|
53
55
|
configure_agent(env, options)
|
54
56
|
|
55
57
|
# Be sure to only create once! RUBY-1020
|
56
|
-
|
57
|
-
::NewRelic::Agent.logger = NewRelic::Agent::AgentLogger.new(root, options.delete(:log))
|
58
|
-
end
|
58
|
+
create_logger(options)
|
59
59
|
|
60
60
|
# Merge the stringified options into the config as overrides:
|
61
61
|
environment_name = options.delete(:env) and self.env = environment_name
|
@@ -68,17 +68,7 @@ module NewRelic
|
|
68
68
|
Module.send(:include, NewRelic::Agent::MethodTracer)
|
69
69
|
init_config(options)
|
70
70
|
NewRelic::Agent.agent = NewRelic::Agent::Agent.instance
|
71
|
-
|
72
|
-
if !security_settings_valid?
|
73
|
-
handle_invalid_security_settings
|
74
|
-
elsif Agent.config[:agent_enabled] && !NewRelic::Agent.instance.started?
|
75
|
-
start_agent
|
76
|
-
install_instrumentation
|
77
|
-
elsif !Agent.config[:agent_enabled]
|
78
|
-
install_shim
|
79
|
-
else
|
80
|
-
DependencyDetection.detect!
|
81
|
-
end
|
71
|
+
init_instrumentation
|
82
72
|
end
|
83
73
|
|
84
74
|
def determine_env(options)
|
@@ -86,11 +76,13 @@ module NewRelic
|
|
86
76
|
env = env.to_s
|
87
77
|
|
88
78
|
if @started_in_env && @started_in_env != env
|
89
|
-
Agent.logger.error("Attempted to start agent in #{env.inspect} environment, but agent was already running
|
90
|
-
"The agent will continue running in #{@started_in_env.inspect}. To
|
79
|
+
Agent.logger.error("Attempted to start agent in #{env.inspect} environment, but agent was already running " \
|
80
|
+
"in #{@started_in_env.inspect}", "The agent will continue running in #{@started_in_env.inspect}. To " \
|
81
|
+
"alter this, ensure the desired environment is set before the agent starts.")
|
91
82
|
else
|
92
|
-
Agent.logger.info("Starting the New Relic agent version #{NewRelic::VERSION::STRING} in #{env.inspect}
|
93
|
-
"To prevent agent startup add a NEW_RELIC_AGENT_ENABLED=false environment variable or
|
83
|
+
Agent.logger.info("Starting the New Relic agent version #{NewRelic::VERSION::STRING} in #{env.inspect} " \
|
84
|
+
"environment.", "To prevent agent startup add a NEW_RELIC_AGENT_ENABLED=false environment variable or " \
|
85
|
+
"modify the #{env.inspect} section of your newrelic.yml.")
|
94
86
|
end
|
95
87
|
|
96
88
|
env
|
@@ -99,33 +91,20 @@ module NewRelic
|
|
99
91
|
def configure_agent(env, options)
|
100
92
|
manual = Agent::Configuration::ManualSource.new(options)
|
101
93
|
Agent.config.replace_or_add_config(manual)
|
102
|
-
|
103
|
-
config_file_path = @config_file_override || Agent.config[:config_path]
|
104
94
|
yaml_source = Agent::Configuration::YamlSource.new(config_file_path, env)
|
105
|
-
if yaml_source.failed?
|
106
|
-
yaml_source.failures.each do |msg|
|
107
|
-
stdout.puts Agent::AgentLogger.format_fatal_error(msg)
|
108
|
-
end
|
109
|
-
end
|
95
|
+
log_yaml_source_failures(yaml_source) if yaml_source.failed?
|
110
96
|
Agent.config.replace_or_add_config(yaml_source)
|
111
|
-
|
112
|
-
if security_settings_valid? && Agent.config[:high_security]
|
113
|
-
Agent.logger.info("Installing high security configuration based on local configuration")
|
114
|
-
Agent.config.replace_or_add_config(Agent::Configuration::HighSecuritySource.new(Agent.config))
|
115
|
-
end
|
97
|
+
configure_high_security
|
116
98
|
end
|
117
99
|
|
118
100
|
def security_settings_valid?
|
119
|
-
!Agent.config[:high_security] ||
|
120
|
-
Agent.config[:security_policies_token].empty?
|
101
|
+
!Agent.config[:high_security] || Agent.config[:security_policies_token].empty?
|
121
102
|
end
|
122
103
|
|
123
104
|
def handle_invalid_security_settings
|
124
|
-
NewRelic::Agent.logger.error("Security Policies and High Security " \
|
125
|
-
"
|
126
|
-
"
|
127
|
-
"ensure the security_policies_token is set but high_security is " \
|
128
|
-
"disabled (default).")
|
105
|
+
NewRelic::Agent.logger.error("Security Policies and High Security Mode cannot both be present in the agent " \
|
106
|
+
"configuration. If Security Policies have been set for your account, please ensure the " \
|
107
|
+
"security_policies_token is set but high_security is disabled (default).")
|
129
108
|
install_shim
|
130
109
|
end
|
131
110
|
|
@@ -168,10 +147,8 @@ module NewRelic
|
|
168
147
|
@install_lock = Mutex.new
|
169
148
|
@local_env = local_env
|
170
149
|
@started_in_env = nil
|
171
|
-
|
172
150
|
@instrumented = nil
|
173
151
|
@instrumentation_files = []
|
174
|
-
|
175
152
|
@config_file_override = config_file_override
|
176
153
|
end
|
177
154
|
|
@@ -0,0 +1,48 @@
|
|
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 'new_relic/agent/memory_logger'
|
6
|
+
require 'new_relic/agent/agent_logger'
|
7
|
+
|
8
|
+
module NewRelic
|
9
|
+
class Control
|
10
|
+
module PrivateInstanceMethods
|
11
|
+
private
|
12
|
+
|
13
|
+
def configure_high_security
|
14
|
+
if security_settings_valid? && Agent.config[:high_security]
|
15
|
+
Agent.logger.info("Installing high security configuration based on local configuration")
|
16
|
+
Agent.config.replace_or_add_config(Agent::Configuration::HighSecuritySource.new(Agent.config))
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def log_yaml_source_failures(yaml_source)
|
21
|
+
yaml_source.failures.each { |msg| stdout.puts Agent::AgentLogger.format_fatal_error(msg) }
|
22
|
+
end
|
23
|
+
|
24
|
+
def config_file_path
|
25
|
+
@config_file_override || Agent.config[:config_path]
|
26
|
+
end
|
27
|
+
|
28
|
+
def create_logger(options)
|
29
|
+
if ::NewRelic::Agent.logger.is_startup_logger?
|
30
|
+
::NewRelic::Agent.logger = NewRelic::Agent::AgentLogger.new(root, options.delete(:log))
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def init_instrumentation
|
35
|
+
if !security_settings_valid?
|
36
|
+
handle_invalid_security_settings
|
37
|
+
elsif Agent.config[:agent_enabled] && !NewRelic::Agent.instance.started?
|
38
|
+
start_agent
|
39
|
+
install_instrumentation
|
40
|
+
elsif !Agent.config[:agent_enabled]
|
41
|
+
install_shim
|
42
|
+
else
|
43
|
+
DependencyDetection.detect!
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/lib/new_relic/control.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# This file is distributed under New Relic's license terms.
|
3
2
|
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
3
|
# frozen_string_literal: true
|
@@ -140,7 +139,7 @@ module DependencyDetection
|
|
140
139
|
end
|
141
140
|
|
142
141
|
def depends_on(&block)
|
143
|
-
@dependencies << block if
|
142
|
+
@dependencies << block if block
|
144
143
|
end
|
145
144
|
|
146
145
|
def allowed_by_config?
|
@@ -206,11 +205,11 @@ module DependencyDetection
|
|
206
205
|
end
|
207
206
|
|
208
207
|
def executes(&block)
|
209
|
-
@executes << block if
|
208
|
+
@executes << block if block
|
210
209
|
end
|
211
210
|
|
212
211
|
def conflicts_with_prepend(&block)
|
213
|
-
@prepend_conflicts << block if
|
212
|
+
@prepend_conflicts << block if block
|
214
213
|
end
|
215
214
|
|
216
215
|
def use_prepend?
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# This file is distributed under New Relic's license terms.
|
3
2
|
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
3
|
# frozen_string_literal: true
|
@@ -94,20 +93,9 @@ module NewRelic
|
|
94
93
|
@data = self.class.registered_reporters.inject(Hash.new) do |data, (key, logic)|
|
95
94
|
begin
|
96
95
|
value = logic.call
|
97
|
-
|
98
|
-
data[key] = value
|
99
|
-
|
100
|
-
Agent.record_metric("Supportability/EnvironmentReport/success", 0.0)
|
101
|
-
Agent.record_metric("Supportability/EnvironmentReport/success/#{key}", 0.0)
|
102
|
-
else
|
103
|
-
Agent.logger.debug("EnvironmentReport ignoring value for #{key.inspect} which came back falsey: #{value.inspect}")
|
104
|
-
Agent.record_metric("Supportability/EnvironmentReport/empty", 0.0)
|
105
|
-
Agent.record_metric("Supportability/EnvironmentReport/empty/#{key}", 0.0)
|
106
|
-
end
|
96
|
+
value ? record_value(data, key, value) : record_empty_value(key, value)
|
107
97
|
rescue => e
|
108
|
-
|
109
|
-
Agent.record_metric("Supportability/EnvironmentReport/error", 0.0)
|
110
|
-
Agent.record_metric("Supportability/EnvironmentReport/error/#{key}", 0.0)
|
98
|
+
rescue_initialize(key, e)
|
111
99
|
end
|
112
100
|
data
|
113
101
|
end
|
@@ -124,5 +112,26 @@ module NewRelic
|
|
124
112
|
def to_a
|
125
113
|
@data.to_a
|
126
114
|
end
|
115
|
+
|
116
|
+
private
|
117
|
+
|
118
|
+
def record_value(data, key, value)
|
119
|
+
data[key] = value
|
120
|
+
|
121
|
+
Agent.record_metric("Supportability/EnvironmentReport/success", 0.0)
|
122
|
+
Agent.record_metric("Supportability/EnvironmentReport/success/#{key}", 0.0)
|
123
|
+
end
|
124
|
+
|
125
|
+
def record_empty_value(key, value)
|
126
|
+
Agent.logger.debug("EnvironmentReport ignoring value for #{key.inspect} which came back falsey: #{value.inspect}")
|
127
|
+
Agent.record_metric("Supportability/EnvironmentReport/empty", 0.0)
|
128
|
+
Agent.record_metric("Supportability/EnvironmentReport/empty/#{key}", 0.0)
|
129
|
+
end
|
130
|
+
|
131
|
+
def rescue_initialize(key, exception)
|
132
|
+
Agent.logger.debug("EnvironmentReport failed to retrieve value for #{key.inspect}: #{exception}")
|
133
|
+
Agent.record_metric("Supportability/EnvironmentReport/error", 0.0)
|
134
|
+
Agent.record_metric("Supportability/EnvironmentReport/error/#{key}", 0.0)
|
135
|
+
end
|
127
136
|
end
|
128
137
|
end
|
data/lib/new_relic/helper.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# This file is distributed under New Relic's license terms.
|
3
2
|
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
3
|
# frozen_string_literal: true
|
@@ -66,7 +65,7 @@ module NewRelic
|
|
66
65
|
output.chomp
|
67
66
|
end
|
68
67
|
|
69
|
-
# TODO: Open3 defers the actual
|
68
|
+
# TODO: Open3 defers the actual execution of a binary to Process.spawn,
|
70
69
|
# which will raise an Errno::ENOENT exception for a file that
|
71
70
|
# cannot be found. We might want to take the time to evaluate
|
72
71
|
# relying on that Process.spawn behavior instead of checking for
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# This file is distributed under New Relic's license terms.
|
3
2
|
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
3
|
# frozen_string_literal: true
|
@@ -10,7 +9,7 @@ module NewRelic
|
|
10
9
|
@@forkable = nil
|
11
10
|
def can_fork?
|
12
11
|
# this is expensive to check, so we should only check once
|
13
|
-
return @@forkable if
|
12
|
+
return @@forkable if !@@forkable.nil?
|
14
13
|
@@forkable = Process.respond_to?(:fork)
|
15
14
|
end
|
16
15
|
|
@@ -57,7 +56,7 @@ module NewRelic
|
|
57
56
|
begin
|
58
57
|
result = namespace.const_get(name)
|
59
58
|
|
60
|
-
# const_get looks up the
|
59
|
+
# const_get looks up the inheritance chain, so if it's a class
|
61
60
|
# in the constant make sure we found the one in our namespace.
|
62
61
|
#
|
63
62
|
# Can't help if the constant isn't a class...
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# This file is distributed under New Relic's license terms.
|
3
2
|
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
3
|
# frozen_string_literal: true
|
@@ -31,8 +30,8 @@ EOS
|
|
31
30
|
|
32
31
|
current_item = nil
|
33
32
|
latest.each do |line|
|
34
|
-
if line
|
35
|
-
if line
|
33
|
+
if line =~ /^\s*\*.*/
|
34
|
+
if line =~ /\(#{patch_level}\)/
|
36
35
|
# Found a patch level item, so start tracking the lines!
|
37
36
|
current_item = line
|
38
37
|
else
|
@@ -53,7 +52,7 @@ EOS
|
|
53
52
|
changes = []
|
54
53
|
version_count = 0
|
55
54
|
contents.each_line do |line|
|
56
|
-
if line
|
55
|
+
if line =~ /##\s+v[\d.]+/
|
57
56
|
version_count += 1
|
58
57
|
end
|
59
58
|
break if version_count >= 2
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# This file is distributed under New Relic's license terms.
|
3
2
|
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
3
|
# frozen_string_literal: true
|
@@ -35,8 +34,8 @@ module NewRelic
|
|
35
34
|
end
|
36
35
|
|
37
36
|
def initialize
|
38
|
-
# Extend self with any
|
39
|
-
# the discover methods to discover new
|
37
|
+
# Extend self with any submodules of LocalEnvironment. These can override
|
38
|
+
# the discover methods to discover new frameworks and dispatchers.
|
40
39
|
NewRelic::LocalEnvironment.constants.each do |const|
|
41
40
|
mod = NewRelic::LocalEnvironment.const_get(const)
|
42
41
|
self.extend(mod) if mod.instance_of?(Module)
|
@@ -183,7 +182,7 @@ module NewRelic
|
|
183
182
|
end
|
184
183
|
|
185
184
|
def check_for_litespeed
|
186
|
-
if caller.pop
|
185
|
+
if caller.pop.include?('fcgi-bin/RailsRunner.rb')
|
187
186
|
@discovered_dispatcher = :litespeed
|
188
187
|
end
|
189
188
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# This file is distributed under New Relic's license terms.
|
3
2
|
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
3
|
# frozen_string_literal: true
|
@@ -9,9 +8,11 @@ module NewRelic
|
|
9
8
|
class MetricData
|
10
9
|
# a NewRelic::MetricSpec object
|
11
10
|
attr_reader :metric_spec
|
12
|
-
#
|
11
|
+
# a NewRelic::Agent::Stats object
|
13
12
|
attr_accessor :stats
|
14
13
|
|
14
|
+
include NewRelic::Coerce
|
15
|
+
|
15
16
|
def initialize(metric_spec, stats)
|
16
17
|
@original_spec = nil
|
17
18
|
@metric_spec = metric_spec
|
@@ -22,8 +23,12 @@ module NewRelic
|
|
22
23
|
(metric_spec.eql?(o.metric_spec)) && (stats.eql?(o.stats))
|
23
24
|
end
|
24
25
|
|
25
|
-
def
|
26
|
-
|
26
|
+
def hash
|
27
|
+
[metric_spec, stats].hash
|
28
|
+
end
|
29
|
+
|
30
|
+
def inspect
|
31
|
+
"#<MetricData metric_spec:#{metric_spec.inspect}, stats:#{stats.inspect}>"
|
27
32
|
end
|
28
33
|
|
29
34
|
# assigns a new metric spec, and retains the old metric spec as
|
@@ -33,8 +38,13 @@ module NewRelic
|
|
33
38
|
@metric_spec = new_spec
|
34
39
|
end
|
35
40
|
|
36
|
-
def
|
37
|
-
|
41
|
+
def original_spec
|
42
|
+
@original_spec || @metric_spec
|
43
|
+
end
|
44
|
+
|
45
|
+
def to_collector_array(encoder = nil)
|
46
|
+
stat_key = {'name' => metric_spec.name, 'scope' => metric_spec.scope}
|
47
|
+
[stat_key, stats_collector_array(stat_key)]
|
38
48
|
end
|
39
49
|
|
40
50
|
def to_json(*a)
|
@@ -45,23 +55,18 @@ module NewRelic
|
|
45
55
|
"#{metric_spec.name}(#{metric_spec.scope}): #{stats}"
|
46
56
|
end
|
47
57
|
|
48
|
-
|
49
|
-
"#<MetricData metric_spec:#{metric_spec.inspect}, stats:#{stats.inspect}>"
|
50
|
-
end
|
51
|
-
|
52
|
-
include NewRelic::Coerce
|
58
|
+
private
|
53
59
|
|
54
|
-
def
|
55
|
-
|
56
|
-
|
57
|
-
[
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
float(stats.
|
62
|
-
|
63
|
-
|
64
|
-
]]
|
60
|
+
def stats_collector_array(stat_key)
|
61
|
+
[[:call_count, Integer], [:total_call_time, Float],
|
62
|
+
[:total_exclusive_time, Float], [:min_call_time, Float],
|
63
|
+
[:max_call_time, Float], [:sum_of_squares, Float]].map do |attr_types|
|
64
|
+
if attr_types[1].eql?(Integer)
|
65
|
+
int(stats.send(attr_types[0]), stat_key)
|
66
|
+
elsif attr_types[1].eql?(Float)
|
67
|
+
float(stats.send(attr_types[0]), stat_key)
|
68
|
+
end
|
69
|
+
end
|
65
70
|
end
|
66
71
|
end
|
67
72
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# This file is distributed under New Relic's license terms.
|
3
2
|
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
3
|
# frozen_string_literal: true
|
@@ -135,10 +134,8 @@ class NewRelic::NoticedError
|
|
135
134
|
|
136
135
|
def build_error_attributes
|
137
136
|
@attributes_from_notice_error ||= {}
|
138
|
-
@attributes_from_notice_error
|
139
|
-
|
140
|
-
ERROR_CLASS_KEY => string(exception_class_name)
|
141
|
-
})
|
137
|
+
@attributes_from_notice_error[ERROR_MESSAGE_KEY] = string(message)
|
138
|
+
@attributes_from_notice_error[ERROR_CLASS_KEY] = string(exception_class_name)
|
142
139
|
|
143
140
|
@attributes_from_notice_error[ERROR_EXPECTED_KEY] = true if expected
|
144
141
|
end
|
@@ -189,7 +186,7 @@ class NewRelic::NoticedError
|
|
189
186
|
if exception.nil?
|
190
187
|
@exception_class_name = UNKNOWN_ERROR_CLASS_NAME
|
191
188
|
@message = NIL_ERROR_MESSAGE
|
192
|
-
elsif exception.is_a?(NewRelic::Agent::
|
189
|
+
elsif exception.is_a?(NewRelic::Agent::NoticeableError)
|
193
190
|
@exception_class_name = exception.class_name
|
194
191
|
@message = exception.message
|
195
192
|
else
|