newrelic_rpm 8.2.0 → 8.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/.rubocop.yml +1938 -0
- data/Brewfile +10 -0
- data/CHANGELOG.md +80 -2
- data/CONTRIBUTING.md +19 -3
- data/DOCKER.md +167 -0
- data/Dockerfile +10 -0
- data/Guardfile +8 -8
- data/Rakefile +14 -9
- 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 +7 -3
- data/lib/new_relic/agent/agent.rb +38 -40
- data/lib/new_relic/agent/agent_logger.rb +8 -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/autostart.rb +6 -7
- 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 +0 -3
- data/lib/new_relic/agent/configuration/default_source.rb +347 -330
- data/lib/new_relic/agent/configuration/dotted_hash.rb +3 -3
- data/lib/new_relic/agent/configuration/environment_source.rb +3 -4
- data/lib/new_relic/agent/configuration/event_harvest_config.rb +11 -6
- data/lib/new_relic/agent/configuration/high_security_source.rb +7 -7
- data/lib/new_relic/agent/configuration/manager.rb +74 -63
- 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 +11 -11
- data/lib/new_relic/agent/configuration/yaml_source.rb +9 -9
- data/lib/new_relic/agent/connect/request_builder.rb +13 -16
- data/lib/new_relic/agent/connect/response_handler.rb +0 -3
- data/lib/new_relic/agent/custom_event_aggregator.rb +9 -10
- 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 +20 -24
- data/lib/new_relic/agent/datastores/metric_helper.rb +10 -10
- 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/redis.rb +2 -4
- data/lib/new_relic/agent/datastores.rb +1 -3
- data/lib/new_relic/agent/distributed_tracing/cross_app_payload.rb +5 -5
- data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +11 -10
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +10 -11
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +41 -42
- 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 +23 -23
- 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 +17 -17
- data/lib/new_relic/agent/error_event_aggregator.rb +1 -1
- data/lib/new_relic/agent/error_filter.rb +6 -8
- 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 +10 -10
- data/lib/new_relic/agent/external.rb +1 -2
- 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 +3 -3
- data/lib/new_relic/agent/http_clients/abstract.rb +5 -7
- 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 +2 -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 +9 -10
- data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +5 -7
- data/lib/new_relic/agent/instrumentation/active_job.rb +4 -4
- data/lib/new_relic/agent/instrumentation/active_merchant.rb +2 -2
- data/lib/new_relic/agent/instrumentation/active_record.rb +20 -18
- data/lib/new_relic/agent/instrumentation/active_record_helper.rb +36 -42
- 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 +5 -6
- data/lib/new_relic/agent/instrumentation/active_storage.rb +1 -1
- data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +8 -9
- data/lib/new_relic/agent/instrumentation/bunny/chain.rb +1 -1
- data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +7 -8
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +41 -41
- data/lib/new_relic/agent/instrumentation/curb/chain.rb +19 -20
- data/lib/new_relic/agent/instrumentation/curb/instrumentation.rb +34 -38
- data/lib/new_relic/agent/instrumentation/curb/prepend.rb +9 -10
- data/lib/new_relic/agent/instrumentation/data_mapper.rb +10 -10
- data/lib/new_relic/agent/instrumentation/delayed_job/chain.rb +5 -7
- data/lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb +2 -6
- data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +4 -4
- data/lib/new_relic/agent/instrumentation/excon/middleware.rb +2 -2
- data/lib/new_relic/agent/instrumentation/excon.rb +0 -1
- 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/instrumentation.rb +0 -1
- data/lib/new_relic/agent/instrumentation/logger.rb +1 -1
- data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +2 -1
- data/lib/new_relic/agent/instrumentation/memcache/helper.rb +0 -1
- data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +1 -0
- 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/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 +1 -1
- data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +2 -3
- data/lib/new_relic/agent/instrumentation/padrino/instrumentation.rb +3 -2
- data/lib/new_relic/agent/instrumentation/padrino/prepend.rb +1 -1
- data/lib/new_relic/agent/instrumentation/padrino.rb +0 -5
- data/lib/new_relic/agent/instrumentation/queue_time.rb +5 -5
- data/lib/new_relic/agent/instrumentation/rack/chain.rb +5 -5
- data/lib/new_relic/agent/instrumentation/rack/helpers.rb +0 -1
- data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +4 -5
- data/lib/new_relic/agent/instrumentation/rack/prepend.rb +0 -1
- data/lib/new_relic/agent/instrumentation/rack.rb +1 -1
- data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +6 -6
- 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/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 +1 -1
- data/lib/new_relic/agent/instrumentation/resque/chain.rb +2 -3
- data/lib/new_relic/agent/instrumentation/resque/helper.rb +1 -1
- data/lib/new_relic/agent/instrumentation/resque/instrumentation.rb +4 -4
- data/lib/new_relic/agent/instrumentation/resque/prepend.rb +1 -2
- data/lib/new_relic/agent/instrumentation/resque.rb +7 -7
- 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 +5 -4
- data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +0 -1
- data/lib/new_relic/agent/instrumentation/sinatra/instrumentation.rb +4 -3
- data/lib/new_relic/agent/instrumentation/sunspot.rb +1 -1
- data/lib/new_relic/agent/instrumentation/tilt/instrumentation.rb +0 -1
- 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 +28 -28
- data/lib/new_relic/agent/logging.rb +8 -4
- data/lib/new_relic/agent/memory_logger.rb +1 -1
- data/lib/new_relic/agent/messaging.rb +42 -44
- data/lib/new_relic/agent/method_tracer.rb +11 -14
- data/lib/new_relic/agent/method_tracer_helpers.rb +2 -2
- data/lib/new_relic/agent/monitors/cross_app_monitor.rb +13 -12
- 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 +20 -20
- 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 +5 -6
- data/lib/new_relic/agent/pipe_service.rb +1 -1
- 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/delayed_job_sampler.rb +3 -3
- data/lib/new_relic/agent/samplers/memory_sampler.rb +4 -3
- data/lib/new_relic/agent/samplers/vm_sampler.rb +18 -18
- data/lib/new_relic/agent/span_event_aggregator.rb +8 -8
- data/lib/new_relic/agent/span_event_primitive.rb +39 -39
- data/lib/new_relic/agent/sql_sampler.rb +9 -9
- data/lib/new_relic/agent/stats.rb +16 -16
- 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 +6 -6
- 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 +8 -8
- data/lib/new_relic/agent/threading/thread_profile.rb +15 -18
- data/lib/new_relic/agent/tracer.rb +37 -43
- data/lib/new_relic/agent/transaction/abstract_segment.rb +6 -6
- data/lib/new_relic/agent/transaction/datastore_segment.rb +5 -7
- data/lib/new_relic/agent/transaction/distributed_tracer.rb +7 -9
- data/lib/new_relic/agent/transaction/distributed_tracing.rb +21 -22
- data/lib/new_relic/agent/transaction/external_request_segment.rb +3 -5
- data/lib/new_relic/agent/transaction/message_broker_segment.rb +23 -23
- data/lib/new_relic/agent/transaction/request_attributes.rb +7 -7
- data/lib/new_relic/agent/transaction/segment.rb +3 -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 +1 -3
- data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +1 -2
- data/lib/new_relic/agent/transaction.rb +79 -81
- data/lib/new_relic/agent/transaction_error_primitive.rb +16 -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 +3 -3
- data/lib/new_relic/agent/transaction_sampler.rb +0 -1
- data/lib/new_relic/agent/transaction_time_aggregator.rb +6 -6
- 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/snapshot.rb +3 -3
- data/lib/new_relic/agent/worker_loop.rb +3 -5
- data/lib/new_relic/agent.rb +22 -22
- data/lib/new_relic/cli/command.rb +15 -17
- data/lib/new_relic/cli/commands/deployments.rb +20 -22
- 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/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 +4 -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 +6 -8
- data/lib/new_relic/environment_report.rb +16 -18
- data/lib/new_relic/helper.rb +5 -5
- data/lib/new_relic/language_support.rb +3 -2
- data/lib/new_relic/latest_changes.rb +2 -2
- data/lib/new_relic/local_environment.rb +7 -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 +14 -15
- 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 +1 -2
- data/lib/new_relic/version.rb +4 -15
- data/lib/sequel/extensions/newrelic_instrumentation.rb +4 -7
- data/lib/sequel/plugins/newrelic_instrumentation.rb +3 -9
- data/lib/tasks/all.rb +1 -1
- data/lib/tasks/config.rake +21 -21
- data/lib/tasks/multiverse.rb +4 -6
- data/lib/tasks/tests.rake +3 -7
- data/newrelic.yml +3 -3
- data/newrelic_rpm.gemspec +13 -12
- data/recipes/newrelic.rb +1 -1
- data/test/agent_helper.rb +55 -55
- metadata +38 -4
@@ -11,27 +11,25 @@ require 'new_relic/agent/threading/backtrace_node'
|
|
11
11
|
module NewRelic
|
12
12
|
module Agent
|
13
13
|
module Threading
|
14
|
-
|
15
14
|
class ThreadProfile
|
16
|
-
|
17
15
|
attr_reader :profile_id, :traces, :sample_period,
|
18
16
|
:duration, :poll_count, :backtrace_count, :failure_count,
|
19
17
|
:created_at, :command_arguments, :profile_agent_code
|
20
18
|
attr_accessor :finished_at
|
21
19
|
|
22
|
-
def initialize(command_arguments={})
|
23
|
-
@command_arguments
|
24
|
-
@profile_id
|
25
|
-
@duration
|
26
|
-
@sample_period
|
20
|
+
def initialize(command_arguments = {})
|
21
|
+
@command_arguments = command_arguments
|
22
|
+
@profile_id = command_arguments.fetch('profile_id', -1)
|
23
|
+
@duration = command_arguments.fetch('duration', 120)
|
24
|
+
@sample_period = command_arguments.fetch('sample_period', 0.1)
|
27
25
|
@profile_agent_code = command_arguments.fetch('profile_agent_code', false)
|
28
26
|
@finished = false
|
29
27
|
|
30
28
|
@traces = {
|
31
|
-
:agent
|
29
|
+
:agent => BacktraceRoot.new,
|
32
30
|
:background => BacktraceRoot.new,
|
33
|
-
:other
|
34
|
-
:request
|
31
|
+
:other => BacktraceRoot.new,
|
32
|
+
:request => BacktraceRoot.new
|
35
33
|
}
|
36
34
|
|
37
35
|
@poll_count = 0
|
@@ -69,17 +67,17 @@ module NewRelic
|
|
69
67
|
end
|
70
68
|
end
|
71
69
|
|
72
|
-
def convert_N_trace_nodes_to_arrays(count_to_keep) #THREAD_LOCAL_ACCESS
|
70
|
+
def convert_N_trace_nodes_to_arrays(count_to_keep) # THREAD_LOCAL_ACCESS
|
73
71
|
all_nodes = @traces.values.map { |n| n.flattened }.flatten
|
74
72
|
|
75
|
-
NewRelic::Agent.instance.stats_engine
|
76
|
-
tl_record_supportability_metric_count("ThreadProfiler/NodeCount", all_nodes.size)
|
73
|
+
NewRelic::Agent.instance.stats_engine
|
74
|
+
.tl_record_supportability_metric_count("ThreadProfiler/NodeCount", all_nodes.size)
|
77
75
|
|
78
76
|
all_nodes.sort! do |a, b|
|
79
77
|
# we primarily prefer higher runnable_count
|
80
78
|
comparison = b.runnable_count <=> a.runnable_count
|
81
79
|
# we secondarily prefer lower depth
|
82
|
-
comparison = a.depth
|
80
|
+
comparison = a.depth <=> b.depth if comparison == 0
|
83
81
|
# it is thus impossible for any child to preceed their parent
|
84
82
|
comparison
|
85
83
|
end
|
@@ -102,9 +100,9 @@ module NewRelic
|
|
102
100
|
convert_N_trace_nodes_to_arrays(THREAD_PROFILER_NODES)
|
103
101
|
|
104
102
|
{
|
105
|
-
"OTHER"
|
106
|
-
"REQUEST"
|
107
|
-
"AGENT"
|
103
|
+
"OTHER" => @traces[:other].as_array,
|
104
|
+
"REQUEST" => @traces[:request].as_array,
|
105
|
+
"AGENT" => @traces[:agent].as_array,
|
108
106
|
"BACKGROUND" => @traces[:background].as_array
|
109
107
|
}
|
110
108
|
end
|
@@ -128,7 +126,6 @@ module NewRelic
|
|
128
126
|
"@profile_id: #{profile_id} "\
|
129
127
|
"@command_arguments=#{@command_arguments.inspect}>"
|
130
128
|
end
|
131
|
-
|
132
129
|
end
|
133
130
|
end
|
134
131
|
end
|
@@ -86,9 +86,9 @@ module NewRelic
|
|
86
86
|
#
|
87
87
|
# @api public
|
88
88
|
def in_transaction(name: nil,
|
89
|
-
|
90
|
-
|
91
|
-
|
89
|
+
partial_name: nil,
|
90
|
+
category: nil,
|
91
|
+
options: {})
|
92
92
|
|
93
93
|
finishable = start_transaction_or_segment(
|
94
94
|
name: name,
|
@@ -130,10 +130,10 @@ module NewRelic
|
|
130
130
|
#
|
131
131
|
# @api public
|
132
132
|
def start_transaction_or_segment(name: nil,
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
133
|
+
partial_name: nil,
|
134
|
+
category:,
|
135
|
+
options: {})
|
136
|
+
|
137
137
|
raise ArgumentError, 'missing required argument: name or partial_name' if name.nil? && partial_name.nil?
|
138
138
|
|
139
139
|
if name
|
@@ -150,7 +150,6 @@ module NewRelic
|
|
150
150
|
else
|
151
151
|
Transaction.start_new_transaction(state, category, options)
|
152
152
|
end
|
153
|
-
|
154
153
|
rescue ArgumentError
|
155
154
|
raise
|
156
155
|
rescue => exception
|
@@ -160,10 +159,10 @@ module NewRelic
|
|
160
159
|
# Takes name or partial_name and a category.
|
161
160
|
# Returns a transaction instance or nil
|
162
161
|
def start_transaction(category:,
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
162
|
+
name: nil,
|
163
|
+
partial_name: nil,
|
164
|
+
**options)
|
165
|
+
|
167
166
|
raise ArgumentError, 'missing required argument: name or partial_name' if name.nil? && partial_name.nil?
|
168
167
|
|
169
168
|
return current_transaction if current_transaction
|
@@ -178,8 +177,8 @@ module NewRelic
|
|
178
177
|
end
|
179
178
|
|
180
179
|
Transaction.start_new_transaction(state,
|
181
|
-
|
182
|
-
|
180
|
+
category,
|
181
|
+
options)
|
183
182
|
rescue ArgumentError
|
184
183
|
raise
|
185
184
|
rescue => exception
|
@@ -231,13 +230,12 @@ module NewRelic
|
|
231
230
|
#
|
232
231
|
# @api public
|
233
232
|
def start_segment(name:,
|
234
|
-
|
235
|
-
|
236
|
-
|
233
|
+
unscoped_metrics: nil,
|
234
|
+
start_time: nil,
|
235
|
+
parent: nil)
|
237
236
|
|
238
237
|
segment = Transaction::Segment.new name, unscoped_metrics, start_time
|
239
238
|
start_and_add_segment segment, parent
|
240
|
-
|
241
239
|
rescue ArgumentError
|
242
240
|
raise
|
243
241
|
rescue => exception
|
@@ -283,20 +281,19 @@ module NewRelic
|
|
283
281
|
#
|
284
282
|
# @api public
|
285
283
|
def start_datastore_segment(product: nil,
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
284
|
+
operation: nil,
|
285
|
+
collection: nil,
|
286
|
+
host: nil,
|
287
|
+
port_path_or_id: nil,
|
288
|
+
database_name: nil,
|
289
|
+
start_time: nil,
|
290
|
+
parent: nil)
|
293
291
|
|
294
292
|
product ||= UNKNOWN
|
295
293
|
operation ||= OTHER
|
296
294
|
|
297
295
|
segment = Transaction::DatastoreSegment.new product, operation, collection, host, port_path_or_id, database_name
|
298
296
|
start_and_add_segment segment, parent
|
299
|
-
|
300
297
|
rescue ArgumentError
|
301
298
|
raise
|
302
299
|
rescue => exception
|
@@ -331,14 +328,13 @@ module NewRelic
|
|
331
328
|
#
|
332
329
|
# @api public
|
333
330
|
def start_external_request_segment(library:,
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
331
|
+
uri:,
|
332
|
+
procedure:,
|
333
|
+
start_time: nil,
|
334
|
+
parent: nil)
|
338
335
|
|
339
336
|
segment = Transaction::ExternalRequestSegment.new library, uri, procedure, start_time
|
340
337
|
start_and_add_segment segment, parent
|
341
|
-
|
342
338
|
rescue ArgumentError
|
343
339
|
raise
|
344
340
|
rescue => exception
|
@@ -347,7 +343,7 @@ module NewRelic
|
|
347
343
|
|
348
344
|
# Will potentially capture and notice an error at the
|
349
345
|
# segment that was executing when error occurred.
|
350
|
-
# if passed +segment+ is something that doesn't
|
346
|
+
# if passed +segment+ is something that doesn't
|
351
347
|
# respond to +notice_segment_error+ then this method
|
352
348
|
# is effectively just a yield to the given &block
|
353
349
|
def capture_segment_error segment
|
@@ -362,13 +358,13 @@ module NewRelic
|
|
362
358
|
|
363
359
|
# For New Relic internal use only.
|
364
360
|
def start_message_broker_segment(action:,
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
361
|
+
library:,
|
362
|
+
destination_type:,
|
363
|
+
destination_name:,
|
364
|
+
headers: nil,
|
365
|
+
parameters: nil,
|
366
|
+
start_time: nil,
|
367
|
+
parent: nil)
|
372
368
|
|
373
369
|
segment = Transaction::MessageBrokerSegment.new(
|
374
370
|
action: action,
|
@@ -380,7 +376,6 @@ module NewRelic
|
|
380
376
|
start_time: start_time
|
381
377
|
)
|
382
378
|
start_and_add_segment segment, parent
|
383
|
-
|
384
379
|
rescue ArgumentError
|
385
380
|
raise
|
386
381
|
rescue => exception
|
@@ -415,7 +410,7 @@ module NewRelic
|
|
415
410
|
def start_and_add_segment segment, parent = nil
|
416
411
|
tracer_state = state
|
417
412
|
if (txn = tracer_state.current_transaction) &&
|
418
|
-
|
413
|
+
tracer_state.tracing_enabled?
|
419
414
|
txn.add_segment segment, parent
|
420
415
|
else
|
421
416
|
segment.record_metrics = false
|
@@ -433,7 +428,6 @@ module NewRelic
|
|
433
428
|
# This is THE location to store thread local information during a transaction
|
434
429
|
# Need a new piece of data? Add a method here, NOT a new thread local variable.
|
435
430
|
class State
|
436
|
-
|
437
431
|
def initialize
|
438
432
|
@untraced = []
|
439
433
|
@current_transaction = nil
|
@@ -441,7 +435,7 @@ module NewRelic
|
|
441
435
|
end
|
442
436
|
|
443
437
|
# This starts the timer for the transaction.
|
444
|
-
def reset(transaction=nil)
|
438
|
+
def reset(transaction = nil)
|
445
439
|
# We purposefully don't reset @untraced or @record_sql
|
446
440
|
# since those are managed by NewRelic::Agent.disable_* calls explicitly
|
447
441
|
# and (more importantly) outside the scope of a transaction
|
@@ -25,7 +25,7 @@ module NewRelic
|
|
25
25
|
attr_writer :record_metrics, :record_scoped_metric, :record_on_finish
|
26
26
|
attr_reader :noticed_error
|
27
27
|
|
28
|
-
def initialize name=nil, start_time=nil
|
28
|
+
def initialize name = nil, start_time = nil
|
29
29
|
@name = name
|
30
30
|
@transaction_name = nil
|
31
31
|
@transaction = nil
|
@@ -94,7 +94,7 @@ module NewRelic
|
|
94
94
|
end
|
95
95
|
|
96
96
|
def time_range
|
97
|
-
@start_time.to_f
|
97
|
+
@start_time.to_f..@end_time.to_f
|
98
98
|
end
|
99
99
|
|
100
100
|
def children_time_ranges
|
@@ -131,7 +131,7 @@ module NewRelic
|
|
131
131
|
@noticed_error = noticed_error
|
132
132
|
end
|
133
133
|
|
134
|
-
def notice_error exception, options={}
|
134
|
+
def notice_error exception, options = {}
|
135
135
|
if Agent.config[:high_security]
|
136
136
|
NewRelic::Agent.logger.debug \
|
137
137
|
"Segment: #{name} ignores notice_error for " \
|
@@ -156,7 +156,7 @@ module NewRelic
|
|
156
156
|
|
157
157
|
def child_start segment
|
158
158
|
@active_children += 1
|
159
|
-
@concurrent_children
|
159
|
+
@concurrent_children ||= @active_children > 1
|
160
160
|
|
161
161
|
transaction.async = true if @concurrent_children
|
162
162
|
end
|
@@ -180,7 +180,7 @@ module NewRelic
|
|
180
180
|
|
181
181
|
def descendant_complete child, descendant
|
182
182
|
RangeExtensions.merge_or_append descendant.time_range,
|
183
|
-
|
183
|
+
children_time_ranges
|
184
184
|
# If this child's time was previously added to this segment's
|
185
185
|
# aggregate children time, we need to re-record it using a time range
|
186
186
|
# for proper exclusive time calculation
|
@@ -227,7 +227,7 @@ module NewRelic
|
|
227
227
|
|
228
228
|
def record_child_time_as_range child
|
229
229
|
RangeExtensions.merge_or_append child.time_range,
|
230
|
-
|
230
|
+
children_time_ranges
|
231
231
|
child.range_recorded = true
|
232
232
|
end
|
233
233
|
|
@@ -11,13 +11,11 @@ module NewRelic
|
|
11
11
|
module Agent
|
12
12
|
class Transaction
|
13
13
|
class DatastoreSegment < Segment
|
14
|
-
|
15
14
|
UNKNOWN = 'unknown'.freeze
|
16
15
|
|
17
16
|
attr_reader :product, :operation, :collection, :sql_statement, :nosql_statement, :host, :port_path_or_id
|
18
17
|
attr_accessor :database_name, :record_sql
|
19
18
|
|
20
|
-
|
21
19
|
def initialize product, operation, collection = nil, host = nil, port_path_or_id = nil, database_name = nil, start_time = nil
|
22
20
|
@product = product
|
23
21
|
@operation = operation
|
@@ -63,7 +61,7 @@ module NewRelic
|
|
63
61
|
end
|
64
62
|
|
65
63
|
# @api private
|
66
|
-
def _notice_sql sql, config=nil, explainer=nil, binds=nil, name=nil
|
64
|
+
def _notice_sql sql, config = nil, explainer = nil, binds = nil, name = nil
|
67
65
|
return unless record_sql?
|
68
66
|
@sql_statement = Database::Statement.new sql, config, explainer, binds, name, host, port_path_or_id, database_name
|
69
67
|
end
|
@@ -120,8 +118,8 @@ module NewRelic
|
|
120
118
|
NEWLINE = "\n".freeze
|
121
119
|
|
122
120
|
def add_backtrace_parameter
|
123
|
-
|
124
|
-
|
121
|
+
return unless duration >= Agent.config[:'transaction_tracer.stack_trace_threshold']
|
122
|
+
params[:backtrace] = caller.join(NEWLINE)
|
125
123
|
end
|
126
124
|
|
127
125
|
def notice_sql_statement
|
@@ -140,9 +138,9 @@ module NewRelic
|
|
140
138
|
def record_span_event
|
141
139
|
# don't record a span event if the transaction is ignored
|
142
140
|
return if transaction.ignore?
|
143
|
-
|
141
|
+
|
144
142
|
aggregator = ::NewRelic::Agent.agent.span_event_aggregator
|
145
|
-
priority
|
143
|
+
priority = transaction.priority
|
146
144
|
|
147
145
|
aggregator.record(priority: priority) do
|
148
146
|
SpanEventPrimitive.for_datastore_segment(self)
|
@@ -26,7 +26,7 @@ module NewRelic
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
def accept_incoming_request request, transport_type=nil
|
29
|
+
def accept_incoming_request request, transport_type = nil
|
30
30
|
accept_incoming_transport_type request, transport_type
|
31
31
|
if trace_parent_header_present? request
|
32
32
|
accept_trace_context_incoming_request request
|
@@ -119,10 +119,10 @@ module NewRelic
|
|
119
119
|
def consume_message_synthetics_headers headers
|
120
120
|
synthetics_header = headers[CrossAppTracing::NR_MESSAGE_BROKER_SYNTHETICS_HEADER]
|
121
121
|
if synthetics_header and
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
122
|
+
incoming_payload = ::JSON.load(deobfuscate(synthetics_header)) and
|
123
|
+
SyntheticsMonitor.is_valid_payload?(incoming_payload) and
|
124
|
+
SyntheticsMonitor.is_supported_version?(incoming_payload) and
|
125
|
+
SyntheticsMonitor.is_trusted?(incoming_payload)
|
126
126
|
|
127
127
|
transaction.raw_synthetics_header = synthetics_header
|
128
128
|
transaction.synthetics_payload = incoming_payload
|
@@ -158,8 +158,8 @@ module NewRelic
|
|
158
158
|
|
159
159
|
return unless CrossAppTracing.trusted_valid_cross_app_id?(decoded_id)
|
160
160
|
txn_header = headers[CrossAppTracing::NR_MESSAGE_BROKER_TXN_HEADER]
|
161
|
-
txn_info
|
162
|
-
payload
|
161
|
+
txn_info = ::JSON.load(deobfuscate(txn_header))
|
162
|
+
payload = CrossAppPayload.new(decoded_id, transaction, txn_info)
|
163
163
|
|
164
164
|
@cross_app_payload = payload
|
165
165
|
rescue => e
|
@@ -170,9 +170,7 @@ module NewRelic
|
|
170
170
|
def deobfuscate message
|
171
171
|
CrossAppTracing.obfuscator.deobfuscate message
|
172
172
|
end
|
173
|
-
|
174
173
|
end
|
175
174
|
end
|
176
175
|
end
|
177
176
|
end
|
178
|
-
|
@@ -14,21 +14,21 @@ module NewRelic
|
|
14
14
|
attr_accessor :distributed_trace_payload
|
15
15
|
attr_writer :distributed_trace_payload_created
|
16
16
|
|
17
|
-
SUPPORTABILITY_DISTRIBUTED_TRACE
|
18
|
-
CREATE_PREFIX
|
19
|
-
ACCEPT_PREFIX
|
20
|
-
IGNORE_PREFIX
|
21
|
-
|
22
|
-
CREATE_SUCCESS_METRIC
|
23
|
-
CREATE_EXCEPTION_METRIC
|
24
|
-
ACCEPT_SUCCESS_METRIC
|
25
|
-
ACCEPT_EXCEPTION_METRIC
|
26
|
-
ACCEPT_PARSE_EXCEPTION_METRIC
|
27
|
-
|
28
|
-
IGNORE_ACCEPT_AFTER_CREATE_METRIC
|
29
|
-
IGNORE_MULTIPLE_ACCEPT_METRIC
|
30
|
-
IGNORE_ACCEPT_NULL_METRIC
|
31
|
-
IGNORE_ACCEPT_MAJOR_VERSION_METRIC
|
17
|
+
SUPPORTABILITY_DISTRIBUTED_TRACE = "Supportability/DistributedTrace"
|
18
|
+
CREATE_PREFIX = "#{SUPPORTABILITY_DISTRIBUTED_TRACE}/CreatePayload"
|
19
|
+
ACCEPT_PREFIX = "#{SUPPORTABILITY_DISTRIBUTED_TRACE}/AcceptPayload"
|
20
|
+
IGNORE_PREFIX = "#{ACCEPT_PREFIX}/Ignored"
|
21
|
+
|
22
|
+
CREATE_SUCCESS_METRIC = "#{CREATE_PREFIX}/Success"
|
23
|
+
CREATE_EXCEPTION_METRIC = "#{CREATE_PREFIX}/Exception"
|
24
|
+
ACCEPT_SUCCESS_METRIC = "#{ACCEPT_PREFIX}/Success"
|
25
|
+
ACCEPT_EXCEPTION_METRIC = "#{ACCEPT_PREFIX}/Exception"
|
26
|
+
ACCEPT_PARSE_EXCEPTION_METRIC = "#{ACCEPT_PREFIX}/ParseException"
|
27
|
+
|
28
|
+
IGNORE_ACCEPT_AFTER_CREATE_METRIC = "#{IGNORE_PREFIX}/CreateBeforeAccept"
|
29
|
+
IGNORE_MULTIPLE_ACCEPT_METRIC = "#{IGNORE_PREFIX}/Multiple"
|
30
|
+
IGNORE_ACCEPT_NULL_METRIC = "#{IGNORE_PREFIX}/Null"
|
31
|
+
IGNORE_ACCEPT_MAJOR_VERSION_METRIC = "#{IGNORE_PREFIX}/MajorVersion"
|
32
32
|
IGNORE_ACCEPT_UNTRUSTED_ACCOUNT_METRIC = "#{IGNORE_PREFIX}/UntrustedAccount"
|
33
33
|
|
34
34
|
LBRACE = "{"
|
@@ -122,12 +122,12 @@ module NewRelic
|
|
122
122
|
def check_required_fields_present(payload)
|
123
123
|
if \
|
124
124
|
!payload.version.nil? &&
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
125
|
+
!payload.parent_account_id.nil? &&
|
126
|
+
!payload.parent_app_id.nil? &&
|
127
|
+
!payload.parent_type.nil? &&
|
128
|
+
(!payload.transaction_id.nil? || !payload.id.nil?) &&
|
129
|
+
!payload.trace_id.nil? &&
|
130
|
+
!payload.timestamp.nil?
|
131
131
|
|
132
132
|
true
|
133
133
|
else
|
@@ -170,4 +170,3 @@ module NewRelic
|
|
170
170
|
end
|
171
171
|
end
|
172
172
|
end
|
173
|
-
|
@@ -9,7 +9,6 @@ require 'new_relic/agent/http_clients/uri_util'
|
|
9
9
|
module NewRelic
|
10
10
|
module Agent
|
11
11
|
class Transaction
|
12
|
-
|
13
12
|
#
|
14
13
|
# This class represents an external segment in a transaction trace.
|
15
14
|
#
|
@@ -219,10 +218,9 @@ module NewRelic
|
|
219
218
|
end
|
220
219
|
|
221
220
|
def add_unscoped_metrics
|
222
|
-
@unscoped_metrics = [
|
221
|
+
@unscoped_metrics = [EXTERNAL_ALL,
|
223
222
|
"External/#{host}/all",
|
224
|
-
suffixed_rollup_metric
|
225
|
-
]
|
223
|
+
suffixed_rollup_metric]
|
226
224
|
|
227
225
|
if cross_app_request?
|
228
226
|
@unscoped_metrics << "ExternalApp/#{host}/#{cross_process_id}/all"
|
@@ -254,7 +252,7 @@ module NewRelic
|
|
254
252
|
return if transaction.ignore?
|
255
253
|
|
256
254
|
aggregator = ::NewRelic::Agent.agent.span_event_aggregator
|
257
|
-
priority
|
255
|
+
priority = transaction.priority
|
258
256
|
aggregator.record(priority: priority) do
|
259
257
|
SpanEventPrimitive.for_external_request_segment(self)
|
260
258
|
end
|
@@ -9,16 +9,16 @@ module NewRelic
|
|
9
9
|
module Agent
|
10
10
|
class Transaction
|
11
11
|
class MessageBrokerSegment < Segment
|
12
|
-
CONSUME
|
12
|
+
CONSUME = 'Consume'.freeze
|
13
13
|
EXCHANGE = 'Exchange'.freeze
|
14
|
-
NAMED
|
15
|
-
PRODUCE
|
16
|
-
QUEUE
|
17
|
-
PURGE
|
18
|
-
SLASH
|
19
|
-
TEMP
|
20
|
-
TOPIC
|
21
|
-
UNKNOWN
|
14
|
+
NAMED = 'Named/'.freeze
|
15
|
+
PRODUCE = 'Produce'.freeze
|
16
|
+
QUEUE = 'Queue'.freeze
|
17
|
+
PURGE = 'Purge'.freeze
|
18
|
+
SLASH = '/'.freeze
|
19
|
+
TEMP = 'Temp'.freeze
|
20
|
+
TOPIC = 'Topic'.freeze
|
21
|
+
UNKNOWN = 'Unknown'.freeze
|
22
22
|
|
23
23
|
DESTINATION_TYPES = [
|
24
24
|
:exchange,
|
@@ -36,29 +36,29 @@ module NewRelic
|
|
36
36
|
}
|
37
37
|
|
38
38
|
TYPES = {
|
39
|
-
exchange:
|
39
|
+
exchange: EXCHANGE,
|
40
40
|
temporary_queue: QUEUE,
|
41
|
-
queue:
|
41
|
+
queue: QUEUE,
|
42
42
|
temporary_topic: TOPIC,
|
43
|
-
topic:
|
44
|
-
unknown:
|
43
|
+
topic: TOPIC,
|
44
|
+
unknown: EXCHANGE
|
45
45
|
}
|
46
46
|
|
47
47
|
METRIC_PREFIX = 'MessageBroker/'.freeze
|
48
48
|
|
49
49
|
attr_reader :action,
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
:destination_name,
|
51
|
+
:destination_type,
|
52
|
+
:library,
|
53
|
+
:headers
|
54
54
|
|
55
55
|
def initialize(action:,
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
56
|
+
library:,
|
57
|
+
destination_type:,
|
58
|
+
destination_name:,
|
59
|
+
headers: nil,
|
60
|
+
parameters: nil,
|
61
|
+
start_time: nil)
|
62
62
|
|
63
63
|
@action = action
|
64
64
|
@library = library
|
@@ -9,7 +9,7 @@ module NewRelic
|
|
9
9
|
class Transaction
|
10
10
|
class RequestAttributes
|
11
11
|
attr_reader :request_path, :referer, :accept, :content_length, :content_type,
|
12
|
-
|
12
|
+
:host, :port, :user_agent, :request_method
|
13
13
|
|
14
14
|
HTTP_ACCEPT_HEADER_KEY = "HTTP_ACCEPT".freeze
|
15
15
|
|
@@ -26,9 +26,9 @@ module NewRelic
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def assign_agent_attributes txn
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
default_destinations = AttributeFilter::DST_TRANSACTION_TRACER |
|
30
|
+
AttributeFilter::DST_TRANSACTION_EVENTS |
|
31
|
+
AttributeFilter::DST_ERROR_COLLECTOR
|
32
32
|
|
33
33
|
if referer
|
34
34
|
txn.add_agent_attribute :'request.headers.referer', referer, AttributeFilter::DST_ERROR_COLLECTOR
|
@@ -36,9 +36,9 @@ module NewRelic
|
|
36
36
|
|
37
37
|
if request_path
|
38
38
|
txn.add_agent_attribute :'request.uri',
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
request_path,
|
40
|
+
AttributeFilter::DST_TRANSACTION_TRACER |
|
41
|
+
AttributeFilter::DST_ERROR_COLLECTOR
|
42
42
|
end
|
43
43
|
|
44
44
|
if accept
|
@@ -15,7 +15,7 @@ module NewRelic
|
|
15
15
|
# initialize it as an array that would be empty, have one item, or many items.
|
16
16
|
attr_reader :unscoped_metrics, :custom_transaction_attributes
|
17
17
|
|
18
|
-
def initialize name=nil, unscoped_metrics=nil, start_time=nil
|
18
|
+
def initialize name = nil, unscoped_metrics = nil, start_time = nil
|
19
19
|
@unscoped_metrics = unscoped_metrics
|
20
20
|
super name, start_time
|
21
21
|
end
|
@@ -24,7 +24,7 @@ module NewRelic
|
|
24
24
|
@attributes ||= Attributes.new(NewRelic::Agent.instance.attribute_filter)
|
25
25
|
end
|
26
26
|
|
27
|
-
def add_agent_attribute(key, value, default_destinations=AttributeFilter::DST_SPAN_EVENTS)
|
27
|
+
def add_agent_attribute(key, value, default_destinations = AttributeFilter::DST_SPAN_EVENTS)
|
28
28
|
attributes.add_agent_attribute(key, value, default_destinations)
|
29
29
|
end
|
30
30
|
|
@@ -83,7 +83,7 @@ module NewRelic
|
|
83
83
|
return if transaction.ignore?
|
84
84
|
|
85
85
|
aggregator = ::NewRelic::Agent.agent.span_event_aggregator
|
86
|
-
priority
|
86
|
+
priority = transaction.priority
|
87
87
|
|
88
88
|
aggregator.record(priority: priority) do
|
89
89
|
SpanEventPrimitive.for_segment(self)
|
@@ -8,7 +8,6 @@ module NewRelic
|
|
8
8
|
module Agent
|
9
9
|
class Transaction
|
10
10
|
class SlowestSampleBuffer < TransactionSampleBuffer
|
11
|
-
|
12
11
|
CAPACITY = 1
|
13
12
|
|
14
13
|
def capacity
|
@@ -18,7 +17,6 @@ module NewRelic
|
|
18
17
|
def allow_sample?(sample)
|
19
18
|
sample.threshold && sample.duration >= sample.threshold
|
20
19
|
end
|
21
|
-
|
22
20
|
end
|
23
21
|
end
|
24
22
|
end
|