newrelic_rpm 7.0.0 → 8.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/.rubocop.yml +1941 -0
- data/.yardopts +1 -0
- data/Brewfile +10 -0
- data/CHANGELOG.md +431 -1
- data/CONTRIBUTING.md +32 -5
- data/DOCKER.md +167 -0
- data/Dockerfile +10 -0
- data/Guardfile +8 -8
- data/LICENSE +0 -6
- data/README.md +20 -18
- data/Rakefile +39 -29
- data/THIRD_PARTY_NOTICES.md +14 -199
- data/bin/mongrel_rpm +8 -9
- data/bin/newrelic +1 -1
- data/bin/nrdebug +14 -14
- data/docker-compose.yml +85 -0
- data/init.rb +0 -2
- data/lefthook.yml +9 -0
- data/lib/new_relic/agent/adaptive_sampler.rb +9 -5
- data/lib/new_relic/agent/agent.rb +72 -49
- data/lib/new_relic/agent/agent_logger.rb +15 -9
- data/lib/new_relic/agent/attribute_filter.rb +31 -31
- data/lib/new_relic/agent/attributes.rb +2 -2
- data/lib/new_relic/agent/audit_logger.rb +4 -0
- data/lib/new_relic/agent/autostart.rb +19 -17
- data/lib/new_relic/agent/commands/agent_command.rb +2 -2
- data/lib/new_relic/agent/commands/agent_command_router.rb +6 -5
- data/lib/new_relic/agent/commands/thread_profiler_session.rb +7 -6
- data/lib/new_relic/agent/configuration/default_source.rb +731 -476
- data/lib/new_relic/agent/configuration/dotted_hash.rb +3 -3
- data/lib/new_relic/agent/configuration/environment_source.rb +5 -4
- data/lib/new_relic/agent/configuration/event_harvest_config.rb +39 -16
- data/lib/new_relic/agent/configuration/high_security_source.rb +7 -7
- data/lib/new_relic/agent/configuration/manager.rb +74 -64
- data/lib/new_relic/agent/configuration/mask_defaults.rb +1 -1
- data/lib/new_relic/agent/configuration/security_policy_source.rb +73 -73
- data/lib/new_relic/agent/configuration/server_source.rb +14 -12
- data/lib/new_relic/agent/configuration/yaml_source.rb +26 -5
- data/lib/new_relic/agent/connect/request_builder.rb +14 -15
- data/lib/new_relic/agent/connect/response_handler.rb +0 -3
- data/lib/new_relic/agent/custom_event_aggregator.rb +9 -9
- data/lib/new_relic/agent/database/explain_plan_helpers.rb +3 -4
- data/lib/new_relic/agent/database/obfuscation_helpers.rb +12 -12
- data/lib/new_relic/agent/database/postgres_explain_obfuscator.rb +2 -2
- data/lib/new_relic/agent/database.rb +30 -31
- data/lib/new_relic/agent/datastores/metric_helper.rb +13 -11
- data/lib/new_relic/agent/datastores/mongo/event_formatter.rb +2 -3
- data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +3 -5
- data/lib/new_relic/agent/datastores/mongo/obfuscator.rb +1 -2
- data/lib/new_relic/agent/datastores/mongo.rb +5 -10
- data/lib/new_relic/agent/datastores/redis.rb +2 -4
- data/lib/new_relic/agent/datastores.rb +7 -9
- data/lib/new_relic/agent/distributed_tracing/cross_app_payload.rb +9 -9
- data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +21 -16
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +10 -12
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +42 -43
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb +3 -3
- data/lib/new_relic/agent/distributed_tracing/trace_context.rb +41 -43
- data/lib/new_relic/agent/distributed_tracing/trace_context_payload.rb +25 -25
- data/lib/new_relic/agent/distributed_tracing.rb +17 -18
- data/lib/new_relic/agent/encoding_normalizer.rb +1 -1
- data/lib/new_relic/agent/error_collector.rb +65 -50
- data/lib/new_relic/agent/error_event_aggregator.rb +1 -1
- data/lib/new_relic/agent/error_filter.rb +173 -0
- data/lib/new_relic/agent/error_trace_aggregator.rb +1 -1
- data/lib/new_relic/agent/event_aggregator.rb +1 -1
- data/lib/new_relic/agent/event_buffer.rb +6 -7
- data/lib/new_relic/agent/event_listener.rb +0 -1
- data/lib/new_relic/agent/event_loop.rb +14 -14
- data/lib/new_relic/agent/external.rb +1 -34
- data/lib/new_relic/agent/guid_generator.rb +2 -9
- data/lib/new_relic/agent/harvester.rb +3 -4
- data/lib/new_relic/agent/heap.rb +1 -3
- data/lib/new_relic/agent/hostname.rb +16 -10
- data/lib/new_relic/agent/http_clients/abstract.rb +7 -9
- data/lib/new_relic/agent/http_clients/curb_wrappers.rb +1 -5
- data/lib/new_relic/agent/http_clients/excon_wrappers.rb +4 -4
- data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +3 -3
- data/lib/new_relic/agent/http_clients/httpclient_wrappers.rb +1 -2
- data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +8 -3
- data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +2 -3
- data/lib/new_relic/agent/http_clients/uri_util.rb +0 -1
- data/lib/new_relic/agent/instrumentation/action_cable_subscriber.rb +2 -3
- data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +28 -26
- data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +5 -7
- data/lib/new_relic/agent/instrumentation/active_job.rb +12 -5
- data/lib/new_relic/agent/instrumentation/active_merchant.rb +17 -3
- data/lib/new_relic/agent/instrumentation/active_record.rb +20 -18
- data/lib/new_relic/agent/instrumentation/active_record_helper.rb +56 -46
- data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +28 -25
- data/lib/new_relic/agent/instrumentation/active_record_prepend.rb +3 -3
- data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +22 -16
- data/lib/new_relic/agent/instrumentation/active_storage.rb +1 -1
- data/lib/new_relic/agent/instrumentation/active_support_logger/chain.rb +23 -0
- data/lib/new_relic/agent/instrumentation/active_support_logger/instrumentation.rb +20 -0
- data/lib/new_relic/agent/instrumentation/active_support_logger/prepend.rb +12 -0
- data/lib/new_relic/agent/instrumentation/active_support_logger.rb +24 -0
- data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +18 -9
- data/lib/new_relic/agent/instrumentation/authlogic.rb +10 -0
- data/lib/new_relic/agent/instrumentation/bunny/chain.rb +1 -1
- data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +8 -9
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +52 -46
- data/lib/new_relic/agent/instrumentation/curb/chain.rb +20 -21
- data/lib/new_relic/agent/instrumentation/curb/instrumentation.rb +34 -38
- data/lib/new_relic/agent/instrumentation/curb/prepend.rb +10 -11
- data/lib/new_relic/agent/instrumentation/data_mapper.rb +22 -10
- data/lib/new_relic/agent/instrumentation/delayed_job/chain.rb +5 -7
- data/lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb +5 -9
- data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +23 -4
- data/lib/new_relic/agent/instrumentation/excon/middleware.rb +2 -2
- data/lib/new_relic/agent/instrumentation/excon.rb +3 -23
- data/lib/new_relic/agent/instrumentation/grape/chain.rb +1 -2
- data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +6 -7
- data/lib/new_relic/agent/instrumentation/grape.rb +2 -3
- data/lib/new_relic/agent/instrumentation/httpclient/chain.rb +2 -3
- data/lib/new_relic/agent/instrumentation/httpclient/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/httpclient/prepend.rb +0 -2
- data/lib/new_relic/agent/instrumentation/httprb/chain.rb +2 -2
- data/lib/new_relic/agent/instrumentation/httprb/instrumentation.rb +6 -6
- data/lib/new_relic/agent/instrumentation/httprb/prepend.rb +1 -1
- data/lib/new_relic/agent/instrumentation/ignore_actions.rb +2 -3
- data/lib/new_relic/agent/instrumentation/logger/chain.rb +21 -0
- data/lib/new_relic/agent/instrumentation/logger/instrumentation.rb +58 -0
- data/lib/new_relic/agent/instrumentation/logger/prepend.rb +13 -0
- data/lib/new_relic/agent/instrumentation/logger.rb +26 -0
- data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +7 -2
- data/lib/new_relic/agent/instrumentation/memcache/helper.rb +5 -1
- data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +9 -2
- data/lib/new_relic/agent/instrumentation/middleware_proxy.rb +9 -10
- data/lib/new_relic/agent/instrumentation/middleware_tracing.rb +5 -6
- data/lib/new_relic/agent/instrumentation/mongo.rb +3 -141
- data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +4 -4
- data/lib/new_relic/agent/instrumentation/net_http/chain.rb +3 -4
- data/lib/new_relic/agent/instrumentation/net_http/instrumentation.rb +5 -5
- data/lib/new_relic/agent/instrumentation/net_http/prepend.rb +4 -4
- data/lib/new_relic/agent/instrumentation/net_http.rb +7 -2
- data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +2 -3
- data/lib/new_relic/agent/instrumentation/padrino/chain.rb +23 -19
- data/lib/new_relic/agent/instrumentation/padrino/instrumentation.rb +3 -2
- data/lib/new_relic/agent/instrumentation/padrino/prepend.rb +2 -2
- data/lib/new_relic/agent/instrumentation/padrino.rb +2 -5
- data/lib/new_relic/agent/instrumentation/queue_time.rb +8 -8
- data/lib/new_relic/agent/instrumentation/rack/chain.rb +8 -7
- data/lib/new_relic/agent/instrumentation/rack/helpers.rb +2 -1
- data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +4 -5
- data/lib/new_relic/agent/instrumentation/rack/prepend.rb +2 -2
- data/lib/new_relic/agent/instrumentation/rack.rb +1 -1
- data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +11 -47
- data/lib/new_relic/agent/instrumentation/rails_notifications/action_cable.rb +2 -2
- data/lib/new_relic/agent/instrumentation/rails_notifications/action_controller.rb +0 -1
- data/lib/new_relic/agent/instrumentation/rainbows_instrumentation.rb +11 -0
- data/lib/new_relic/agent/instrumentation/rake/chain.rb +0 -5
- data/lib/new_relic/agent/instrumentation/rake/instrumentation.rb +6 -6
- data/lib/new_relic/agent/instrumentation/rake.rb +1 -1
- data/lib/new_relic/agent/instrumentation/redis/chain.rb +6 -6
- data/lib/new_relic/agent/instrumentation/redis/instrumentation.rb +2 -2
- data/lib/new_relic/agent/instrumentation/redis/prepend.rb +1 -1
- data/lib/new_relic/agent/instrumentation/redis.rb +5 -1
- data/lib/new_relic/agent/instrumentation/resque/chain.rb +2 -3
- data/lib/new_relic/agent/instrumentation/resque/helper.rb +19 -0
- data/lib/new_relic/agent/instrumentation/resque/instrumentation.rb +9 -7
- data/lib/new_relic/agent/instrumentation/resque/prepend.rb +1 -2
- data/lib/new_relic/agent/instrumentation/resque.rb +17 -8
- data/lib/new_relic/agent/instrumentation/sequel.rb +7 -9
- data/lib/new_relic/agent/instrumentation/sequel_helper.rb +1 -1
- data/lib/new_relic/agent/instrumentation/sidekiq.rb +22 -1
- data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +0 -1
- data/lib/new_relic/agent/instrumentation/sinatra/instrumentation.rb +12 -5
- data/lib/new_relic/agent/instrumentation/sinatra.rb +21 -11
- data/lib/new_relic/agent/instrumentation/sunspot.rb +11 -1
- data/lib/new_relic/agent/instrumentation/thread/chain.rb +24 -0
- data/lib/new_relic/agent/instrumentation/thread/instrumentation.rb +27 -0
- data/lib/new_relic/agent/instrumentation/thread/prepend.rb +22 -0
- data/lib/new_relic/agent/instrumentation/thread.rb +20 -0
- data/lib/new_relic/agent/instrumentation/tilt/chain.rb +24 -0
- data/lib/new_relic/agent/instrumentation/tilt/instrumentation.rb +40 -0
- data/lib/new_relic/agent/instrumentation/tilt/prepend.rb +13 -0
- data/lib/new_relic/agent/instrumentation/tilt.rb +25 -0
- data/lib/new_relic/agent/instrumentation/typhoeus/chain.rb +4 -4
- data/lib/new_relic/agent/instrumentation/typhoeus/instrumentation.rb +3 -5
- data/lib/new_relic/agent/instrumentation/typhoeus/prepend.rb +1 -1
- data/lib/new_relic/agent/internal_agent_error.rb +1 -1
- data/lib/new_relic/agent/javascript_instrumentor.rb +38 -33
- data/lib/new_relic/agent/linking_metadata.rb +45 -0
- data/lib/new_relic/agent/local_log_decorator.rb +37 -0
- data/lib/new_relic/agent/log_event_aggregator.rb +234 -0
- data/lib/new_relic/agent/log_priority.rb +20 -0
- data/lib/new_relic/agent/logging.rb +11 -8
- data/lib/new_relic/agent/memory_logger.rb +1 -1
- data/lib/new_relic/agent/messaging.rb +46 -62
- data/lib/new_relic/agent/method_tracer.rb +145 -144
- data/lib/new_relic/agent/method_tracer_helpers.rb +82 -2
- data/lib/new_relic/agent/monitors/cross_app_monitor.rb +21 -13
- data/lib/new_relic/agent/monitors/distributed_tracing_monitor.rb +2 -2
- data/lib/new_relic/agent/monitors/inbound_request_monitor.rb +0 -1
- data/lib/new_relic/agent/monitors/synthetics_monitor.rb +4 -7
- data/lib/new_relic/agent/monitors.rb +1 -2
- data/lib/new_relic/agent/new_relic_service/encoders.rb +4 -4
- data/lib/new_relic/agent/new_relic_service/json_marshaller.rb +1 -1
- data/lib/new_relic/agent/new_relic_service/marshaller.rb +1 -1
- data/lib/new_relic/agent/new_relic_service/security_policy_settings.rb +4 -3
- data/lib/new_relic/agent/new_relic_service.rb +61 -53
- data/lib/new_relic/agent/noticible_error.rb +0 -2
- data/lib/new_relic/agent/null_logger.rb +6 -2
- data/lib/new_relic/agent/obfuscator.rb +6 -8
- data/lib/new_relic/agent/parameter_filtering.rb +16 -8
- data/lib/new_relic/agent/payload_metric_mapping.rb +8 -9
- data/lib/new_relic/agent/pipe_channel_manager.rb +15 -12
- data/lib/new_relic/agent/pipe_service.rb +6 -3
- data/lib/new_relic/agent/priority_sampled_buffer.rb +4 -7
- data/lib/new_relic/agent/rules_engine/replacement_rule.rb +9 -9
- data/lib/new_relic/agent/rules_engine/segment_terms_rule.rb +12 -12
- data/lib/new_relic/agent/rules_engine.rb +2 -2
- data/lib/new_relic/agent/sampler.rb +2 -3
- data/lib/new_relic/agent/sampler_collection.rb +2 -3
- data/lib/new_relic/agent/samplers/cpu_sampler.rb +1 -1
- data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +10 -7
- data/lib/new_relic/agent/samplers/memory_sampler.rb +9 -3
- data/lib/new_relic/agent/samplers/vm_sampler.rb +18 -18
- data/lib/new_relic/agent/span_event_aggregator.rb +10 -10
- data/lib/new_relic/agent/span_event_primitive.rb +48 -45
- data/lib/new_relic/agent/sql_sampler.rb +9 -9
- data/lib/new_relic/agent/stats.rb +62 -37
- data/lib/new_relic/agent/stats_engine/gc_profiler.rb +7 -9
- data/lib/new_relic/agent/stats_engine/stats_hash.rb +8 -9
- data/lib/new_relic/agent/stats_engine.rb +7 -7
- data/lib/new_relic/agent/synthetics_event_aggregator.rb +1 -2
- data/lib/new_relic/agent/system_info.rb +22 -20
- data/lib/new_relic/agent/threading/agent_thread.rb +4 -5
- data/lib/new_relic/agent/threading/backtrace_node.rb +6 -9
- data/lib/new_relic/agent/threading/backtrace_service.rb +12 -13
- data/lib/new_relic/agent/threading/thread_profile.rb +16 -19
- data/lib/new_relic/agent/tracer.rb +57 -72
- data/lib/new_relic/agent/transaction/abstract_segment.rb +38 -10
- data/lib/new_relic/agent/transaction/datastore_segment.rb +7 -6
- data/lib/new_relic/agent/transaction/distributed_tracer.rb +8 -9
- data/lib/new_relic/agent/transaction/distributed_tracing.rb +21 -22
- data/lib/new_relic/agent/transaction/external_request_segment.rb +6 -5
- data/lib/new_relic/agent/transaction/message_broker_segment.rb +24 -30
- data/lib/new_relic/agent/transaction/request_attributes.rb +7 -7
- data/lib/new_relic/agent/transaction/segment.rb +6 -3
- data/lib/new_relic/agent/transaction/slowest_sample_buffer.rb +0 -2
- data/lib/new_relic/agent/transaction/trace.rb +8 -8
- data/lib/new_relic/agent/transaction/trace_context.rb +14 -16
- data/lib/new_relic/agent/transaction/trace_node.rb +16 -16
- data/lib/new_relic/agent/transaction/tracing.rb +9 -6
- data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +1 -2
- data/lib/new_relic/agent/transaction.rb +132 -119
- data/lib/new_relic/agent/transaction_error_primitive.rb +18 -16
- data/lib/new_relic/agent/transaction_event_aggregator.rb +7 -8
- data/lib/new_relic/agent/transaction_event_primitive.rb +29 -29
- data/lib/new_relic/agent/transaction_event_recorder.rb +1 -1
- data/lib/new_relic/agent/transaction_metrics.rb +8 -7
- data/lib/new_relic/agent/transaction_sampler.rb +0 -1
- data/lib/new_relic/agent/transaction_time_aggregator.rb +11 -11
- data/lib/new_relic/agent/utilization/aws.rb +32 -2
- data/lib/new_relic/agent/utilization/azure.rb +1 -1
- data/lib/new_relic/agent/utilization/vendor.rb +15 -2
- data/lib/new_relic/agent/utilization_data.rb +3 -4
- data/lib/new_relic/agent/vm/monotonic_gc_profiler.rb +1 -1
- data/lib/new_relic/agent/vm/mri_vm.rb +13 -1
- data/lib/new_relic/agent/vm/snapshot.rb +4 -4
- data/lib/new_relic/agent/worker_loop.rb +8 -10
- data/lib/new_relic/agent.rb +36 -41
- data/lib/new_relic/cli/command.rb +15 -17
- data/lib/new_relic/cli/commands/deployments.rb +21 -23
- data/lib/new_relic/cli/commands/install.rb +6 -10
- data/lib/new_relic/coerce.rb +5 -8
- data/lib/new_relic/collection_helper.rb +48 -47
- data/lib/new_relic/constants.rb +0 -4
- data/lib/new_relic/control/class_methods.rb +2 -2
- data/lib/new_relic/control/frameworks/external.rb +1 -1
- data/lib/new_relic/control/frameworks/rails.rb +5 -6
- data/lib/new_relic/control/frameworks/rails3.rb +2 -3
- data/lib/new_relic/control/frameworks/ruby.rb +2 -2
- data/lib/new_relic/control/frameworks/sinatra.rb +6 -0
- data/lib/new_relic/control/instance_methods.rb +4 -5
- data/lib/new_relic/control/instrumentation.rb +35 -5
- data/lib/new_relic/control/server_methods.rb +2 -3
- data/lib/new_relic/control.rb +0 -1
- data/lib/new_relic/dependency_detection.rb +7 -9
- data/lib/new_relic/environment_report.rb +16 -18
- data/lib/new_relic/helper.rb +45 -5
- data/lib/new_relic/language_support.rb +20 -2
- data/lib/new_relic/latest_changes.rb +2 -2
- data/lib/new_relic/local_environment.rb +9 -7
- data/lib/new_relic/metric_data.rb +6 -7
- data/lib/new_relic/metric_spec.rb +3 -3
- data/lib/new_relic/noticed_error.rb +18 -19
- data/lib/new_relic/rack/agent_middleware.rb +2 -2
- data/lib/new_relic/rack/browser_monitoring.rb +9 -9
- data/lib/new_relic/recipes/capistrano3.rb +11 -13
- data/lib/new_relic/recipes/capistrano_legacy.rb +11 -14
- data/lib/new_relic/supportability_helper.rb +2 -2
- data/lib/new_relic/traced_thread.rb +35 -0
- data/lib/new_relic/version.rb +5 -16
- data/lib/newrelic_rpm.rb +10 -34
- data/lib/sequel/extensions/newrelic_instrumentation.rb +4 -7
- data/lib/sequel/plugins/newrelic_instrumentation.rb +3 -9
- data/lib/tasks/all.rb +2 -2
- data/lib/tasks/config.html.erb +14 -25
- data/lib/tasks/config.rake +36 -27
- data/lib/tasks/multiverse.rb +4 -6
- data/lib/tasks/tests.rake +3 -7
- data/newrelic.yml +610 -3
- data/newrelic_rpm.gemspec +14 -14
- data/recipes/newrelic.rb +1 -1
- data/test/agent_helper.rb +98 -59
- metadata +69 -20
- data/ROADMAP.md +0 -24
- data/lib/new_relic/agent/datastores/mongo/statement_formatter.rb +0 -53
- data/lib/new_relic/agent/instrumentation/excon/connection.rb +0 -49
- data/lib/new_relic/agent/instrumentation/merb/controller.rb +0 -44
- data/lib/new_relic/agent/instrumentation/merb/errors.rb +0 -33
- data/lib/new_relic/agent/instrumentation/rails/action_controller.rb +0 -125
- data/lib/new_relic/agent/instrumentation/rails/action_web_service.rb +0 -46
- data/lib/new_relic/agent/supported_versions.rb +0 -275
- data/lib/new_relic/control/frameworks/merb.rb +0 -29
@@ -22,7 +22,6 @@ module NewRelic
|
|
22
22
|
# @api public
|
23
23
|
#
|
24
24
|
module ControllerInstrumentation
|
25
|
-
|
26
25
|
def self.included(clazz) # :nodoc:
|
27
26
|
clazz.extend(ClassMethods)
|
28
27
|
end
|
@@ -30,7 +29,9 @@ module NewRelic
|
|
30
29
|
# This module is for importing stubs when the agent is disabled
|
31
30
|
module ClassMethodsShim # :nodoc:
|
32
31
|
def newrelic_ignore(*args); end
|
32
|
+
|
33
33
|
def newrelic_ignore_apdex(*args); end
|
34
|
+
|
34
35
|
def newrelic_ignore_enduser(*args); end
|
35
36
|
end
|
36
37
|
|
@@ -38,14 +39,16 @@ module NewRelic
|
|
38
39
|
def self.included(clazz)
|
39
40
|
clazz.extend(ClassMethodsShim)
|
40
41
|
end
|
42
|
+
|
41
43
|
def new_relic_trace_controller_action(*args); yield; end
|
44
|
+
|
42
45
|
def perform_action_with_newrelic_trace(*args); yield; end
|
43
46
|
end
|
44
47
|
|
45
|
-
NR_DO_NOT_TRACE_KEY
|
46
|
-
NR_IGNORE_APDEX_KEY
|
48
|
+
NR_DO_NOT_TRACE_KEY = :'@do_not_trace'
|
49
|
+
NR_IGNORE_APDEX_KEY = :'@ignore_apdex'
|
47
50
|
NR_IGNORE_ENDUSER_KEY = :'@ignore_enduser'
|
48
|
-
NR_DEFAULT_OPTIONS
|
51
|
+
NR_DEFAULT_OPTIONS = {}.freeze
|
49
52
|
|
50
53
|
# @api public
|
51
54
|
module ClassMethods
|
@@ -54,31 +57,32 @@ module NewRelic
|
|
54
57
|
#
|
55
58
|
# @api public
|
56
59
|
#
|
57
|
-
def newrelic_ignore(specifiers={})
|
60
|
+
def newrelic_ignore(specifiers = {})
|
58
61
|
NewRelic::Agent.record_api_supportability_metric(:newrelic_ignore)
|
59
62
|
newrelic_ignore_aspect(NR_DO_NOT_TRACE_KEY, specifiers)
|
60
63
|
end
|
64
|
+
|
61
65
|
# Have NewRelic omit apdex measurements on the given actions. Typically used for
|
62
66
|
# actions that are not user facing or that skew your overall apdex measurement.
|
63
67
|
# Accepts :except and :only options, as with #newrelic_ignore.
|
64
68
|
#
|
65
69
|
# @api public
|
66
70
|
#
|
67
|
-
def newrelic_ignore_apdex(specifiers={})
|
71
|
+
def newrelic_ignore_apdex(specifiers = {})
|
68
72
|
NewRelic::Agent.record_api_supportability_metric(:newrelic_ignore_apdex)
|
69
73
|
newrelic_ignore_aspect(NR_IGNORE_APDEX_KEY, specifiers)
|
70
74
|
end
|
71
75
|
|
72
76
|
# @api public
|
73
|
-
def newrelic_ignore_enduser(specifiers={})
|
77
|
+
def newrelic_ignore_enduser(specifiers = {})
|
74
78
|
NewRelic::Agent.record_api_supportability_metric(:newrelic_ignore_enduser)
|
75
79
|
newrelic_ignore_aspect(NR_IGNORE_ENDUSER_KEY, specifiers)
|
76
80
|
end
|
77
81
|
|
78
|
-
def newrelic_ignore_aspect(property, specifiers={}) # :nodoc:
|
82
|
+
def newrelic_ignore_aspect(property, specifiers = {}) # :nodoc:
|
79
83
|
if specifiers.empty?
|
80
84
|
self.newrelic_write_attr property, true
|
81
|
-
elsif !
|
85
|
+
elsif !(Hash === specifiers)
|
82
86
|
::NewRelic::Agent.logger.error "newrelic_#{property} takes an optional hash with :only and :except lists of actions (illegal argument type '#{specifiers.class}')"
|
83
87
|
else
|
84
88
|
# symbolize the incoming values
|
@@ -158,13 +162,9 @@ module NewRelic
|
|
158
162
|
#
|
159
163
|
# @api public
|
160
164
|
#
|
161
|
-
def add_transaction_tracer(method, options={})
|
165
|
+
def add_transaction_tracer(method, options = {})
|
162
166
|
NewRelic::Agent.record_api_supportability_metric(:add_transaction_tracer)
|
163
167
|
|
164
|
-
# The metric path:
|
165
|
-
options[:name] ||= method.to_s
|
166
|
-
|
167
|
-
argument_list = generate_argument_list(options)
|
168
168
|
traced_method, punctuation = parse_punctuation(method)
|
169
169
|
with_method_name, without_method_name = build_method_names(traced_method, punctuation)
|
170
170
|
|
@@ -173,12 +173,19 @@ module NewRelic
|
|
173
173
|
return
|
174
174
|
end
|
175
175
|
|
176
|
+
# The metric path:
|
177
|
+
options[:name] ||= method.to_s
|
178
|
+
|
179
|
+
code_info = NewRelic::Agent::MethodTracerHelpers.code_information(self, method)
|
180
|
+
argument_list = generate_argument_list(options.merge(code_info))
|
181
|
+
|
176
182
|
class_eval <<-EOC
|
177
183
|
def #{with_method_name}(*args, &block)
|
178
184
|
perform_action_with_newrelic_trace(#{argument_list.join(',')}) do
|
179
185
|
#{without_method_name}(*args, &block)
|
180
186
|
end
|
181
187
|
end
|
188
|
+
ruby2_keywords(:#{with_method_name}) if respond_to?(:ruby2_keywords, true)
|
182
189
|
EOC
|
183
190
|
|
184
191
|
visibility = NewRelic::Helper.instance_method_visibility self, method
|
@@ -201,54 +208,50 @@ module NewRelic
|
|
201
208
|
elsif key == :params
|
202
209
|
value.to_s
|
203
210
|
else
|
204
|
-
%Q
|
211
|
+
%Q("#{value.to_s}")
|
205
212
|
end
|
206
213
|
|
207
|
-
%Q
|
214
|
+
%Q(:#{key} => #{value})
|
208
215
|
end
|
209
216
|
end
|
210
217
|
|
211
218
|
def build_method_names(traced_method, punctuation)
|
212
|
-
[
|
213
|
-
"#{traced_method.to_s}_without_newrelic_transaction_trace#{punctuation}"
|
219
|
+
["#{traced_method.to_s}_with_newrelic_transaction_trace#{punctuation}",
|
220
|
+
"#{traced_method.to_s}_without_newrelic_transaction_trace#{punctuation}"]
|
214
221
|
end
|
215
222
|
|
216
223
|
def already_added_transaction_tracer?(target, with_method_name)
|
217
|
-
|
218
|
-
true
|
219
|
-
else
|
220
|
-
false
|
221
|
-
end
|
224
|
+
NewRelic::Helper.instance_methods_include?(target, with_method_name)
|
222
225
|
end
|
223
226
|
end
|
224
227
|
|
225
228
|
# @!parse extend ClassMethods
|
226
229
|
|
227
230
|
class TransactionNamer
|
228
|
-
def self.name_for(txn, traced_obj, category, options={})
|
231
|
+
def self.name_for(txn, traced_obj, category, options = {})
|
229
232
|
"#{prefix_for_category(txn, category)}#{path_name(traced_obj, options)}"
|
230
233
|
end
|
231
234
|
|
232
235
|
def self.prefix_for_category(txn, category = nil)
|
233
236
|
category ||= (txn && txn.category)
|
234
237
|
case category
|
235
|
-
when :controller
|
236
|
-
when :web
|
237
|
-
when :task
|
238
|
-
when :background
|
239
|
-
when :rack
|
240
|
-
when :uri
|
241
|
-
when :sinatra
|
242
|
-
when :middleware
|
243
|
-
when :grape
|
244
|
-
when :rake
|
245
|
-
when :action_cable
|
246
|
-
when :message
|
238
|
+
when :controller then ::NewRelic::Agent::Transaction::CONTROLLER_PREFIX
|
239
|
+
when :web then ::NewRelic::Agent::Transaction::CONTROLLER_PREFIX
|
240
|
+
when :task then ::NewRelic::Agent::Transaction::TASK_PREFIX
|
241
|
+
when :background then ::NewRelic::Agent::Transaction::TASK_PREFIX
|
242
|
+
when :rack then ::NewRelic::Agent::Transaction::RACK_PREFIX
|
243
|
+
when :uri then ::NewRelic::Agent::Transaction::CONTROLLER_PREFIX
|
244
|
+
when :sinatra then ::NewRelic::Agent::Transaction::SINATRA_PREFIX
|
245
|
+
when :middleware then ::NewRelic::Agent::Transaction::MIDDLEWARE_PREFIX
|
246
|
+
when :grape then ::NewRelic::Agent::Transaction::GRAPE_PREFIX
|
247
|
+
when :rake then ::NewRelic::Agent::Transaction::RAKE_PREFIX
|
248
|
+
when :action_cable then ::NewRelic::Agent::Transaction::ACTION_CABLE_PREFIX
|
249
|
+
when :message then ::NewRelic::Agent::Transaction::MESSAGE_PREFIX
|
247
250
|
else "#{category.to_s}/" # for internal use only
|
248
251
|
end
|
249
252
|
end
|
250
253
|
|
251
|
-
def self.path_name(traced_obj, options={})
|
254
|
+
def self.path_name(traced_obj, options = {})
|
252
255
|
return options[:path] if options[:path]
|
253
256
|
|
254
257
|
class_name = class_name(traced_obj, options)
|
@@ -265,9 +268,9 @@ module NewRelic
|
|
265
268
|
end
|
266
269
|
end
|
267
270
|
|
268
|
-
def self.class_name(traced_obj, options={})
|
271
|
+
def self.class_name(traced_obj, options = {})
|
269
272
|
return options[:class_name] if options[:class_name]
|
270
|
-
if
|
273
|
+
if traced_obj.is_a?(Class) || traced_obj.is_a?(Module)
|
271
274
|
traced_obj.name
|
272
275
|
else
|
273
276
|
traced_obj.class.name
|
@@ -276,7 +279,7 @@ module NewRelic
|
|
276
279
|
end
|
277
280
|
|
278
281
|
# Yield to the given block with NewRelic tracing. Used by
|
279
|
-
# default instrumentation on controller actions in Rails
|
282
|
+
# default instrumentation on controller actions in Rails.
|
280
283
|
# But it can also be used in custom instrumentation of controller
|
281
284
|
# methods and background tasks.
|
282
285
|
#
|
@@ -344,7 +347,7 @@ module NewRelic
|
|
344
347
|
#
|
345
348
|
# @api public
|
346
349
|
#
|
347
|
-
def perform_action_with_newrelic_trace(*args, &block) #THREAD_LOCAL_ACCESS
|
350
|
+
def perform_action_with_newrelic_trace(*args, &block) # THREAD_LOCAL_ACCESS
|
348
351
|
NewRelic::Agent.record_api_supportability_metric(:perform_action_with_newrelic_trace)
|
349
352
|
state = NewRelic::Agent::Tracer.state
|
350
353
|
request = newrelic_request(args)
|
@@ -362,8 +365,8 @@ module NewRelic
|
|
362
365
|
# the *args method signature to ensure backwards compatibility.
|
363
366
|
|
364
367
|
trace_options = args.last.is_a?(Hash) ? args.last : NR_DEFAULT_OPTIONS
|
365
|
-
category
|
366
|
-
txn_options
|
368
|
+
category = trace_options[:category] || :controller
|
369
|
+
txn_options = create_transaction_options(trace_options, category, state, queue_start_time)
|
367
370
|
|
368
371
|
begin
|
369
372
|
finishable = Tracer.start_transaction_or_segment(
|
@@ -378,7 +381,6 @@ module NewRelic
|
|
378
381
|
NewRelic::Agent.notice_error(e)
|
379
382
|
raise
|
380
383
|
end
|
381
|
-
|
382
384
|
ensure
|
383
385
|
finishable.finish if finishable
|
384
386
|
end
|
@@ -433,7 +435,7 @@ module NewRelic
|
|
433
435
|
|
434
436
|
def create_transaction_options(trace_options, category, state, queue_start_time)
|
435
437
|
txn_options = {}
|
436
|
-
txn_options[:request]
|
438
|
+
txn_options[:request] = trace_options[:request]
|
437
439
|
txn_options[:request] ||= request if respond_to?(:request) rescue nil
|
438
440
|
# params should have been filtered before calling perform_action_with_newrelic_trace
|
439
441
|
txn_options[:filtered_params] = trace_options[:params]
|
@@ -441,6 +443,9 @@ module NewRelic
|
|
441
443
|
txn_options[:apdex_start_time] = queue_start_time
|
442
444
|
txn_options[:ignore_apdex] = ignore_apdex?
|
443
445
|
txn_options[:ignore_enduser] = ignore_enduser?
|
446
|
+
NewRelic::Agent::MethodTracerHelpers::SOURCE_CODE_INFORMATION_PARAMETERS.each do |parameter|
|
447
|
+
txn_options[parameter] = trace_options[parameter]
|
448
|
+
end
|
444
449
|
txn_options
|
445
450
|
end
|
446
451
|
|
@@ -456,7 +461,8 @@ module NewRelic
|
|
456
461
|
NewRelic::Agent::Instrumentation::IgnoreActions.is_filtered?(
|
457
462
|
key,
|
458
463
|
self.class,
|
459
|
-
name
|
464
|
+
name
|
465
|
+
)
|
460
466
|
end
|
461
467
|
|
462
468
|
def detect_queue_start_time(request)
|
@@ -15,77 +15,76 @@ module NewRelic::Agent::Instrumentation
|
|
15
15
|
def http_head_with_newrelic(*args, &blk)
|
16
16
|
http_head_with_tracing { http_head_without_newrelic(*args, &blk) }
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
alias_method :http_head_without_newrelic, :http_head
|
20
20
|
alias_method :http_head, :http_head_with_newrelic
|
21
|
-
|
21
|
+
|
22
22
|
def http_post_with_newrelic(*args, &blk)
|
23
23
|
http_post_with_tracing { http_post_without_newrelic(*args, &blk) }
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
alias_method :http_post_without_newrelic, :http_post
|
27
27
|
alias_method :http_post, :http_post_with_newrelic
|
28
|
-
|
28
|
+
|
29
29
|
def http_put_with_newrelic(*args, &blk)
|
30
30
|
http_put_with_tracing { http_put_without_newrelic(*args, &blk) }
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
alias_method :http_put_without_newrelic, :http_put
|
34
34
|
alias_method :http_put, :http_put_with_newrelic
|
35
|
-
|
35
|
+
|
36
36
|
# Hook the #http method to set the verb.
|
37
37
|
def http_with_newrelic verb
|
38
|
-
http_with_tracing(verb) {
|
38
|
+
http_with_tracing(verb) { http_without_newrelic(verb) }
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
41
|
alias_method :http_without_newrelic, :http
|
42
42
|
alias_method :http, :http_with_newrelic
|
43
|
-
|
43
|
+
|
44
44
|
# Hook the #perform method to mark the request as non-parallel.
|
45
45
|
def perform_with_newrelic
|
46
46
|
perform_with_tracing { perform_without_newrelic }
|
47
47
|
end
|
48
|
-
|
48
|
+
|
49
49
|
alias_method :perform_without_newrelic, :perform
|
50
50
|
alias_method :perform, :perform_with_newrelic
|
51
|
-
|
51
|
+
|
52
52
|
# Record the HTTP verb for future #perform calls
|
53
53
|
def method_with_newrelic verb
|
54
|
-
method_with_tracing { method_without_newrelic(verb) }
|
54
|
+
method_with_tracing(verb) { method_without_newrelic(verb) }
|
55
55
|
end
|
56
|
-
|
56
|
+
|
57
57
|
alias_method :method_without_newrelic, :method
|
58
58
|
alias_method :method, :method_with_newrelic
|
59
|
-
|
59
|
+
|
60
60
|
# We override this method in order to ensure access to header_str even
|
61
61
|
# though we use an on_header callback
|
62
62
|
def header_str_with_newrelic
|
63
63
|
header_str_with_tracing { header_str_without_newrelic }
|
64
64
|
end
|
65
|
-
|
65
|
+
|
66
66
|
alias_method :header_str_without_newrelic, :header_str
|
67
67
|
alias_method :header_str, :header_str_with_newrelic
|
68
68
|
end
|
69
69
|
|
70
|
-
Curl::Multi.class_eval do
|
70
|
+
Curl::Multi.class_eval do
|
71
71
|
include NewRelic::Agent::Instrumentation::Curb::Multi
|
72
|
-
|
72
|
+
|
73
73
|
# Add CAT with callbacks if the request is serial
|
74
74
|
def add_with_newrelic(curl)
|
75
75
|
add_with_tracing(curl) { add_without_newrelic curl }
|
76
76
|
end
|
77
|
-
|
77
|
+
|
78
78
|
alias_method :add_without_newrelic, :add
|
79
79
|
alias_method :add, :add_with_newrelic
|
80
|
-
|
80
|
+
|
81
81
|
# Trace as an External/Multiple call if the first request isn't serial.
|
82
82
|
def perform_with_newrelic(&blk)
|
83
83
|
perform_with_tracing { perform_without_newrelic(&blk) }
|
84
84
|
end
|
85
|
-
|
85
|
+
|
86
86
|
alias_method :perform_without_newrelic, :perform
|
87
87
|
alias_method :perform, :perform_with_newrelic
|
88
|
-
|
89
88
|
end
|
90
89
|
end
|
91
90
|
end
|
@@ -9,51 +9,50 @@ module NewRelic
|
|
9
9
|
module Curb
|
10
10
|
module Easy
|
11
11
|
attr_accessor :_nr_instrumented,
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
12
|
+
:_nr_failure_instrumented,
|
13
|
+
:_nr_http_verb,
|
14
|
+
:_nr_header_str,
|
15
|
+
:_nr_original_on_header,
|
16
|
+
:_nr_original_on_complete,
|
17
|
+
:_nr_original_on_failure,
|
18
|
+
:_nr_serial
|
19
|
+
|
20
20
|
# We have to hook these three methods separately, as they don't use
|
21
21
|
# Curl::Easy#http
|
22
22
|
def http_head_with_tracing
|
23
23
|
self._nr_http_verb = :HEAD
|
24
24
|
yield
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
def http_post_with_tracing
|
28
28
|
self._nr_http_verb = :POST
|
29
29
|
yield
|
30
30
|
end
|
31
|
-
|
32
|
-
|
31
|
+
|
33
32
|
def http_put_with_tracing
|
34
33
|
self._nr_http_verb = :PUT
|
35
34
|
yield
|
36
35
|
end
|
37
|
-
|
36
|
+
|
38
37
|
# Hook the #http method to set the verb.
|
39
38
|
def http_with_tracing verb
|
40
39
|
self._nr_http_verb = verb.to_s.upcase
|
41
40
|
yield
|
42
41
|
end
|
43
|
-
|
42
|
+
|
44
43
|
# Hook the #perform method to mark the request as non-parallel.
|
45
44
|
def perform_with_tracing
|
46
45
|
self._nr_http_verb ||= :GET
|
47
46
|
self._nr_serial = true
|
48
47
|
yield
|
49
48
|
end
|
50
|
-
|
49
|
+
|
51
50
|
# Record the HTTP verb for future #perform calls
|
52
51
|
def method_with_tracing verb
|
53
52
|
self._nr_http_verb = verb.upcase
|
54
53
|
yield
|
55
54
|
end
|
56
|
-
|
55
|
+
|
57
56
|
# We override this method in order to ensure access to header_str even
|
58
57
|
# though we use an on_header callback
|
59
58
|
def header_str_with_tracing
|
@@ -65,9 +64,8 @@ module NewRelic
|
|
65
64
|
yield
|
66
65
|
end
|
67
66
|
end
|
68
|
-
|
69
67
|
end
|
70
|
-
####################################################
|
68
|
+
####################################################
|
71
69
|
|
72
70
|
module Multi
|
73
71
|
include NewRelic::Agent::MethodTracer
|
@@ -77,14 +75,14 @@ module NewRelic
|
|
77
75
|
if curl.respond_to?(:_nr_serial) && curl._nr_serial
|
78
76
|
hook_pending_request(curl) if NewRelic::Agent::Tracer.tracing_enabled?
|
79
77
|
end
|
80
|
-
|
78
|
+
|
81
79
|
return yield
|
82
80
|
end
|
83
81
|
|
84
82
|
# Trace as an External/Multiple call if the first request isn't serial.
|
85
83
|
def perform_with_tracing
|
86
84
|
return yield if first_request_is_serial?
|
87
|
-
|
85
|
+
|
88
86
|
trace_execution_scoped("External/Multiple/Curb::Multi/perform") do
|
89
87
|
yield
|
90
88
|
end
|
@@ -94,15 +92,15 @@ module NewRelic
|
|
94
92
|
# and set up cross-application tracing if it's enabled.
|
95
93
|
def hook_pending_request(request)
|
96
94
|
wrapped_request, wrapped_response = wrap_request(request)
|
97
|
-
|
95
|
+
|
98
96
|
segment = NewRelic::Agent::Tracer.start_external_request_segment(
|
99
97
|
library: wrapped_request.type,
|
100
98
|
uri: wrapped_request.uri,
|
101
99
|
procedure: wrapped_request.method
|
102
100
|
)
|
103
|
-
|
101
|
+
|
104
102
|
segment.add_request_headers wrapped_request
|
105
|
-
|
103
|
+
|
106
104
|
# install all callbacks
|
107
105
|
unless request._nr_instrumented
|
108
106
|
install_header_callback(request, wrapped_response)
|
@@ -113,8 +111,7 @@ module NewRelic
|
|
113
111
|
rescue => err
|
114
112
|
NewRelic::Agent.logger.error("Untrapped exception", err)
|
115
113
|
end
|
116
|
-
|
117
|
-
|
114
|
+
|
118
115
|
# Create request and response adapter objects for the specified +request+
|
119
116
|
# NOTE: Although strange to wrap request and response at once, it works
|
120
117
|
# because curb's callback mechanism updates the instantiated wrappers
|
@@ -123,7 +120,7 @@ module NewRelic
|
|
123
120
|
return NewRelic::Agent::HTTPClients::CurbRequest.new(request),
|
124
121
|
NewRelic::Agent::HTTPClients::CurbResponse.new(request)
|
125
122
|
end
|
126
|
-
|
123
|
+
|
127
124
|
# Install a callback that will record the response headers
|
128
125
|
# to enable CAT linking
|
129
126
|
def install_header_callback(request, wrapped_response)
|
@@ -139,7 +136,7 @@ module NewRelic
|
|
139
136
|
end
|
140
137
|
end
|
141
138
|
end
|
142
|
-
|
139
|
+
|
143
140
|
# Install a callback that will finish the trace.
|
144
141
|
def install_completion_callback(request, wrapped_response, segment)
|
145
142
|
original_callback = request.on_complete
|
@@ -156,7 +153,7 @@ module NewRelic
|
|
156
153
|
end
|
157
154
|
end
|
158
155
|
end
|
159
|
-
|
156
|
+
|
160
157
|
# Install a callback that will fire on failures
|
161
158
|
# NOTE: on_failure is not always called, so we're not always
|
162
159
|
# unhooking the callback. No harm/no foul in production, but
|
@@ -177,10 +174,10 @@ module NewRelic
|
|
177
174
|
original_callback.call(failed_request, error) if original_callback
|
178
175
|
remove_failure_callback(failed_request)
|
179
176
|
end
|
180
|
-
request._nr_failure_instrumented = true
|
177
|
+
request._nr_failure_instrumented = true
|
181
178
|
end
|
182
179
|
end
|
183
|
-
|
180
|
+
|
184
181
|
# on_failure callbacks cannot be removed in the on_complete
|
185
182
|
# callback where this method is invoked because on_complete
|
186
183
|
# fires before the on_failure!
|
@@ -189,20 +186,20 @@ module NewRelic
|
|
189
186
|
request.on_header(&request._nr_original_on_header)
|
190
187
|
request._nr_instrumented = false
|
191
188
|
end
|
192
|
-
|
193
|
-
# We execute customer's on_failure callback (if any) and
|
194
|
-
# uninstall our hook here since the on_complete callback
|
189
|
+
|
190
|
+
# We execute customer's on_failure callback (if any) and
|
191
|
+
# uninstall our hook here since the on_complete callback
|
195
192
|
# fires before the on_failure callback.
|
196
193
|
def remove_failure_callback(request)
|
197
194
|
request.on_failure(&request._nr_original_on_failure)
|
198
195
|
request._nr_failure_instrumented = false
|
199
196
|
end
|
200
|
-
|
197
|
+
|
201
198
|
private
|
202
|
-
|
199
|
+
|
203
200
|
def first_request_is_serial?
|
204
201
|
return false unless (first = self.requests.first)
|
205
|
-
|
202
|
+
|
206
203
|
# Before curb 0.9.8, requests was an array of Curl::Easy
|
207
204
|
# instances. Starting with 0.9.8, it's a Hash where the
|
208
205
|
# values are Curl::Easy instances.
|
@@ -211,12 +208,11 @@ module NewRelic
|
|
211
208
|
# We need to handle either case.
|
212
209
|
#
|
213
210
|
first = first[-1] if first.is_a?(Array)
|
214
|
-
|
211
|
+
|
215
212
|
first.respond_to?(:_nr_serial) && first._nr_serial
|
216
213
|
end
|
217
|
-
|
218
214
|
end
|
219
215
|
end
|
220
216
|
end
|
221
217
|
end
|
222
|
-
end
|
218
|
+
end
|
@@ -5,8 +5,8 @@
|
|
5
5
|
|
6
6
|
require_relative 'instrumentation'
|
7
7
|
|
8
|
-
module NewRelic
|
9
|
-
module Agent
|
8
|
+
module NewRelic
|
9
|
+
module Agent
|
10
10
|
module Instrumentation
|
11
11
|
module Curb
|
12
12
|
module Easy
|
@@ -16,27 +16,27 @@ module NewRelic
|
|
16
16
|
def http_head(*args, &blk)
|
17
17
|
http_head_with_tracing { super }
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
def http_post(*args, &blk)
|
21
21
|
http_post_with_tracing { super }
|
22
22
|
end
|
23
|
-
|
23
|
+
|
24
24
|
def http_put(*args, &blk)
|
25
25
|
http_put_with_tracing { super }
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
def http verb
|
29
29
|
http_with_tracing(verb) { super }
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
def perform
|
33
33
|
perform_with_tracing { super }
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
36
|
def method verb
|
37
|
-
method_with_tracing { super }
|
37
|
+
method_with_tracing(verb) { super }
|
38
38
|
end
|
39
|
-
|
39
|
+
|
40
40
|
def header_str
|
41
41
|
header_str_with_tracing { super }
|
42
42
|
end
|
@@ -46,7 +46,7 @@ module NewRelic
|
|
46
46
|
module Multi
|
47
47
|
module Prepend
|
48
48
|
include NewRelic::Agent::Instrumentation::Curb::Multi
|
49
|
-
|
49
|
+
|
50
50
|
def add(curl)
|
51
51
|
add_with_tracing(curl) { super }
|
52
52
|
end
|
@@ -54,7 +54,6 @@ module NewRelic
|
|
54
54
|
def perform(&blk)
|
55
55
|
perform_with_tracing { super }
|
56
56
|
end
|
57
|
-
|
58
57
|
end
|
59
58
|
end
|
60
59
|
end
|