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
@@ -9,17 +9,17 @@ require 'new_relic/agent/database/obfuscator'
|
|
9
9
|
module NewRelic
|
10
10
|
# columns for a mysql explain plan
|
11
11
|
MYSQL_EXPLAIN_COLUMNS = [
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
12
|
+
"Id",
|
13
|
+
"Select Type",
|
14
|
+
"Table",
|
15
|
+
"Type",
|
16
|
+
"Possible Keys",
|
17
|
+
"Key",
|
18
|
+
"Key Length",
|
19
|
+
"Ref",
|
20
|
+
"Rows",
|
21
|
+
"Extra"
|
22
|
+
].freeze
|
23
23
|
|
24
24
|
module Agent
|
25
25
|
module Database
|
@@ -57,7 +57,7 @@ module NewRelic
|
|
57
57
|
Obfuscator.instance.set_sql_obfuscator(type, &block)
|
58
58
|
end
|
59
59
|
|
60
|
-
def record_sql_method(config_section
|
60
|
+
def record_sql_method(config_section = :transaction_tracer)
|
61
61
|
key = record_sql_method_key(config_section)
|
62
62
|
|
63
63
|
case Agent.config[key].to_s
|
@@ -87,11 +87,11 @@ module NewRelic
|
|
87
87
|
|
88
88
|
RECORD_FOR = [:raw, :obfuscated].freeze
|
89
89
|
|
90
|
-
def should_record_sql?(config_section
|
90
|
+
def should_record_sql?(config_section = :transaction_tracer)
|
91
91
|
RECORD_FOR.include?(record_sql_method(config_section))
|
92
92
|
end
|
93
93
|
|
94
|
-
def should_collect_explain_plans?(config_section
|
94
|
+
def should_collect_explain_plans?(config_section = :transaction_tracer)
|
95
95
|
should_record_sql?(config_section) &&
|
96
96
|
Agent.config["#{config_section}.explain_enabled".to_sym]
|
97
97
|
end
|
@@ -131,15 +131,15 @@ module NewRelic
|
|
131
131
|
'execute',
|
132
132
|
'call'
|
133
133
|
]
|
134
|
-
|
134
|
+
OTHER_OPERATION = 'other'.freeze
|
135
135
|
SQL_COMMENT_REGEX = Regexp.new('/\*.*?\*/', Regexp::MULTILINE).freeze
|
136
136
|
|
137
137
|
def parse_operation_from_query(sql)
|
138
138
|
sql = Helper.correctly_encoded(sql).gsub(SQL_COMMENT_REGEX, NewRelic::EMPTY_STR)
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
139
|
+
return unless sql =~ /(\w+)/
|
140
|
+
|
141
|
+
op = Regexp.last_match(1).downcase
|
142
|
+
KNOWN_OPERATIONS.include?(op) ? op : OTHER_OPERATION
|
143
143
|
end
|
144
144
|
|
145
145
|
class ConnectionManager
|
@@ -185,7 +185,7 @@ module NewRelic
|
|
185
185
|
|
186
186
|
DEFAULT_QUERY_NAME = "SQL".freeze
|
187
187
|
|
188
|
-
def initialize(sql, config={}, explainer=nil, binds=nil, name=DEFAULT_QUERY_NAME, host=nil, port_path_or_id=nil, database_name=nil)
|
188
|
+
def initialize(sql, config = {}, explainer = nil, binds = nil, name = DEFAULT_QUERY_NAME, host = nil, port_path_or_id = nil, database_name = nil)
|
189
189
|
@sql = Database.capture_query(sql)
|
190
190
|
@config = config
|
191
191
|
@explainer = explainer
|
@@ -205,9 +205,7 @@ module NewRelic
|
|
205
205
|
Database.obfuscate_sql(self)
|
206
206
|
when :raw
|
207
207
|
sql.to_s
|
208
|
-
|
209
|
-
nil
|
210
|
-
end
|
208
|
+
end
|
211
209
|
end
|
212
210
|
|
213
211
|
# This takes a connection config hash from ActiveRecord or Sequel and
|
@@ -220,17 +218,18 @@ module NewRelic
|
|
220
218
|
elsif @config[:uri] && @config[:uri].to_s =~ /^jdbc:([^:]+):/
|
221
219
|
# This case is for Sequel with the jdbc-mysql, jdbc-postgres, or jdbc-sqlite3 gems.
|
222
220
|
symbolized_adapter($1)
|
223
|
-
else
|
224
|
-
nil
|
225
221
|
end
|
226
222
|
end
|
227
223
|
|
228
224
|
def explain
|
229
225
|
return unless explainable?
|
230
226
|
handle_exception_in_explain do
|
231
|
-
start =
|
227
|
+
start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
232
228
|
plan = @explainer.call(self)
|
233
|
-
::NewRelic::Agent.record_metric(
|
229
|
+
::NewRelic::Agent.record_metric(
|
230
|
+
"Supportability/Database/execute_explain_plan",
|
231
|
+
Process.clock_gettime(Process::CLOCK_MONOTONIC) - start
|
232
|
+
)
|
234
233
|
return process_resultset(plan, adapter) if plan
|
235
234
|
end
|
236
235
|
end
|
@@ -244,11 +243,11 @@ module NewRelic
|
|
244
243
|
|
245
244
|
private
|
246
245
|
|
247
|
-
POSTGIS_PREFIX
|
246
|
+
POSTGIS_PREFIX = 'postgis'.freeze
|
248
247
|
POSTGRES_PREFIX = 'postgres'.freeze
|
249
|
-
MYSQL_PREFIX
|
250
|
-
MYSQL2_PREFIX
|
251
|
-
SQLITE_PREFIX
|
248
|
+
MYSQL_PREFIX = 'mysql'.freeze
|
249
|
+
MYSQL2_PREFIX = 'mysql2'.freeze
|
250
|
+
SQLITE_PREFIX = 'sqlite'.freeze
|
252
251
|
|
253
252
|
def symbolized_adapter(adapter)
|
254
253
|
if adapter.start_with?(POSTGRES_PREFIX) || adapter == POSTGIS_PREFIX
|
@@ -6,9 +6,9 @@ module NewRelic
|
|
6
6
|
module Agent
|
7
7
|
module Datastores
|
8
8
|
module MetricHelper
|
9
|
-
ROLLUP_METRIC
|
10
|
-
WEB_ROLLUP_METRIC
|
11
|
-
OTHER_ROLLUP_METRIC
|
9
|
+
ROLLUP_METRIC = "Datastore/all".freeze
|
10
|
+
WEB_ROLLUP_METRIC = "Datastore/allWeb".freeze
|
11
|
+
OTHER_ROLLUP_METRIC = "Datastore/allOther".freeze
|
12
12
|
DEFAULT_PRODUCT_NAME = "ActiveRecord".freeze
|
13
13
|
OTHER = "Other".freeze
|
14
14
|
|
@@ -48,7 +48,7 @@ module NewRelic
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
-
def self.scoped_metric_for product, operation, collection=nil
|
51
|
+
def self.scoped_metric_for product, operation, collection = nil
|
52
52
|
if collection
|
53
53
|
statement_metric_for product, collection, operation
|
54
54
|
else
|
@@ -56,7 +56,7 @@ module NewRelic
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
-
def self.unscoped_metrics_for product, operation, collection=nil, host=nil, port_path_or_id=nil
|
59
|
+
def self.unscoped_metrics_for product, operation, collection = nil, host = nil, port_path_or_id = nil
|
60
60
|
suffix = all_suffix
|
61
61
|
|
62
62
|
metrics = [
|
@@ -74,17 +74,17 @@ module NewRelic
|
|
74
74
|
metrics
|
75
75
|
end
|
76
76
|
|
77
|
-
def self.product_operation_collection_for product, operation, collection=nil, generic_product = nil
|
77
|
+
def self.product_operation_collection_for product, operation, collection = nil, generic_product = nil
|
78
78
|
if overrides = overridden_operation_and_collection
|
79
79
|
if should_override?(overrides, product, generic_product)
|
80
|
-
operation
|
80
|
+
operation = overrides[0] || operation
|
81
81
|
collection = overrides[1] || collection
|
82
82
|
end
|
83
83
|
end
|
84
84
|
[product, operation, collection]
|
85
85
|
end
|
86
86
|
|
87
|
-
def self.metrics_for(product, operation, collection = nil, generic_product = nil, host=nil, port_path_or_id=nil)
|
87
|
+
def self.metrics_for(product, operation, collection = nil, generic_product = nil, host = nil, port_path_or_id = nil)
|
88
88
|
product, operation, collection = product_operation_collection_for(product, operation, collection, generic_product)
|
89
89
|
|
90
90
|
# Order of these metrics matters--the first metric in the list will
|
@@ -101,13 +101,15 @@ module NewRelic
|
|
101
101
|
end
|
102
102
|
|
103
103
|
def self.operation_from_sql(sql)
|
104
|
-
NewRelic::Agent::Database.parse_operation_from_query(sql)
|
104
|
+
operation = NewRelic::Agent::Database.parse_operation_from_query(sql)
|
105
|
+
operation = OTHER if operation.eql?(NewRelic::Agent::Database::OTHER_OPERATION)
|
106
|
+
operation
|
105
107
|
end
|
106
108
|
|
107
109
|
# Allow Transaction#with_database_metric_name to override our
|
108
110
|
# collection and operation
|
109
|
-
def self.overridden_operation_and_collection #THREAD_LOCAL_ACCESS
|
110
|
-
txn
|
111
|
+
def self.overridden_operation_and_collection # THREAD_LOCAL_ACCESS
|
112
|
+
txn = Tracer.current_transaction
|
111
113
|
txn ? txn.instrumentation_state[:datastore_override] : nil
|
112
114
|
end
|
113
115
|
|
@@ -8,12 +8,11 @@ module NewRelic
|
|
8
8
|
module Datastores
|
9
9
|
module Mongo
|
10
10
|
module EventFormatter
|
11
|
-
|
12
11
|
# Keys that will get their values replaced with '?'.
|
13
|
-
OBFUSCATE_KEYS = [
|
12
|
+
OBFUSCATE_KEYS = ['filter', 'query', 'pipeline'].freeze
|
14
13
|
|
15
14
|
# Keys that will get completely removed from the statement.
|
16
|
-
DENYLISTED_KEYS = [
|
15
|
+
DENYLISTED_KEYS = ['deletes', 'documents', 'updates'].freeze
|
17
16
|
|
18
17
|
def self.format(command_name, database_name, command)
|
19
18
|
return nil unless NewRelic::Agent.config[:'mongo.capture_queries']
|
@@ -15,8 +15,8 @@ module NewRelic
|
|
15
15
|
|
16
16
|
if collection_in_selector?(payload)
|
17
17
|
command_key = command_key_from_selector(payload)
|
18
|
-
name
|
19
|
-
collection
|
18
|
+
name = get_name_from_selector(command_key, payload)
|
19
|
+
collection = get_collection_from_selector(command_key, payload)
|
20
20
|
else
|
21
21
|
collection = payload[:collection]
|
22
22
|
end
|
@@ -79,7 +79,7 @@ module NewRelic
|
|
79
79
|
|
80
80
|
:collstats,
|
81
81
|
:renameCollection,
|
82
|
-
:drop
|
82
|
+
:drop
|
83
83
|
]
|
84
84
|
|
85
85
|
def self.command_key_from_selector(payload)
|
@@ -176,9 +176,7 @@ module NewRelic
|
|
176
176
|
parts.shift
|
177
177
|
parts.join('.')
|
178
178
|
end
|
179
|
-
|
180
179
|
end
|
181
|
-
|
182
180
|
end
|
183
181
|
end
|
184
182
|
end
|
@@ -7,7 +7,6 @@ module NewRelic
|
|
7
7
|
module Datastores
|
8
8
|
module Mongo
|
9
9
|
module Obfuscator
|
10
|
-
|
11
10
|
ALLOWLIST = [:operation].freeze
|
12
11
|
|
13
12
|
def self.obfuscate_statement(source, allowlist = ALLOWLIST)
|
@@ -32,7 +31,7 @@ module NewRelic
|
|
32
31
|
if value.is_a?(Hash)
|
33
32
|
obfuscate_statement(value, allowlist)
|
34
33
|
elsif value.is_a?(Array)
|
35
|
-
value.map {|v| obfuscate_value(v, allowlist)}
|
34
|
+
value.map { |v| obfuscate_value(v, allowlist) }
|
36
35
|
else
|
37
36
|
QUESTION_MARK
|
38
37
|
end
|
@@ -7,22 +7,17 @@ module NewRelic
|
|
7
7
|
module Datastores
|
8
8
|
module Mongo
|
9
9
|
def self.is_supported_version?
|
10
|
-
|
11
|
-
defined?(::Mongo) && (defined?(::Mongo::MongoClient) || is_monitoring_enabled?)
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.is_monitoring_enabled?
|
15
|
-
defined?(::Mongo::Monitoring) # @since 2.1.0
|
10
|
+
defined?(::Mongo) && is_monitoring_enabled?
|
16
11
|
end
|
17
12
|
|
18
13
|
def self.is_unsupported_2x?
|
19
|
-
defined?(::Mongo::VERSION) &&
|
14
|
+
defined?(::Mongo::VERSION) &&
|
15
|
+
Gem::Version.new(::Mongo::VERSION).segments[0] == 2 &&
|
20
16
|
!self.is_monitoring_enabled?
|
21
17
|
end
|
22
18
|
|
23
|
-
def self.
|
24
|
-
#
|
25
|
-
defined?(::Mongo::CollectionOperationWriter)
|
19
|
+
def self.is_monitoring_enabled?
|
20
|
+
defined?(::Mongo::Monitoring) # @since 2.1.0
|
26
21
|
end
|
27
22
|
end
|
28
23
|
end
|
@@ -10,7 +10,7 @@ module NewRelic
|
|
10
10
|
|
11
11
|
MAXIMUM_COMMAND_LENGTH = 1000
|
12
12
|
MAXIMUM_ARGUMENT_LENGTH = 64
|
13
|
-
CHUNK_SIZE
|
13
|
+
CHUNK_SIZE = (MAXIMUM_ARGUMENT_LENGTH - 5) / 2
|
14
14
|
PREFIX_RANGE = (0...CHUNK_SIZE)
|
15
15
|
SUFFIX_RANGE = (-CHUNK_SIZE..-1)
|
16
16
|
|
@@ -32,8 +32,6 @@ module NewRelic
|
|
32
32
|
trim_result(result) if result.length >= MAXIMUM_COMMAND_LENGTH
|
33
33
|
result.strip!
|
34
34
|
result
|
35
|
-
else
|
36
|
-
nil
|
37
35
|
end
|
38
36
|
end
|
39
37
|
|
@@ -117,7 +115,7 @@ module NewRelic
|
|
117
115
|
end
|
118
116
|
|
119
117
|
def self.trim_result(result)
|
120
|
-
result.slice!((MAXIMUM_COMMAND_LENGTH-ELLIPSES.length)..-1)
|
118
|
+
result.slice!((MAXIMUM_COMMAND_LENGTH - ELLIPSES.length)..-1)
|
121
119
|
result.strip!
|
122
120
|
result << ELLIPSES
|
123
121
|
end
|
@@ -13,7 +13,6 @@ module NewRelic
|
|
13
13
|
#
|
14
14
|
# @api public
|
15
15
|
module Datastores
|
16
|
-
|
17
16
|
# @!group Tracing query methods
|
18
17
|
|
19
18
|
# Add Datastore tracing to a method. This properly generates the metrics
|
@@ -21,7 +20,7 @@ module NewRelic
|
|
21
20
|
# query content into Transaction Traces. Use wrap if you want to provide
|
22
21
|
# that functionality.
|
23
22
|
#
|
24
|
-
# @param [Class]
|
23
|
+
# @param [Class] klass the class to instrument
|
25
24
|
#
|
26
25
|
# @param [String, Symbol] method_name the name of instance method to
|
27
26
|
# instrument
|
@@ -33,16 +32,16 @@ module NewRelic
|
|
33
32
|
#
|
34
33
|
# @api public
|
35
34
|
#
|
36
|
-
def self.trace(
|
35
|
+
def self.trace(klass, method_name, product, operation = method_name)
|
37
36
|
NewRelic::Agent.record_api_supportability_metric(:trace)
|
38
37
|
|
39
|
-
|
38
|
+
klass.class_eval do
|
40
39
|
method_name_without_newrelic = "#{method_name}_without_newrelic"
|
41
40
|
|
42
|
-
if NewRelic::Helper.instance_methods_include?(
|
43
|
-
|
41
|
+
if NewRelic::Helper.instance_methods_include?(klass, method_name) &&
|
42
|
+
!NewRelic::Helper.instance_methods_include?(klass, method_name_without_newrelic)
|
44
43
|
|
45
|
-
visibility = NewRelic::Helper.instance_method_visibility(
|
44
|
+
visibility = NewRelic::Helper.instance_method_visibility(klass, method_name)
|
46
45
|
|
47
46
|
alias_method method_name_without_newrelic, method_name
|
48
47
|
|
@@ -123,7 +122,7 @@ module NewRelic
|
|
123
122
|
ensure
|
124
123
|
begin
|
125
124
|
if callback
|
126
|
-
elapsed_time = (
|
125
|
+
elapsed_time = Process.clock_gettime(Process::CLOCK_REALTIME) - segment.start_time
|
127
126
|
callback.call(result, segment.name, elapsed_time)
|
128
127
|
end
|
129
128
|
ensure
|
@@ -202,7 +201,6 @@ module NewRelic
|
|
202
201
|
end
|
203
202
|
nil
|
204
203
|
end
|
205
|
-
|
206
204
|
end
|
207
205
|
end
|
208
206
|
end
|
@@ -8,26 +8,26 @@ module NewRelic
|
|
8
8
|
attr_reader :id, :transaction, :referring_guid, :referring_trip_id, :referring_path_hash
|
9
9
|
|
10
10
|
def initialize(id, transaction, transaction_info)
|
11
|
-
@id
|
12
|
-
@transaction
|
11
|
+
@id = id
|
12
|
+
@transaction = transaction
|
13
13
|
|
14
14
|
transaction_info ||= []
|
15
|
-
@referring_guid
|
15
|
+
@referring_guid = transaction_info[0]
|
16
16
|
# unused_flag = transaction_info[1]
|
17
|
-
@referring_trip_id
|
17
|
+
@referring_trip_id = string_or_false_for(transaction_info[2])
|
18
18
|
@referring_path_hash = string_or_false_for(transaction_info[3])
|
19
19
|
end
|
20
20
|
|
21
21
|
def as_json_array(content_length)
|
22
|
-
queue_time_in_seconds = [transaction.queue_time
|
23
|
-
start_time_in_seconds = [transaction.start_time
|
24
|
-
app_time_in_seconds
|
22
|
+
queue_time_in_seconds = [transaction.queue_time, 0.0].max
|
23
|
+
start_time_in_seconds = [transaction.start_time, 0.0].max
|
24
|
+
app_time_in_seconds = Process.clock_gettime(Process::CLOCK_REALTIME) - start_time_in_seconds
|
25
25
|
|
26
26
|
[
|
27
27
|
NewRelic::Agent.config[:cross_process_id],
|
28
28
|
transaction.best_name,
|
29
|
-
queue_time_in_seconds
|
30
|
-
app_time_in_seconds
|
29
|
+
queue_time_in_seconds,
|
30
|
+
app_time_in_seconds,
|
31
31
|
content_length,
|
32
32
|
transaction.guid,
|
33
33
|
false
|
@@ -18,7 +18,7 @@ module NewRelic
|
|
18
18
|
# The cross app transaction header for "outgoing" calls
|
19
19
|
NR_TXN_HEADER = 'X-NewRelic-Transaction'
|
20
20
|
|
21
|
-
NR_MESSAGE_BROKER_ID_HEADER
|
21
|
+
NR_MESSAGE_BROKER_ID_HEADER = 'NewRelicID'
|
22
22
|
NR_MESSAGE_BROKER_TXN_HEADER = 'NewRelicTransaction'
|
23
23
|
NR_MESSAGE_BROKER_SYNTHETICS_HEADER = 'NewRelicSynthetics'
|
24
24
|
|
@@ -54,9 +54,10 @@ module NewRelic
|
|
54
54
|
|
55
55
|
def insert_cross_app_header headers
|
56
56
|
return unless CrossAppTracing.cross_app_enabled?
|
57
|
+
|
57
58
|
@is_cross_app_caller = true
|
58
|
-
txn_guid
|
59
|
-
trip_id
|
59
|
+
txn_guid = transaction.guid
|
60
|
+
trip_id = cat_trip_id
|
60
61
|
path_hash = cat_path_hash
|
61
62
|
|
62
63
|
insert_request_headers headers, txn_guid, trip_id, path_hash
|
@@ -65,17 +66,20 @@ module NewRelic
|
|
65
66
|
def add_message_cat_headers headers
|
66
67
|
return unless CrossAppTracing.cross_app_enabled?
|
67
68
|
@is_cross_app_caller = true
|
68
|
-
insert_message_headers headers,
|
69
|
-
transaction.guid,
|
70
|
-
cat_trip_id,
|
71
|
-
cat_path_hash,
|
69
|
+
insert_message_headers headers,
|
70
|
+
transaction.guid,
|
71
|
+
cat_trip_id,
|
72
|
+
cat_path_hash,
|
72
73
|
transaction.raw_synthetics_header
|
73
74
|
end
|
74
75
|
|
75
76
|
def record_cross_app_metrics
|
76
77
|
if (id = cross_app_payload && cross_app_payload.id)
|
77
|
-
app_time_in_seconds = [
|
78
|
-
|
78
|
+
app_time_in_seconds = [
|
79
|
+
Process.clock_gettime(Process::CLOCK_REALTIME) - transaction.start_time,
|
80
|
+
0.0
|
81
|
+
].max
|
82
|
+
NewRelic::Agent.record_metric("ClientApplication/#{id}/all", app_time_in_seconds)
|
79
83
|
end
|
80
84
|
end
|
81
85
|
|
@@ -87,7 +91,7 @@ module NewRelic
|
|
87
91
|
private
|
88
92
|
|
89
93
|
def insert_message_headers headers, txn_guid, trip_id, path_hash, synthetics_header
|
90
|
-
headers[NR_MESSAGE_BROKER_ID_HEADER]
|
94
|
+
headers[NR_MESSAGE_BROKER_ID_HEADER] = obfuscator.obfuscate(Agent.config[:cross_process_id])
|
91
95
|
headers[NR_MESSAGE_BROKER_TXN_HEADER] = obfuscator.obfuscate(::JSON.dump([txn_guid, false, trip_id, path_hash]))
|
92
96
|
headers[NR_MESSAGE_BROKER_SYNTHETICS_HEADER] = synthetics_header if synthetics_header
|
93
97
|
end
|
@@ -112,11 +116,11 @@ module NewRelic
|
|
112
116
|
payload[:guid] = transaction.guid
|
113
117
|
|
114
118
|
return unless is_cross_app?
|
115
|
-
trip_id
|
116
|
-
path_hash
|
119
|
+
trip_id = cat_trip_id
|
120
|
+
path_hash = cat_path_hash
|
117
121
|
referring_path_hash = cat_referring_path_hash
|
118
122
|
|
119
|
-
payload[:cat_trip_id]
|
123
|
+
payload[:cat_trip_id] = trip_id if trip_id
|
120
124
|
payload[:cat_referring_path_hash] = referring_path_hash if referring_path_hash
|
121
125
|
|
122
126
|
if path_hash
|
@@ -131,6 +135,7 @@ module NewRelic
|
|
131
135
|
|
132
136
|
###############
|
133
137
|
module_function
|
138
|
+
|
134
139
|
###############
|
135
140
|
|
136
141
|
def cross_app_enabled?
|
@@ -169,9 +174,9 @@ module NewRelic
|
|
169
174
|
|
170
175
|
def insert_request_headers request, txn_guid, trip_id, path_hash
|
171
176
|
cross_app_id = NewRelic::Agent.config[:cross_process_id]
|
172
|
-
txn_data
|
177
|
+
txn_data = ::JSON.dump([txn_guid, false, trip_id, path_hash])
|
173
178
|
|
174
|
-
request[NR_ID_HEADER]
|
179
|
+
request[NR_ID_HEADER] = obfuscator.obfuscate(cross_app_id)
|
175
180
|
request[NR_TXN_HEADER] = obfuscator.obfuscate(txn_data)
|
176
181
|
end
|
177
182
|
|
@@ -214,7 +219,7 @@ module NewRelic
|
|
214
219
|
end
|
215
220
|
|
216
221
|
def reject_messaging_cat_headers headers
|
217
|
-
headers.reject {|k,_| k == NR_MESSAGE_BROKER_ID_HEADER || k == NR_MESSAGE_BROKER_TXN_HEADER}
|
222
|
+
headers.reject { |k, _| k == NR_MESSAGE_BROKER_ID_HEADER || k == NR_MESSAGE_BROKER_TXN_HEADER }
|
218
223
|
end
|
219
224
|
|
220
225
|
def trusts? id
|
@@ -10,16 +10,16 @@ module NewRelic
|
|
10
10
|
|
11
11
|
# Intrinsic Keys
|
12
12
|
INTRINSIC_KEYS = [
|
13
|
-
PARENT_TYPE_KEY
|
14
|
-
PARENT_APP_KEY
|
15
|
-
PARENT_ACCOUNT_ID_KEY
|
16
|
-
PARENT_TRANSPORT_TYPE_KEY
|
17
|
-
PARENT_TRANSPORT_DURATION_KEY
|
18
|
-
GUID_KEY
|
19
|
-
TRACE_ID_KEY
|
20
|
-
PARENT_TRANSACTION_ID_KEY
|
21
|
-
PARENT_SPAN_ID_KEY
|
22
|
-
SAMPLED_KEY
|
13
|
+
PARENT_TYPE_KEY = "parent.type",
|
14
|
+
PARENT_APP_KEY = "parent.app",
|
15
|
+
PARENT_ACCOUNT_ID_KEY = "parent.account",
|
16
|
+
PARENT_TRANSPORT_TYPE_KEY = "parent.transportType",
|
17
|
+
PARENT_TRANSPORT_DURATION_KEY = "parent.transportDuration",
|
18
|
+
GUID_KEY = "guid",
|
19
|
+
TRACE_ID_KEY = "traceId",
|
20
|
+
PARENT_TRANSACTION_ID_KEY = "parentId",
|
21
|
+
PARENT_SPAN_ID_KEY = "parentSpanId",
|
22
|
+
SAMPLED_KEY = "sampled"
|
23
23
|
].freeze
|
24
24
|
|
25
25
|
# This method extracts intrinsics from the transaction_payload and
|
@@ -64,7 +64,6 @@ module NewRelic
|
|
64
64
|
destination[PARENT_TYPE_KEY] = trace_payload.parent_type
|
65
65
|
destination[PARENT_APP_KEY] = trace_payload.parent_app_id
|
66
66
|
destination[PARENT_ACCOUNT_ID_KEY] = trace_payload.parent_account_id
|
67
|
-
|
68
67
|
destination[PARENT_TRANSPORT_DURATION_KEY] = transaction.calculate_transport_duration trace_payload
|
69
68
|
|
70
69
|
if parent_transaction_id = transaction.distributed_tracer.parent_transaction_id
|
@@ -78,7 +77,6 @@ module NewRelic
|
|
78
77
|
def enabled?
|
79
78
|
return Agent.config[:'distributed_tracing.enabled']
|
80
79
|
end
|
81
|
-
|
82
80
|
end
|
83
81
|
end
|
84
82
|
end
|