newrelic_rpm 4.8.0.341 → 6.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/ISSUE_TEMPLATE/bug_report.md +31 -0
- data/.github/ISSUE_TEMPLATE/config.yml +5 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +24 -0
- data/.github/actions/annotate/README.md +79 -0
- data/.github/actions/annotate/action.yml +6 -0
- data/.github/actions/annotate/dist/index.js +433 -0
- data/.github/actions/annotate/index.js +25 -0
- data/.github/actions/annotate/package-lock.json +172 -0
- data/.github/actions/annotate/package.json +30 -0
- data/.github/actions/annotate/pre-commit +5 -0
- data/.github/actions/build-ruby/README.md +79 -0
- data/.github/actions/build-ruby/action.yml +15 -0
- data/.github/actions/build-ruby/dist/index.js +52683 -0
- data/.github/actions/build-ruby/index.js +514 -0
- data/.github/actions/build-ruby/package-lock.json +581 -0
- data/.github/actions/build-ruby/package.json +32 -0
- data/.github/actions/build-ruby/pre-commit +5 -0
- data/.github/pull_request_template.md +16 -0
- data/.github/workflows/ci.yml +212 -0
- data/.github/workflows/pr_review_checklist.yml +22 -0
- data/.github/workflows/release.yml +78 -0
- data/.github/workflows/scripts/rubygems-authenticate.py +13 -0
- data/.github/workflows/scripts/rubygems-publish.rb +32 -0
- data/.github/workflows/snyk.yml +27 -0
- data/.github/workflows/stale.yml +21 -0
- data/.gitignore +9 -0
- data/.yardopts +4 -1
- data/CHANGELOG.md +868 -3
- data/CONTRIBUTING.md +106 -19
- data/Gemfile +6 -2
- data/Guardfile +18 -1
- data/LICENSE +208 -38
- data/README.md +81 -88
- data/ROADMAP.md +24 -0
- data/Rakefile +2 -0
- data/THIRD_PARTY_NOTICES.md +213 -0
- data/bin/nrdebug +1 -1
- data/config.dot +3 -12
- data/init.rb +1 -1
- data/install.rb +1 -1
- data/lib/new_relic/agent.rb +145 -31
- data/lib/new_relic/agent/adaptive_sampler.rb +104 -0
- data/lib/new_relic/agent/agent.rb +192 -190
- data/lib/new_relic/agent/agent_logger.rb +5 -1
- data/lib/new_relic/agent/attribute_filter.rb +85 -25
- data/lib/new_relic/agent/attribute_processing.rb +1 -1
- data/lib/new_relic/agent/attributes.rb +152 -0
- data/lib/new_relic/agent/audit_logger.rb +1 -1
- data/lib/new_relic/agent/autostart.rb +20 -15
- data/lib/new_relic/agent/chained_call.rb +1 -1
- data/lib/new_relic/agent/commands/agent_command.rb +1 -1
- data/lib/new_relic/agent/commands/agent_command_router.rb +3 -22
- data/lib/new_relic/agent/commands/thread_profiler_session.rb +1 -1
- data/lib/new_relic/agent/configuration.rb +1 -1
- data/lib/new_relic/agent/configuration/default_source.rb +375 -67
- data/lib/new_relic/agent/configuration/dotted_hash.rb +1 -1
- data/lib/new_relic/agent/configuration/environment_source.rb +5 -3
- data/lib/new_relic/agent/configuration/event_harvest_config.rb +45 -0
- data/lib/new_relic/agent/configuration/high_security_source.rb +2 -3
- data/lib/new_relic/agent/configuration/manager.rb +54 -43
- data/lib/new_relic/agent/configuration/manual_source.rb +1 -1
- data/lib/new_relic/agent/configuration/mask_defaults.rb +1 -1
- data/lib/new_relic/agent/configuration/security_policy_source.rb +238 -0
- data/lib/new_relic/agent/configuration/server_source.rb +46 -5
- data/lib/new_relic/agent/configuration/yaml_source.rb +12 -7
- data/lib/new_relic/agent/connect/request_builder.rb +61 -0
- data/lib/new_relic/agent/connect/response_handler.rb +61 -0
- data/lib/new_relic/agent/custom_event_aggregator.rb +17 -6
- data/lib/new_relic/agent/database.rb +21 -3
- data/lib/new_relic/agent/database/explain_plan_helpers.rb +12 -1
- data/lib/new_relic/agent/database/obfuscation_helpers.rb +2 -2
- data/lib/new_relic/agent/database/obfuscator.rb +1 -1
- data/lib/new_relic/agent/database/postgres_explain_obfuscator.rb +1 -1
- data/lib/new_relic/agent/datastores.rb +12 -11
- data/lib/new_relic/agent/datastores/metric_helper.rb +2 -3
- data/lib/new_relic/agent/datastores/mongo.rb +2 -2
- data/lib/new_relic/agent/datastores/mongo/event_formatter.rb +3 -3
- data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +1 -1
- data/lib/new_relic/agent/datastores/mongo/obfuscator.rb +9 -9
- data/lib/new_relic/agent/datastores/mongo/statement_formatter.rb +1 -1
- data/lib/new_relic/agent/datastores/redis.rb +1 -1
- data/lib/new_relic/agent/deprecator.rb +1 -1
- data/lib/new_relic/agent/distributed_tracing.rb +216 -0
- data/lib/new_relic/agent/distributed_tracing/cross_app_payload.rb +44 -0
- data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +248 -0
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +84 -0
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_metrics.rb +75 -0
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +165 -0
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb +39 -0
- data/lib/new_relic/agent/distributed_tracing/trace_context.rb +246 -0
- data/lib/new_relic/agent/distributed_tracing/trace_context_payload.rb +126 -0
- data/lib/new_relic/agent/encoding_normalizer.rb +1 -1
- data/lib/new_relic/agent/error_collector.rb +51 -20
- data/lib/new_relic/agent/error_event_aggregator.rb +14 -7
- data/lib/new_relic/agent/error_trace_aggregator.rb +2 -1
- data/lib/new_relic/agent/event_aggregator.rb +34 -15
- data/lib/new_relic/agent/event_buffer.rb +1 -1
- data/lib/new_relic/agent/event_listener.rb +1 -1
- data/lib/new_relic/agent/event_loop.rb +1 -1
- data/lib/new_relic/agent/external.rb +31 -29
- data/lib/new_relic/agent/guid_generator.rb +28 -0
- data/lib/new_relic/agent/harvester.rb +1 -1
- data/lib/new_relic/agent/heap.rb +140 -0
- data/lib/new_relic/agent/hostname.rb +16 -2
- data/lib/new_relic/agent/http_clients/abstract.rb +82 -0
- data/lib/new_relic/agent/http_clients/curb_wrappers.rb +25 -20
- data/lib/new_relic/agent/http_clients/excon_wrappers.rb +29 -14
- data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +18 -22
- data/lib/new_relic/agent/http_clients/httpclient_wrappers.rb +11 -12
- data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +17 -5
- data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +5 -7
- data/lib/new_relic/agent/http_clients/uri_util.rb +12 -11
- data/lib/new_relic/agent/instrumentation.rb +1 -1
- data/lib/new_relic/agent/instrumentation/action_cable_subscriber.rb +26 -43
- data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +56 -74
- data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +82 -56
- data/lib/new_relic/agent/instrumentation/active_job.rb +19 -17
- data/lib/new_relic/agent/instrumentation/active_merchant.rb +1 -1
- data/lib/new_relic/agent/instrumentation/active_record.rb +85 -38
- data/lib/new_relic/agent/instrumentation/active_record_helper.rb +82 -24
- data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +168 -0
- data/lib/new_relic/agent/instrumentation/active_record_prepend.rb +102 -31
- data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +47 -57
- data/lib/new_relic/agent/instrumentation/active_storage.rb +23 -0
- data/lib/new_relic/agent/instrumentation/active_storage_subscriber.rb +63 -0
- data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +24 -8
- data/lib/new_relic/agent/instrumentation/authlogic.rb +1 -1
- data/lib/new_relic/agent/instrumentation/bunny.rb +115 -44
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +18 -12
- data/lib/new_relic/agent/instrumentation/curb.rb +121 -35
- data/lib/new_relic/agent/instrumentation/data_mapper.rb +6 -4
- data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +61 -25
- data/lib/new_relic/agent/instrumentation/excon.rb +2 -2
- data/lib/new_relic/agent/instrumentation/excon/connection.rb +8 -5
- data/lib/new_relic/agent/instrumentation/excon/middleware.rb +4 -3
- data/lib/new_relic/agent/instrumentation/grape.rb +46 -35
- data/lib/new_relic/agent/instrumentation/http.rb +8 -5
- data/lib/new_relic/agent/instrumentation/httpclient.rb +7 -5
- data/lib/new_relic/agent/instrumentation/ignore_actions.rb +1 -1
- data/lib/new_relic/agent/instrumentation/memcache.rb +5 -3
- data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +10 -6
- data/lib/new_relic/agent/instrumentation/merb/controller.rb +1 -1
- data/lib/new_relic/agent/instrumentation/merb/errors.rb +1 -1
- data/lib/new_relic/agent/instrumentation/middleware_proxy.rb +13 -5
- data/lib/new_relic/agent/instrumentation/middleware_tracing.rb +20 -11
- data/lib/new_relic/agent/instrumentation/mongo.rb +11 -5
- data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +39 -7
- data/lib/new_relic/agent/instrumentation/net.rb +60 -23
- data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +100 -0
- data/lib/new_relic/agent/instrumentation/padrino.rb +40 -16
- data/lib/new_relic/agent/instrumentation/passenger_instrumentation.rb +1 -1
- data/lib/new_relic/agent/instrumentation/queue_time.rb +1 -1
- data/lib/new_relic/agent/instrumentation/rack.rb +36 -13
- data/lib/new_relic/agent/instrumentation/rails/action_controller.rb +1 -1
- data/lib/new_relic/agent/instrumentation/rails/action_web_service.rb +1 -1
- data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +1 -1
- data/lib/new_relic/agent/instrumentation/rails_middleware.rb +1 -1
- data/lib/new_relic/agent/instrumentation/{rails5 → rails_notifications}/action_cable.rb +8 -5
- data/lib/new_relic/agent/instrumentation/{rails5 → rails_notifications}/action_controller.rb +4 -4
- data/lib/new_relic/agent/instrumentation/{rails4 → rails_notifications}/action_view.rb +4 -4
- data/lib/new_relic/agent/instrumentation/rainbows_instrumentation.rb +1 -1
- data/lib/new_relic/agent/instrumentation/rake.rb +56 -22
- data/lib/new_relic/agent/instrumentation/redis.rb +141 -56
- data/lib/new_relic/agent/instrumentation/resque.rb +21 -37
- data/lib/new_relic/agent/instrumentation/sequel.rb +2 -3
- data/lib/new_relic/agent/instrumentation/sequel_helper.rb +1 -1
- data/lib/new_relic/agent/instrumentation/sidekiq.rb +48 -24
- data/lib/new_relic/agent/instrumentation/sinatra.rb +62 -23
- data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +1 -1
- data/lib/new_relic/agent/instrumentation/sinatra/transaction_namer.rb +1 -1
- data/lib/new_relic/agent/instrumentation/sunspot.rb +1 -1
- data/lib/new_relic/agent/instrumentation/typhoeus.rb +27 -10
- data/lib/new_relic/agent/internal_agent_error.rb +1 -1
- data/lib/new_relic/agent/javascript_instrumentor.rb +19 -16
- data/lib/new_relic/agent/log_once.rb +1 -1
- data/lib/new_relic/agent/logging.rb +139 -0
- data/lib/new_relic/agent/memory_logger.rb +1 -1
- data/lib/new_relic/agent/messaging.rb +15 -59
- data/lib/new_relic/agent/method_tracer.rb +42 -25
- data/lib/new_relic/agent/method_tracer_helpers.rb +5 -5
- data/lib/new_relic/agent/monitors.rb +27 -0
- data/lib/new_relic/agent/monitors/cross_app_monitor.rb +110 -0
- data/lib/new_relic/agent/monitors/distributed_tracing_monitor.rb +27 -0
- data/lib/new_relic/agent/{inbound_request_monitor.rb → monitors/inbound_request_monitor.rb} +4 -4
- data/lib/new_relic/agent/{synthetics_monitor.rb → monitors/synthetics_monitor.rb} +4 -7
- data/lib/new_relic/agent/new_relic_service.rb +174 -63
- data/lib/new_relic/agent/new_relic_service/encoders.rb +1 -1
- data/lib/new_relic/agent/new_relic_service/json_marshaller.rb +1 -2
- data/lib/new_relic/agent/new_relic_service/marshaller.rb +6 -27
- data/lib/new_relic/agent/new_relic_service/security_policy_settings.rb +61 -0
- data/lib/new_relic/agent/noticible_error.rb +22 -0
- data/lib/new_relic/agent/null_logger.rb +1 -1
- data/lib/new_relic/agent/obfuscator.rb +1 -1
- data/lib/new_relic/agent/parameter_filtering.rb +19 -6
- data/lib/new_relic/agent/payload_metric_mapping.rb +1 -1
- data/lib/new_relic/agent/pipe_channel_manager.rb +1 -1
- data/lib/new_relic/agent/pipe_service.rb +5 -1
- data/lib/new_relic/agent/prepend_supportability.rb +1 -1
- data/lib/new_relic/agent/priority_sampled_buffer.rb +95 -0
- data/lib/new_relic/agent/range_extensions.rb +1 -1
- data/lib/new_relic/agent/rules_engine.rb +1 -1
- data/lib/new_relic/agent/rules_engine/replacement_rule.rb +1 -1
- data/lib/new_relic/agent/rules_engine/segment_terms_rule.rb +1 -1
- data/lib/new_relic/agent/sampler.rb +1 -1
- data/lib/new_relic/agent/sampler_collection.rb +1 -1
- data/lib/new_relic/agent/samplers/cpu_sampler.rb +1 -1
- data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +1 -1
- data/lib/new_relic/agent/samplers/memory_sampler.rb +1 -1
- data/lib/new_relic/agent/samplers/object_sampler.rb +1 -1
- data/lib/new_relic/agent/samplers/vm_sampler.rb +1 -1
- data/lib/new_relic/agent/span_event_aggregator.rb +49 -0
- data/lib/new_relic/agent/span_event_primitive.rb +206 -0
- data/lib/new_relic/agent/sql_sampler.rb +23 -7
- data/lib/new_relic/agent/stats.rb +1 -1
- data/lib/new_relic/agent/stats_engine.rb +4 -4
- data/lib/new_relic/agent/stats_engine/gc_profiler.rb +1 -1
- data/lib/new_relic/agent/stats_engine/stats_hash.rb +1 -1
- data/lib/new_relic/agent/supported_versions.rb +3 -3
- data/lib/new_relic/agent/synthetics_event_aggregator.rb +6 -13
- data/lib/new_relic/agent/system_info.rb +18 -8
- data/lib/new_relic/agent/threading/agent_thread.rb +6 -4
- data/lib/new_relic/agent/threading/backtrace_node.rb +1 -1
- data/lib/new_relic/agent/threading/backtrace_service.rb +4 -4
- data/lib/new_relic/agent/threading/thread_profile.rb +10 -24
- data/lib/new_relic/agent/timestamp_sampled_buffer.rb +19 -0
- data/lib/new_relic/agent/tracer.rb +509 -0
- data/lib/new_relic/agent/transaction.rb +191 -278
- data/lib/new_relic/agent/transaction/abstract_segment.rb +38 -5
- data/lib/new_relic/agent/transaction/datastore_segment.rb +30 -5
- data/lib/new_relic/agent/transaction/distributed_tracer.rb +171 -0
- data/lib/new_relic/agent/transaction/distributed_tracing.rb +123 -71
- data/lib/new_relic/agent/transaction/external_request_segment.rb +41 -89
- data/lib/new_relic/agent/transaction/message_broker_segment.rb +7 -8
- data/lib/new_relic/agent/transaction/request_attributes.rb +1 -1
- data/lib/new_relic/agent/transaction/segment.rb +42 -2
- data/lib/new_relic/agent/transaction/slowest_sample_buffer.rb +1 -1
- data/lib/new_relic/agent/transaction/synthetics_sample_buffer.rb +1 -1
- data/lib/new_relic/agent/transaction/trace.rb +7 -23
- data/lib/new_relic/agent/transaction/trace_builder.rb +1 -2
- data/lib/new_relic/agent/transaction/trace_context.rb +168 -0
- data/lib/new_relic/agent/transaction/trace_node.rb +12 -8
- data/lib/new_relic/agent/transaction/tracing.rb +2 -100
- data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +1 -1
- data/lib/new_relic/agent/transaction_error_primitive.rb +13 -22
- data/lib/new_relic/agent/transaction_event_aggregator.rb +7 -16
- data/lib/new_relic/agent/transaction_event_primitive.rb +31 -42
- data/lib/new_relic/agent/transaction_event_recorder.rb +8 -16
- data/lib/new_relic/agent/transaction_metrics.rb +1 -1
- data/lib/new_relic/agent/transaction_sampler.rb +3 -14
- data/lib/new_relic/agent/transaction_time_aggregator.rb +155 -0
- data/lib/new_relic/agent/utilization/aws.rb +1 -1
- data/lib/new_relic/agent/utilization/azure.rb +1 -1
- data/lib/new_relic/agent/utilization/gcp.rb +1 -1
- 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/utilization_data.rb +37 -2
- data/lib/new_relic/agent/vm.rb +1 -1
- data/lib/new_relic/agent/vm/jruby_vm.rb +1 -1
- data/lib/new_relic/agent/vm/monotonic_gc_profiler.rb +1 -1
- data/lib/new_relic/agent/vm/mri_vm.rb +1 -1
- data/lib/new_relic/agent/vm/snapshot.rb +1 -1
- data/lib/new_relic/agent/worker_loop.rb +1 -1
- data/lib/new_relic/cli/command.rb +1 -1
- data/lib/new_relic/cli/commands/deployments.rb +2 -2
- data/lib/new_relic/cli/commands/install.rb +4 -3
- data/lib/new_relic/coerce.rb +32 -7
- data/lib/new_relic/collection_helper.rb +1 -1
- data/lib/new_relic/constants.rb +38 -0
- data/lib/new_relic/control.rb +1 -1
- data/lib/new_relic/control/class_methods.rb +8 -2
- data/lib/new_relic/control/frameworks.rb +1 -1
- data/lib/new_relic/control/frameworks/external.rb +1 -1
- data/lib/new_relic/control/frameworks/merb.rb +1 -1
- data/lib/new_relic/control/frameworks/rails.rb +1 -1
- data/lib/new_relic/control/frameworks/rails3.rb +1 -1
- data/lib/new_relic/control/frameworks/rails4.rb +1 -1
- data/lib/new_relic/control/frameworks/{rails5.rb → rails_notifications.rb} +2 -2
- data/lib/new_relic/control/frameworks/ruby.rb +1 -1
- data/lib/new_relic/control/frameworks/sinatra.rb +1 -1
- data/lib/new_relic/control/instance_methods.rb +30 -4
- data/lib/new_relic/control/instrumentation.rb +1 -1
- data/lib/new_relic/control/server_methods.rb +1 -1
- data/lib/new_relic/delayed_job_injection.rb +1 -1
- data/lib/new_relic/dependency_detection.rb +5 -5
- data/lib/new_relic/environment_report.rb +6 -2
- data/lib/new_relic/helper.rb +1 -1
- data/lib/new_relic/language_support.rb +1 -1
- data/lib/new_relic/latest_changes.rb +4 -4
- data/lib/new_relic/local_environment.rb +1 -1
- data/lib/new_relic/metric_data.rb +1 -1
- data/lib/new_relic/metric_spec.rb +1 -1
- data/lib/new_relic/noticed_error.rb +39 -18
- data/lib/new_relic/rack.rb +1 -1
- data/lib/new_relic/rack/agent_hooks.rb +1 -1
- data/lib/new_relic/rack/agent_middleware.rb +2 -2
- data/lib/new_relic/rack/browser_monitoring.rb +16 -9
- data/lib/new_relic/recipes.rb +1 -1
- data/lib/new_relic/recipes/capistrano3.rb +6 -3
- data/lib/new_relic/recipes/capistrano_legacy.rb +1 -1
- data/lib/new_relic/supportability_helper.rb +15 -1
- data/lib/new_relic/version.rb +4 -4
- data/lib/newrelic_rpm.rb +1 -1
- data/lib/sequel/extensions/newrelic_instrumentation.rb +3 -3
- data/lib/sequel/plugins/newrelic_instrumentation.rb +2 -2
- data/lib/tasks/all.rb +1 -1
- data/lib/tasks/config.rake +1 -2
- data/lib/tasks/multiverse.rb +35 -1
- data/lib/tasks/newrelic.rb +1 -1
- data/lib/tasks/tests.rake +6 -1
- data/newrelic_rpm.gemspec +23 -17
- data/recipes/newrelic.rb +1 -1
- data/test/agent_helper.rb +357 -78
- metadata +154 -60
- data/.travis.yml +0 -173
- data/lib/new_relic/agent/busy_calculator.rb +0 -117
- data/lib/new_relic/agent/commands/xray_session.rb +0 -55
- data/lib/new_relic/agent/commands/xray_session_collection.rb +0 -161
- data/lib/new_relic/agent/cross_app_monitor.rb +0 -140
- data/lib/new_relic/agent/cross_app_tracing.rb +0 -143
- data/lib/new_relic/agent/distributed_trace_monitor.rb +0 -29
- data/lib/new_relic/agent/distributed_trace_payload.rb +0 -223
- data/lib/new_relic/agent/distributed_trace_priority_sampled_buffer.rb +0 -72
- data/lib/new_relic/agent/http_clients/abstract_request.rb +0 -31
- data/lib/new_relic/agent/instrumentation/active_record_4.rb +0 -42
- data/lib/new_relic/agent/instrumentation/active_record_5.rb +0 -36
- data/lib/new_relic/agent/instrumentation/evented_subscriber.rb +0 -104
- data/lib/new_relic/agent/instrumentation/rails4/action_controller.rb +0 -32
- data/lib/new_relic/agent/instrumentation/rails5/action_view.rb +0 -27
- data/lib/new_relic/agent/sampled_buffer.rb +0 -68
- data/lib/new_relic/agent/sized_buffer.rb +0 -23
- data/lib/new_relic/agent/synthetics_event_buffer.rb +0 -40
- data/lib/new_relic/agent/throughput_monitor.rb +0 -59
- data/lib/new_relic/agent/transaction/attributes.rb +0 -153
- data/lib/new_relic/agent/transaction/xray_sample_buffer.rb +0 -64
- data/lib/new_relic/agent/transaction_state.rb +0 -145
- data/lib/new_relic/agent/transaction_timings.rb +0 -57
- data/lib/new_relic/metrics.rb +0 -13
- data/lib/tasks/versions.html.erb +0 -28
- data/lib/tasks/versions.postface.html +0 -8
- data/lib/tasks/versions.preface.html +0 -9
- data/lib/tasks/versions.rake +0 -65
- data/lib/tasks/versions.txt.erb +0 -14
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
# This file is distributed under New Relic's license terms.
|
3
|
-
# See https://github.com/newrelic/
|
3
|
+
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
4
|
|
5
5
|
DependencyDetection.defer do
|
6
6
|
named :data_mapper
|
@@ -133,14 +133,16 @@ module NewRelic
|
|
133
133
|
name = self.class.name
|
134
134
|
end
|
135
135
|
|
136
|
-
segment = NewRelic::Agent::
|
136
|
+
segment = NewRelic::Agent::Tracer.start_datastore_segment(
|
137
137
|
product: DATA_MAPPER,
|
138
138
|
operation: metric_operation,
|
139
139
|
collection: name
|
140
140
|
)
|
141
141
|
|
142
142
|
begin
|
143
|
-
|
143
|
+
NewRelic::Agent::Tracer.capture_segment_error segment do
|
144
|
+
self.send("#{method_name}_without_newrelic", *args, &blk)
|
145
|
+
end
|
144
146
|
rescue ::DataObjects::ConnectionError => e
|
145
147
|
raise
|
146
148
|
rescue ::DataObjects::SQLError => e
|
@@ -185,7 +187,7 @@ module NewRelic
|
|
185
187
|
# hooked with tracers, ensuring that notice_sql attaches this SQL to
|
186
188
|
# the proper call scope.
|
187
189
|
def log(msg) #THREAD_LOCAL_ACCESS
|
188
|
-
state = NewRelic::Agent::
|
190
|
+
state = NewRelic::Agent::Tracer.state
|
189
191
|
return unless state.is_execution_traced?
|
190
192
|
|
191
193
|
txn = state.current_transaction
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
# This file is distributed under New Relic's license terms.
|
3
|
-
# See https://github.com/newrelic/
|
3
|
+
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
4
|
|
5
5
|
require 'new_relic/agent/instrumentation/controller_instrumentation'
|
6
6
|
|
@@ -89,22 +89,44 @@ DependencyDetection.defer do
|
|
89
89
|
|
90
90
|
executes do
|
91
91
|
Delayed::Worker.class_eval do
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
92
|
+
|
93
|
+
if RUBY_VERSION < "2.7.0"
|
94
|
+
def initialize_with_new_relic(*args)
|
95
|
+
initialize_without_new_relic(*args)
|
96
|
+
worker_name = case
|
97
|
+
when self.respond_to?(:name) then self.name
|
98
|
+
when self.class.respond_to?(:default_name) then self.class.default_name
|
99
|
+
end
|
100
|
+
NewRelic::DelayedJobInjection.worker_name = worker_name
|
101
|
+
|
102
|
+
if defined?(::Delayed::Job) && ::Delayed::Job.method_defined?(:invoke_job) &&
|
103
|
+
!(::Delayed::Job.method_defined?(:invoke_job_without_new_relic) )
|
104
|
+
|
105
|
+
::NewRelic::Agent.logger.info 'Installing DelayedJob instrumentation [part 2/2]'
|
106
|
+
install_newrelic_job_tracer
|
107
|
+
NewRelic::Control.instance.init_plugin :dispatcher => :delayed_job
|
108
|
+
else
|
109
|
+
NewRelic::Agent.logger.warn("Did not find a Delayed::Job class responding to invoke_job, aborting DJ instrumentation")
|
110
|
+
end
|
111
|
+
end
|
112
|
+
else
|
113
|
+
def initialize_with_new_relic(*args, **kwargs)
|
114
|
+
initialize_without_new_relic(*args, **kwargs)
|
115
|
+
worker_name = case
|
116
|
+
when self.respond_to?(:name) then self.name
|
117
|
+
when self.class.respond_to?(:default_name) then self.class.default_name
|
118
|
+
end
|
119
|
+
NewRelic::DelayedJobInjection.worker_name = worker_name
|
120
|
+
|
121
|
+
if defined?(::Delayed::Job) && ::Delayed::Job.method_defined?(:invoke_job) &&
|
122
|
+
!(::Delayed::Job.method_defined?(:invoke_job_without_new_relic) )
|
123
|
+
|
124
|
+
::NewRelic::Agent.logger.info 'Installing DelayedJob instrumentation [part 2/2]'
|
125
|
+
install_newrelic_job_tracer
|
126
|
+
NewRelic::Control.instance.init_plugin :dispatcher => :delayed_job
|
127
|
+
else
|
128
|
+
NewRelic::Agent.logger.warn("Did not find a Delayed::Job class responding to invoke_job, aborting DJ instrumentation")
|
129
|
+
end
|
108
130
|
end
|
109
131
|
end
|
110
132
|
|
@@ -119,16 +141,30 @@ DependencyDetection.defer do
|
|
119
141
|
|
120
142
|
alias_method :invoke_job_without_new_relic, :invoke_job
|
121
143
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
144
|
+
if RUBY_VERSION < "2.7.0"
|
145
|
+
def invoke_job(*args, &block)
|
146
|
+
options = {
|
147
|
+
:category => NR_TRANSACTION_CATEGORY,
|
148
|
+
:path => ::NewRelic::Agent::Instrumentation::DelayedJob::Naming.name_from_payload(payload_object)
|
149
|
+
}
|
150
|
+
|
151
|
+
perform_action_with_newrelic_trace(options) do
|
152
|
+
invoke_job_without_new_relic(*args, &block)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
else
|
156
|
+
def invoke_job(*args, **kwargs, &block)
|
157
|
+
options = {
|
158
|
+
:category => NR_TRANSACTION_CATEGORY,
|
159
|
+
:path => ::NewRelic::Agent::Instrumentation::DelayedJob::Naming.name_from_payload(payload_object)
|
160
|
+
}
|
161
|
+
|
162
|
+
perform_action_with_newrelic_trace(options) do
|
163
|
+
invoke_job_without_new_relic(*args, **kwargs, &block)
|
164
|
+
end
|
130
165
|
end
|
131
166
|
end
|
167
|
+
|
132
168
|
end
|
133
169
|
end
|
134
170
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
# This file is distributed under New Relic's license terms.
|
3
|
-
# See https://github.com/newrelic/
|
3
|
+
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
4
|
|
5
5
|
DependencyDetection.defer do
|
6
6
|
named :excon
|
@@ -42,7 +42,7 @@ DependencyDetection.defer do
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def install_excon_instrumentation(excon_version)
|
45
|
-
require 'new_relic/agent/cross_app_tracing'
|
45
|
+
require 'new_relic/agent/distributed_tracing/cross_app_tracing'
|
46
46
|
require 'new_relic/agent/http_clients/excon_wrappers'
|
47
47
|
|
48
48
|
if excon_version >= EXCON_MIDDLEWARE_MIN_VERSION
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
# This file is distributed under New Relic's license terms.
|
3
|
-
# See https://github.com/newrelic/
|
3
|
+
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
4
|
|
5
5
|
module ::Excon
|
6
6
|
class Connection
|
7
|
+
# @connection is deprecated in newer excon versions and replaced with @data
|
7
8
|
def newrelic_connection_params
|
8
|
-
(@
|
9
|
+
(@data || @connection)
|
9
10
|
end
|
10
11
|
|
11
12
|
def newrelic_resolved_request_params(request_params)
|
@@ -17,7 +18,7 @@ module ::Excon
|
|
17
18
|
def request_with_newrelic_trace(params, &block)
|
18
19
|
resolved_params = newrelic_resolved_request_params(params)
|
19
20
|
wrapped_request = ::NewRelic::Agent::HTTPClients::ExconHTTPRequest.new(resolved_params)
|
20
|
-
segment = NewRelic::Agent::
|
21
|
+
segment = NewRelic::Agent::Tracer.start_external_request_segment(
|
21
22
|
library: wrapped_request.type,
|
22
23
|
uri: wrapped_request.uri,
|
23
24
|
procedure: wrapped_request.method
|
@@ -27,10 +28,12 @@ module ::Excon
|
|
27
28
|
response = nil
|
28
29
|
segment.add_request_headers wrapped_request
|
29
30
|
|
30
|
-
response =
|
31
|
+
response = NewRelic::Agent::Tracer.capture_segment_error segment do
|
32
|
+
request_without_newrelic_trace(resolved_params, &block)
|
33
|
+
end
|
31
34
|
|
32
35
|
wrapped_response = ::NewRelic::Agent::HTTPClients::ExconHTTPResponse.new(response)
|
33
|
-
segment.
|
36
|
+
segment.process_response_headers wrapped_response
|
34
37
|
|
35
38
|
response
|
36
39
|
ensure
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
# This file is distributed under New Relic's license terms.
|
3
|
-
# See https://github.com/newrelic/
|
3
|
+
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
4
|
|
5
5
|
module ::Excon
|
6
6
|
module Middleware
|
@@ -19,7 +19,7 @@ module ::Excon
|
|
19
19
|
# accompanying response_call/error_call.
|
20
20
|
if datum[:connection] && !datum[:connection].instance_variable_get(TRACE_DATA_IVAR)
|
21
21
|
wrapped_request = ::NewRelic::Agent::HTTPClients::ExconHTTPRequest.new(datum)
|
22
|
-
segment = NewRelic::Agent::
|
22
|
+
segment = NewRelic::Agent::Tracer.start_external_request_segment(
|
23
23
|
library: wrapped_request.type,
|
24
24
|
uri: wrapped_request.uri,
|
25
25
|
procedure: wrapped_request.method
|
@@ -49,11 +49,12 @@ module ::Excon
|
|
49
49
|
segment = datum[:connection] && datum[:connection].instance_variable_get(TRACE_DATA_IVAR)
|
50
50
|
if segment
|
51
51
|
begin
|
52
|
+
segment.notice_error(datum[:error]) if datum[:error]
|
52
53
|
datum[:connection].instance_variable_set(TRACE_DATA_IVAR, nil)
|
53
54
|
|
54
55
|
if datum[:response]
|
55
56
|
wrapped_response = ::NewRelic::Agent::HTTPClients::ExconHTTPResponse.new(datum[:response])
|
56
|
-
segment.
|
57
|
+
segment.process_response_headers wrapped_response
|
57
58
|
end
|
58
59
|
ensure
|
59
60
|
segment.finish if segment
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
# This file is distributed under New Relic's license terms.
|
3
|
-
# See https://github.com/newrelic/
|
3
|
+
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
4
|
|
5
5
|
require 'new_relic/agent/parameter_filtering'
|
6
6
|
|
@@ -14,7 +14,6 @@ module NewRelic
|
|
14
14
|
API_VERSION = 'api.version'.freeze
|
15
15
|
FORMAT_REGEX = /\(\/?\.[\:\w]*\)/.freeze # either :format (< 0.12.0) or .ext (>= 0.12.0)
|
16
16
|
VERSION_REGEX = /:version(\/|$)/.freeze
|
17
|
-
EMPTY_STRING = ''.freeze
|
18
17
|
MIN_VERSION = Gem::Version.new("0.2.0")
|
19
18
|
PIPE_STRING = '|'.freeze
|
20
19
|
|
@@ -26,39 +25,39 @@ module NewRelic
|
|
26
25
|
|
27
26
|
def name_transaction(route, class_name, version)
|
28
27
|
txn_name = name_for_transaction(route, class_name, version)
|
29
|
-
|
30
|
-
Transaction.set_default_transaction_name(txn_name, :grape
|
28
|
+
segment_name = "Middleware/Grape/#{class_name}/call"
|
29
|
+
Transaction.set_default_transaction_name(txn_name, :grape)
|
30
|
+
txn = NewRelic::Agent::Transaction.tl_current
|
31
|
+
txn.segments.last.name = segment_name
|
31
32
|
end
|
32
33
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
"#{class_name}#{action_name} (#{method_name})"
|
48
|
-
end
|
34
|
+
def name_for_transaction(route, class_name, version)
|
35
|
+
action_name = route.path.sub(FORMAT_REGEX, NewRelic::EMPTY_STR)
|
36
|
+
method_name = route.request_method
|
37
|
+
version ||= route.version
|
38
|
+
|
39
|
+
# defaulting does not set rack.env['api.version'] and route.version may return Array
|
40
|
+
#
|
41
|
+
version = version.join(PIPE_STRING) if Array === version
|
42
|
+
|
43
|
+
if version
|
44
|
+
action_name = action_name.sub(VERSION_REGEX, NewRelic::EMPTY_STR)
|
45
|
+
"#{class_name}-#{version}#{action_name} (#{method_name})"
|
46
|
+
else
|
47
|
+
"#{class_name}#{action_name} (#{method_name})"
|
49
48
|
end
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
49
|
+
end
|
50
|
+
|
51
|
+
def name_for_transaction_deprecated(route, class_name, version)
|
52
|
+
action_name = route.route_path.sub(FORMAT_REGEX, NewRelic::EMPTY_STR)
|
53
|
+
method_name = route.route_method
|
54
|
+
version ||= route.route_version
|
55
|
+
|
56
|
+
if version
|
57
|
+
action_name = action_name.sub(VERSION_REGEX, NewRelic::EMPTY_STR)
|
58
|
+
"#{class_name}-#{version}#{action_name} (#{method_name})"
|
59
|
+
else
|
60
|
+
"#{class_name}#{action_name} (#{method_name})"
|
62
61
|
end
|
63
62
|
end
|
64
63
|
|
@@ -109,7 +108,18 @@ DependencyDetection.defer do
|
|
109
108
|
end
|
110
109
|
|
111
110
|
def instrument_call
|
112
|
-
::Grape::
|
111
|
+
if defined?(Grape::VERSION) && Gem::Version.new(::Grape::VERSION) >= Gem::Version.new("0.16.0")
|
112
|
+
::NewRelic::Agent::Instrumentation::GrapeInstrumentation.send :remove_method, :name_for_transaction_deprecated
|
113
|
+
else
|
114
|
+
::NewRelic::Agent::Instrumentation::GrapeInstrumentation.send :remove_method, :name_for_transaction
|
115
|
+
::NewRelic::Agent::Instrumentation::GrapeInstrumentation.send :alias_method, :name_for_transaction, :name_for_transaction_deprecated
|
116
|
+
end
|
117
|
+
|
118
|
+
# Since 1.2.0, the class `Grape::API` no longer refers to an API instance, rather, what used to be `Grape::API` is `Grape::API::Instance`
|
119
|
+
# https://github.com/ruby-grape/grape/blob/c20a73ac1e3f3ba1082005ed61bf69452373ba87/UPGRADING.md#upgrading-to--120
|
120
|
+
grape_api_class = defined?(Grape::API::Instance) ? ::Grape::API::Instance : ::Grape::API
|
121
|
+
|
122
|
+
grape_api_class.class_eval do
|
113
123
|
def call_with_new_relic(env)
|
114
124
|
begin
|
115
125
|
response = call_without_new_relic(env)
|
@@ -117,7 +127,9 @@ DependencyDetection.defer do
|
|
117
127
|
begin
|
118
128
|
endpoint = env[::NewRelic::Agent::Instrumentation::GrapeInstrumentation::API_ENDPOINT]
|
119
129
|
version = env[::NewRelic::Agent::Instrumentation::GrapeInstrumentation::API_VERSION]
|
120
|
-
|
130
|
+
|
131
|
+
api_class = (self.class.respond_to?(:base) && self.class.base) || self.class
|
132
|
+
::NewRelic::Agent::Instrumentation::GrapeInstrumentation.handle_transaction(endpoint, api_class.name, version)
|
121
133
|
rescue => e
|
122
134
|
::NewRelic::Agent.logger.warn("Error in Grape instrumentation", e)
|
123
135
|
end
|
@@ -130,5 +142,4 @@ DependencyDetection.defer do
|
|
130
142
|
alias_method :call, :call_with_new_relic
|
131
143
|
end
|
132
144
|
end
|
133
|
-
|
134
145
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
# This file is distributed under New Relic's license terms.
|
3
|
-
# See https://github.com/newrelic/
|
3
|
+
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
4
|
|
5
5
|
DependencyDetection.defer do
|
6
6
|
named :httprb
|
@@ -11,7 +11,7 @@ DependencyDetection.defer do
|
|
11
11
|
|
12
12
|
executes do
|
13
13
|
::NewRelic::Agent.logger.info 'Installing http.rb instrumentation'
|
14
|
-
require 'new_relic/agent/cross_app_tracing'
|
14
|
+
require 'new_relic/agent/distributed_tracing/cross_app_tracing'
|
15
15
|
require 'new_relic/agent/http_clients/http_rb_wrappers'
|
16
16
|
end
|
17
17
|
|
@@ -21,7 +21,7 @@ DependencyDetection.defer do
|
|
21
21
|
wrapped_request = ::NewRelic::Agent::HTTPClients::HTTPRequest.new(request)
|
22
22
|
|
23
23
|
begin
|
24
|
-
segment = NewRelic::Agent::
|
24
|
+
segment = NewRelic::Agent::Tracer.start_external_request_segment(
|
25
25
|
library: wrapped_request.type,
|
26
26
|
uri: wrapped_request.uri,
|
27
27
|
procedure: wrapped_request.method
|
@@ -29,9 +29,12 @@ DependencyDetection.defer do
|
|
29
29
|
|
30
30
|
segment.add_request_headers wrapped_request
|
31
31
|
|
32
|
-
response =
|
32
|
+
response = NewRelic::Agent::Tracer.capture_segment_error segment do
|
33
|
+
perform_without_newrelic_trace(request, options)
|
34
|
+
end
|
35
|
+
|
33
36
|
wrapped_response = ::NewRelic::Agent::HTTPClients::HTTPResponse.new response
|
34
|
-
segment.
|
37
|
+
segment.process_response_headers wrapped_response
|
35
38
|
|
36
39
|
response
|
37
40
|
ensure
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
# This file is distributed under New Relic's license terms.
|
3
|
-
# See https://github.com/newrelic/
|
3
|
+
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
4
|
|
5
5
|
DependencyDetection.defer do
|
6
6
|
named :httpclient
|
@@ -20,7 +20,7 @@ DependencyDetection.defer do
|
|
20
20
|
|
21
21
|
executes do
|
22
22
|
::NewRelic::Agent.logger.info 'Installing HTTPClient instrumentation'
|
23
|
-
require 'new_relic/agent/cross_app_tracing'
|
23
|
+
require 'new_relic/agent/distributed_tracing/cross_app_tracing'
|
24
24
|
require 'new_relic/agent/http_clients/httpclient_wrappers'
|
25
25
|
end
|
26
26
|
|
@@ -28,7 +28,7 @@ DependencyDetection.defer do
|
|
28
28
|
class HTTPClient
|
29
29
|
def do_get_block_with_newrelic(req, proxy, conn, &block)
|
30
30
|
wrapped_request = NewRelic::Agent::HTTPClients::HTTPClientRequest.new(req)
|
31
|
-
segment = NewRelic::Agent::
|
31
|
+
segment = NewRelic::Agent::Tracer.start_external_request_segment(
|
32
32
|
library: wrapped_request.type,
|
33
33
|
uri: wrapped_request.uri,
|
34
34
|
procedure: wrapped_request.method
|
@@ -38,12 +38,14 @@ DependencyDetection.defer do
|
|
38
38
|
response = nil
|
39
39
|
segment.add_request_headers wrapped_request
|
40
40
|
|
41
|
-
|
41
|
+
NewRelic::Agent::Tracer.capture_segment_error segment do
|
42
|
+
do_get_block_without_newrelic(req, proxy, conn, &block)
|
43
|
+
end
|
42
44
|
response = conn.pop
|
43
45
|
conn.push response
|
44
46
|
|
45
47
|
wrapped_response = ::NewRelic::Agent::HTTPClients::HTTPClientResponse.new(response)
|
46
|
-
segment.
|
48
|
+
segment.process_response_headers wrapped_response
|
47
49
|
|
48
50
|
response
|
49
51
|
ensure
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
# This file is distributed under New Relic's license terms.
|
3
|
-
# See https://github.com/newrelic/
|
3
|
+
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
4
|
|
5
5
|
module NewRelic
|
6
6
|
module Agent
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
# This file is distributed under New Relic's license terms.
|
3
|
-
# See https://github.com/newrelic/
|
3
|
+
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
4
|
|
5
5
|
# NOTE there are multiple implementations of the MemCache client in Ruby,
|
6
6
|
# each with slightly different API's and semantics.
|
@@ -41,12 +41,14 @@ module NewRelic
|
|
41
41
|
alias_method method_name_without, method_name
|
42
42
|
|
43
43
|
define_method method_name do |*args, &block|
|
44
|
-
segment = NewRelic::Agent::
|
44
|
+
segment = NewRelic::Agent::Tracer.start_datastore_segment(
|
45
45
|
product: "Memcached",
|
46
46
|
operation: method_name
|
47
47
|
)
|
48
48
|
begin
|
49
|
-
|
49
|
+
NewRelic::Agent::Tracer.capture_segment_error segment do
|
50
|
+
send method_name_without, *args, &block
|
51
|
+
end
|
50
52
|
ensure
|
51
53
|
if NewRelic::Agent.config[:capture_memcache_keys]
|
52
54
|
segment.notice_nosql_statement "#{method_name} #{args.first.inspect}"
|