newrelic_rpm 7.2.0 → 8.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/CHANGELOG.md +105 -9
- data/README.md +2 -0
- data/lib/new_relic/agent/adaptive_sampler.rb +2 -2
- data/lib/new_relic/agent/agent.rb +6 -6
- data/lib/new_relic/agent/commands/thread_profiler_session.rb +7 -3
- data/lib/new_relic/agent/configuration/default_source.rb +15 -7
- data/lib/new_relic/agent/configuration/event_harvest_config.rb +28 -12
- data/lib/new_relic/agent/configuration/manager.rb +0 -1
- data/lib/new_relic/agent/configuration/server_source.rb +3 -2
- data/lib/new_relic/agent/configuration/yaml_source.rb +22 -1
- data/lib/new_relic/agent/custom_event_aggregator.rb +2 -1
- data/lib/new_relic/agent/database.rb +5 -2
- data/lib/new_relic/agent/datastores/mongo.rb +5 -10
- data/lib/new_relic/agent/datastores.rb +7 -7
- data/lib/new_relic/agent/distributed_tracing/cross_app_payload.rb +5 -5
- data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +10 -6
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +0 -1
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +1 -1
- data/lib/new_relic/agent/distributed_tracing/trace_context_payload.rb +1 -1
- data/lib/new_relic/agent/event_loop.rb +6 -6
- data/lib/new_relic/agent/external.rb +0 -32
- data/lib/new_relic/agent/http_clients/abstract.rb +2 -2
- data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +1 -1
- data/lib/new_relic/agent/instrumentation/active_merchant.rb +3 -3
- data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +1 -1
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +1 -1
- data/lib/new_relic/agent/instrumentation/excon.rb +4 -23
- data/lib/new_relic/agent/instrumentation/mongo.rb +3 -141
- data/lib/new_relic/agent/instrumentation/queue_time.rb +4 -4
- data/lib/new_relic/agent/instrumentation/rails/action_controller.rb +5 -5
- data/lib/new_relic/agent/instrumentation/rails/action_web_service.rb +1 -1
- data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +5 -41
- data/lib/new_relic/agent/instrumentation/sidekiq.rb +6 -1
- data/lib/new_relic/agent/javascript_instrumentor.rb +3 -3
- data/lib/new_relic/agent/messaging.rb +10 -24
- data/lib/new_relic/agent/method_tracer.rb +132 -138
- data/lib/new_relic/agent/monitors/cross_app_monitor.rb +6 -1
- data/lib/new_relic/agent/new_relic_service.rb +9 -9
- data/lib/new_relic/agent/pipe_channel_manager.rb +10 -6
- data/lib/new_relic/agent/pipe_service.rb +1 -1
- data/lib/new_relic/agent/samplers/cpu_sampler.rb +1 -1
- data/lib/new_relic/agent/span_event_aggregator.rb +2 -2
- data/lib/new_relic/agent/sql_sampler.rb +1 -1
- data/lib/new_relic/agent/stats_engine/stats_hash.rb +1 -1
- data/lib/new_relic/agent/stats_engine.rb +1 -1
- data/lib/new_relic/agent/supported_versions.rb +1 -1
- data/lib/new_relic/agent/threading/backtrace_service.rb +4 -5
- data/lib/new_relic/agent/threading/thread_profile.rb +1 -1
- data/lib/new_relic/agent/tracer.rb +15 -37
- data/lib/new_relic/agent/transaction/abstract_segment.rb +3 -3
- data/lib/new_relic/agent/transaction/message_broker_segment.rb +5 -11
- data/lib/new_relic/agent/transaction.rb +7 -28
- data/lib/new_relic/agent/transaction_time_aggregator.rb +5 -5
- data/lib/new_relic/agent/vm/snapshot.rb +1 -1
- data/lib/new_relic/agent/worker_loop.rb +5 -5
- data/lib/new_relic/agent.rb +5 -5
- data/lib/new_relic/cli/commands/deployments.rb +2 -2
- data/lib/new_relic/constants.rb +0 -4
- data/lib/new_relic/noticed_error.rb +2 -2
- data/lib/new_relic/version.rb +2 -2
- data/lib/newrelic_rpm.rb +10 -34
- data/lib/tasks/all.rb +1 -1
- data/newrelic.yml +593 -3
- data/newrelic_rpm.gemspec +1 -1
- data/test/agent_helper.rb +27 -2
- metadata +3 -8
- 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/control/frameworks/merb.rb +0 -29
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: newrelic_rpm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 8.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Huntsman
|
8
8
|
- Tanna McClure
|
9
|
-
-
|
9
|
+
- Kayla Reopelle
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-09-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
@@ -261,7 +261,6 @@ files:
|
|
261
261
|
- lib/new_relic/agent/datastores/mongo/event_formatter.rb
|
262
262
|
- lib/new_relic/agent/datastores/mongo/metric_translator.rb
|
263
263
|
- lib/new_relic/agent/datastores/mongo/obfuscator.rb
|
264
|
-
- lib/new_relic/agent/datastores/mongo/statement_formatter.rb
|
265
264
|
- lib/new_relic/agent/datastores/redis.rb
|
266
265
|
- lib/new_relic/agent/deprecator.rb
|
267
266
|
- lib/new_relic/agent/distributed_tracing.rb
|
@@ -325,7 +324,6 @@ files:
|
|
325
324
|
- lib/new_relic/agent/instrumentation/delayed_job/prepend.rb
|
326
325
|
- lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb
|
327
326
|
- lib/new_relic/agent/instrumentation/excon.rb
|
328
|
-
- lib/new_relic/agent/instrumentation/excon/connection.rb
|
329
327
|
- lib/new_relic/agent/instrumentation/excon/middleware.rb
|
330
328
|
- lib/new_relic/agent/instrumentation/grape.rb
|
331
329
|
- lib/new_relic/agent/instrumentation/grape/chain.rb
|
@@ -346,8 +344,6 @@ files:
|
|
346
344
|
- lib/new_relic/agent/instrumentation/memcache/helper.rb
|
347
345
|
- lib/new_relic/agent/instrumentation/memcache/instrumentation.rb
|
348
346
|
- lib/new_relic/agent/instrumentation/memcache/prepend.rb
|
349
|
-
- lib/new_relic/agent/instrumentation/merb/controller.rb
|
350
|
-
- lib/new_relic/agent/instrumentation/merb/errors.rb
|
351
347
|
- lib/new_relic/agent/instrumentation/middleware_proxy.rb
|
352
348
|
- lib/new_relic/agent/instrumentation/middleware_tracing.rb
|
353
349
|
- lib/new_relic/agent/instrumentation/mongo.rb
|
@@ -503,7 +499,6 @@ files:
|
|
503
499
|
- lib/new_relic/control/class_methods.rb
|
504
500
|
- lib/new_relic/control/frameworks.rb
|
505
501
|
- lib/new_relic/control/frameworks/external.rb
|
506
|
-
- lib/new_relic/control/frameworks/merb.rb
|
507
502
|
- lib/new_relic/control/frameworks/rails.rb
|
508
503
|
- lib/new_relic/control/frameworks/rails3.rb
|
509
504
|
- lib/new_relic/control/frameworks/rails4.rb
|
@@ -1,53 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
# This file is distributed under New Relic's license terms.
|
3
|
-
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
|
-
|
5
|
-
require 'new_relic/agent/datastores/mongo/obfuscator'
|
6
|
-
|
7
|
-
module NewRelic
|
8
|
-
module Agent
|
9
|
-
module Datastores
|
10
|
-
module Mongo
|
11
|
-
module StatementFormatter
|
12
|
-
|
13
|
-
PLAINTEXT_KEYS = [
|
14
|
-
:database,
|
15
|
-
:collection,
|
16
|
-
:operation,
|
17
|
-
:fields,
|
18
|
-
:skip,
|
19
|
-
:limit,
|
20
|
-
:order
|
21
|
-
]
|
22
|
-
|
23
|
-
OBFUSCATE_KEYS = [
|
24
|
-
:selector
|
25
|
-
]
|
26
|
-
|
27
|
-
def self.format(statement, operation)
|
28
|
-
return nil unless NewRelic::Agent.config[:'mongo.capture_queries']
|
29
|
-
|
30
|
-
result = { :operation => operation }
|
31
|
-
|
32
|
-
PLAINTEXT_KEYS.each do |key|
|
33
|
-
result[key] = statement[key] if statement.key?(key)
|
34
|
-
end
|
35
|
-
|
36
|
-
OBFUSCATE_KEYS.each do |key|
|
37
|
-
if statement.key?(key) && statement[key]
|
38
|
-
obfuscated = obfuscate(statement[key])
|
39
|
-
result[key] = obfuscated if obfuscated
|
40
|
-
end
|
41
|
-
end
|
42
|
-
result
|
43
|
-
end
|
44
|
-
|
45
|
-
def self.obfuscate(statement)
|
46
|
-
statement = Obfuscator.obfuscate_statement(statement) if NewRelic::Agent.config[:'mongo.obfuscate_queries']
|
47
|
-
statement
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
# This file is distributed under New Relic's license terms.
|
3
|
-
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
|
-
|
5
|
-
module ::Excon
|
6
|
-
class Connection
|
7
|
-
# @connection is deprecated in newer excon versions and replaced with @data
|
8
|
-
def newrelic_connection_params
|
9
|
-
(@data || @connection)
|
10
|
-
end
|
11
|
-
|
12
|
-
def newrelic_resolved_request_params(request_params)
|
13
|
-
resolved = newrelic_connection_params.merge(request_params)
|
14
|
-
resolved[:headers] = resolved[:headers].merge(request_params[:headers] || {})
|
15
|
-
resolved
|
16
|
-
end
|
17
|
-
|
18
|
-
def request_with_newrelic_trace(params, &block)
|
19
|
-
resolved_params = newrelic_resolved_request_params(params)
|
20
|
-
wrapped_request = ::NewRelic::Agent::HTTPClients::ExconHTTPRequest.new(resolved_params)
|
21
|
-
segment = NewRelic::Agent::Tracer.start_external_request_segment(
|
22
|
-
library: wrapped_request.type,
|
23
|
-
uri: wrapped_request.uri,
|
24
|
-
procedure: wrapped_request.method
|
25
|
-
)
|
26
|
-
|
27
|
-
begin
|
28
|
-
response = nil
|
29
|
-
segment.add_request_headers wrapped_request
|
30
|
-
|
31
|
-
response = NewRelic::Agent::Tracer.capture_segment_error segment do
|
32
|
-
request_without_newrelic_trace(resolved_params, &block)
|
33
|
-
end
|
34
|
-
|
35
|
-
wrapped_response = ::NewRelic::Agent::HTTPClients::ExconHTTPResponse.new(response)
|
36
|
-
segment.process_response_headers wrapped_response
|
37
|
-
|
38
|
-
response
|
39
|
-
ensure
|
40
|
-
segment.finish if segment
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def self.install_newrelic_instrumentation
|
45
|
-
alias request_without_newrelic_trace request
|
46
|
-
alias request request_with_newrelic_trace
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
# This file is distributed under New Relic's license terms.
|
3
|
-
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
|
-
|
5
|
-
require 'set'
|
6
|
-
|
7
|
-
DependencyDetection.defer do
|
8
|
-
@name = :merb_controller
|
9
|
-
|
10
|
-
depends_on do
|
11
|
-
defined?(Merb) && defined?(Merb::Controller)
|
12
|
-
end
|
13
|
-
|
14
|
-
executes do
|
15
|
-
::NewRelic::Agent.logger.info 'Installing Merb Controller instrumentation'
|
16
|
-
end
|
17
|
-
|
18
|
-
executes do
|
19
|
-
require 'merb-core/controller/merb_controller'
|
20
|
-
|
21
|
-
Merb::Controller.class_eval do
|
22
|
-
include NewRelic::Agent::Instrumentation::ControllerInstrumentation
|
23
|
-
|
24
|
-
# determine the path that is used in the metric name for
|
25
|
-
# the called controller action
|
26
|
-
def newrelic_metric_path
|
27
|
-
"#{controller_name}/#{action_name}"
|
28
|
-
end
|
29
|
-
|
30
|
-
protected
|
31
|
-
|
32
|
-
def _dispatch_with_newrelic_trace(*args)
|
33
|
-
options = {}
|
34
|
-
options[:params] = params
|
35
|
-
perform_action_with_newrelic_trace(options) do
|
36
|
-
_dispatch_without_newrelic_trace(*args)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
alias_method :_dispatch_without_newrelic_trace, :_dispatch
|
41
|
-
alias_method :_dispatch, :_dispatch_with_newrelic_trace
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
# This file is distributed under New Relic's license terms.
|
3
|
-
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
|
-
|
5
|
-
DependencyDetection.defer do
|
6
|
-
@name = :merb_error
|
7
|
-
|
8
|
-
depends_on do
|
9
|
-
defined?(Merb) && defined?(Merb::Dispatcher) && defined?(Merb::Dispatcher::DefaultException)
|
10
|
-
end
|
11
|
-
|
12
|
-
depends_on do
|
13
|
-
Merb::Dispatcher::DefaultException.respond_to?(:before)
|
14
|
-
end
|
15
|
-
|
16
|
-
executes do
|
17
|
-
::NewRelic::Agent.logger.info 'Installing Merb Errors instrumentation'
|
18
|
-
end
|
19
|
-
|
20
|
-
executes do
|
21
|
-
|
22
|
-
# Hook in the notification to merb
|
23
|
-
error_notifier = Proc.new {
|
24
|
-
if request.exceptions #check that there's actually an exception
|
25
|
-
# Note, this assumes we have already captured the other information such as uri and params in the Transaction.
|
26
|
-
NewRelic::Agent::Transaction.notice_error(request.exceptions.first)
|
27
|
-
end
|
28
|
-
}
|
29
|
-
Merb::Dispatcher::DefaultException.before error_notifier
|
30
|
-
Exceptions.before error_notifier
|
31
|
-
|
32
|
-
end
|
33
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
# This file is distributed under New Relic's license terms.
|
3
|
-
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
|
-
|
5
|
-
module NewRelic
|
6
|
-
class Control
|
7
|
-
module Frameworks
|
8
|
-
# Includes limited support for Merb
|
9
|
-
class Merb < NewRelic::Control
|
10
|
-
|
11
|
-
def env
|
12
|
-
@env ||= ::Merb.env
|
13
|
-
end
|
14
|
-
def root
|
15
|
-
::Merb.root
|
16
|
-
end
|
17
|
-
|
18
|
-
def init_config options={}
|
19
|
-
::Merb::Plugins.add_rakefiles File.join(newrelic_root,"lib/tasks/all.rb")
|
20
|
-
|
21
|
-
# Merb gives you a Merb::Plugins.config hash...feel free to put your stuff in your piece of it
|
22
|
-
::Merb::Plugins.config[:newrelic] = {
|
23
|
-
:config => self
|
24
|
-
}
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|