newrelic_rpm 8.11.0 → 8.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +0 -3
- data/Brewfile +1 -0
- data/CHANGELOG.md +45 -16
- data/bin/nrdebug +2 -0
- data/docker-compose.yml +22 -0
- data/lib/new_relic/agent/agent/shutdown.rb +1 -0
- data/lib/new_relic/agent/agent/special_startup.rb +2 -0
- data/lib/new_relic/agent/agent/startup.rb +1 -0
- data/lib/new_relic/agent/attributes.rb +1 -0
- data/lib/new_relic/agent/audit_logger.rb +1 -0
- data/lib/new_relic/agent/commands/thread_profiler_session.rb +1 -0
- data/lib/new_relic/agent/configuration/default_source.rb +26 -4
- data/lib/new_relic/agent/configuration/dotted_hash.rb +1 -0
- data/lib/new_relic/agent/configuration/environment_source.rb +1 -0
- data/lib/new_relic/agent/configuration/high_security_source.rb +1 -0
- data/lib/new_relic/agent/configuration/manager.rb +3 -0
- data/lib/new_relic/agent/configuration/security_policy_source.rb +10 -0
- data/lib/new_relic/agent/configuration/yaml_source.rb +1 -0
- data/lib/new_relic/agent/connect/request_builder.rb +1 -0
- data/lib/new_relic/agent/database/obfuscation_helpers.rb +1 -0
- data/lib/new_relic/agent/database.rb +7 -0
- data/lib/new_relic/agent/database_adapter.rb +2 -0
- data/lib/new_relic/agent/datastores/mongo/event_formatter.rb +3 -2
- data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +1 -1
- data/lib/new_relic/agent/datastores/nosql_obfuscator.rb +41 -0
- data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +3 -0
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +3 -0
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_metrics.rb +1 -0
- data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +1 -0
- data/lib/new_relic/agent/distributed_tracing/trace_context.rb +1 -0
- data/lib/new_relic/agent/encoding_normalizer.rb +2 -0
- data/lib/new_relic/agent/error_collector.rb +3 -0
- data/lib/new_relic/agent/error_filter.rb +1 -0
- data/lib/new_relic/agent/error_trace_aggregator.rb +1 -0
- data/lib/new_relic/agent/event_aggregator.rb +1 -0
- data/lib/new_relic/agent/event_loop.rb +2 -0
- data/lib/new_relic/agent/http_clients/abstract.rb +2 -0
- data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +1 -0
- data/lib/new_relic/agent/instrumentation/active_merchant.rb +1 -0
- data/lib/new_relic/agent/instrumentation/active_storage_subscriber.rb +2 -0
- data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +1 -0
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +1 -0
- data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +1 -0
- data/lib/new_relic/agent/instrumentation/elasticsearch/chain.rb +29 -0
- data/lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb +66 -0
- data/lib/new_relic/agent/instrumentation/elasticsearch/prepend.rb +13 -0
- data/lib/new_relic/agent/instrumentation/elasticsearch.rb +31 -0
- data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +1 -0
- data/lib/new_relic/agent/instrumentation/logger/instrumentation.rb +4 -0
- data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +2 -0
- data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +2 -0
- data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +3 -0
- data/lib/new_relic/agent/instrumentation/rake/instrumentation.rb +1 -0
- data/lib/new_relic/agent/instrumentation/sidekiq.rb +1 -0
- data/lib/new_relic/agent/instrumentation/sinatra.rb +1 -0
- data/lib/new_relic/agent/instrumentation/thread/instrumentation.rb +1 -0
- data/lib/new_relic/agent/instrumentation/tilt/instrumentation.rb +1 -0
- data/lib/new_relic/agent/javascript_instrumentor.rb +1 -0
- data/lib/new_relic/agent/local_log_decorator.rb +1 -0
- data/lib/new_relic/agent/log_event_aggregator.rb +1 -0
- data/lib/new_relic/agent/messaging.rb +1 -0
- data/lib/new_relic/agent/method_tracer.rb +4 -0
- data/lib/new_relic/agent/monitors/distributed_tracing_monitor.rb +1 -0
- data/lib/new_relic/agent/new_relic_service.rb +2 -0
- data/lib/new_relic/agent/pipe_channel_manager.rb +2 -0
- data/lib/new_relic/agent/rules_engine.rb +1 -0
- data/lib/new_relic/agent/samplers/cpu_sampler.rb +1 -0
- data/lib/new_relic/agent/samplers/memory_sampler.rb +5 -0
- data/lib/new_relic/agent/span_event_primitive.rb +1 -0
- data/lib/new_relic/agent/stats.rb +1 -0
- data/lib/new_relic/agent/stats_engine/gc_profiler.rb +1 -0
- data/lib/new_relic/agent/system_info.rb +3 -0
- data/lib/new_relic/agent/threading/agent_thread.rb +1 -0
- data/lib/new_relic/agent/threading/backtrace_service.rb +1 -0
- data/lib/new_relic/agent/threading/thread_profile.rb +3 -0
- data/lib/new_relic/agent/tracer.rb +4 -0
- data/lib/new_relic/agent/transaction/abstract_segment.rb +3 -0
- data/lib/new_relic/agent/transaction/datastore_segment.rb +3 -0
- data/lib/new_relic/agent/transaction/distributed_tracer.rb +4 -0
- data/lib/new_relic/agent/transaction/distributed_tracing.rb +1 -0
- data/lib/new_relic/agent/transaction/external_request_segment.rb +1 -0
- data/lib/new_relic/agent/transaction/message_broker_segment.rb +1 -0
- data/lib/new_relic/agent/transaction/segment.rb +1 -0
- data/lib/new_relic/agent/transaction/trace.rb +4 -0
- data/lib/new_relic/agent/transaction/trace_node.rb +1 -0
- data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +2 -0
- data/lib/new_relic/agent/transaction.rb +10 -0
- data/lib/new_relic/agent/transaction_event_aggregator.rb +1 -0
- data/lib/new_relic/agent/transaction_time_aggregator.rb +1 -0
- data/lib/new_relic/agent/utilization/pcf.rb +1 -0
- data/lib/new_relic/agent/utilization/vendor.rb +2 -0
- data/lib/new_relic/agent/utilization_data.rb +3 -0
- data/lib/new_relic/agent.rb +4 -2
- data/lib/new_relic/cli/commands/install.rb +1 -0
- data/lib/new_relic/coerce.rb +6 -0
- data/lib/new_relic/collection_helper.rb +1 -0
- data/lib/new_relic/control/frameworks/rails.rb +5 -0
- data/lib/new_relic/control/instrumentation.rb +2 -0
- data/lib/new_relic/dependency_detection.rb +2 -0
- data/lib/new_relic/helper.rb +1 -0
- data/lib/new_relic/language_support.rb +1 -0
- data/lib/new_relic/latest_changes.rb +1 -0
- data/lib/new_relic/local_environment.rb +6 -0
- data/lib/new_relic/metric_spec.rb +2 -0
- data/lib/new_relic/rack/agent_middleware.rb +2 -0
- data/lib/new_relic/traced_thread.rb +1 -0
- data/lib/new_relic/version.rb +1 -1
- data/lib/tasks/helpers/format.rb +3 -0
- data/lib/tasks/instrumentation_generator/instrumentation.thor +27 -5
- data/lib/tasks/instrumentation_generator/templates/chain.tt +2 -1
- data/lib/tasks/instrumentation_generator/templates/chain_method.tt +3 -2
- data/lib/tasks/instrumentation_generator/templates/instrumentation.tt +2 -1
- data/lib/tasks/instrumentation_generator/templates/instrumentation_method.tt +1 -1
- data/lib/tasks/instrumentation_generator/templates/prepend.tt +1 -1
- data/lib/tasks/instrumentation_generator/templates/prepend_method.tt +1 -1
- data/lib/tasks/instrumentation_generator/templates/test.tt +1 -1
- data/newrelic.yml +13 -3
- data/newrelic_rpm.gemspec +6 -6
- data/test/agent_helper.rb +6 -0
- metadata +11 -77
- data/lib/new_relic/agent/datastores/mongo/obfuscator.rb +0 -43
data/lib/tasks/helpers/format.rb
CHANGED
@@ -25,6 +25,7 @@ module Format
|
|
25
25
|
sections = Hash.new { |hash, key| hash[key] = [] }
|
26
26
|
NewRelic::Agent::Configuration::DEFAULTS.each do |key, value|
|
27
27
|
next unless value[:public]
|
28
|
+
|
28
29
|
key = key.to_s
|
29
30
|
section_key = section_key(key, key.split('.'))
|
30
31
|
sections[section_key] << format_sections(key, value)
|
@@ -55,6 +56,7 @@ module Format
|
|
55
56
|
|
56
57
|
def format_default_value(spec)
|
57
58
|
return spec[:documentation_default] if !spec[:documentation_default].nil?
|
59
|
+
|
58
60
|
if spec[:default].is_a?(Proc)
|
59
61
|
'(Dynamic)'
|
60
62
|
else
|
@@ -71,6 +73,7 @@ module Format
|
|
71
73
|
|
72
74
|
def format_env_var(key)
|
73
75
|
return "None" if NON_ENV_CONFIGS.include?(key)
|
76
|
+
|
74
77
|
"NEW_RELIC_#{key.tr(".", "_").upcase}"
|
75
78
|
end
|
76
79
|
|
@@ -11,6 +11,7 @@ class Instrumentation < Thor
|
|
11
11
|
INSTRUMENTATION_ROOT = 'lib/new_relic/agent/instrumentation/'
|
12
12
|
MULTIVERSE_SUITE_ROOT = 'test/multiverse/suites/'
|
13
13
|
DEFAULT_SOURCE_LOCATION = 'lib/new_relic/agent/configuration/default_source.rb'
|
14
|
+
NEWRELIC_YML_LOCATION = 'newrelic.yml'
|
14
15
|
|
15
16
|
desc('scaffold NAME', 'Scaffold the required files for adding new instrumentation')
|
16
17
|
long_desc <<-LONGDESC
|
@@ -37,7 +38,8 @@ class Instrumentation < Thor
|
|
37
38
|
|
38
39
|
empty_directory(base_path)
|
39
40
|
create_instrumentation_files(base_path)
|
40
|
-
|
41
|
+
append_to_default_source(name)
|
42
|
+
append_to_newrelic_yml(name)
|
41
43
|
create_tests(name)
|
42
44
|
end
|
43
45
|
|
@@ -76,7 +78,7 @@ class Instrumentation < Thor
|
|
76
78
|
template('templates/newrelic.yml.tt', "#{base_path}/config/newrelic.yml")
|
77
79
|
end
|
78
80
|
|
79
|
-
def
|
81
|
+
def append_to_default_source(name)
|
80
82
|
insert_into_file(
|
81
83
|
DEFAULT_SOURCE_LOCATION,
|
82
84
|
config_block(name.downcase),
|
@@ -85,18 +87,38 @@ class Instrumentation < Thor
|
|
85
87
|
)
|
86
88
|
end
|
87
89
|
|
88
|
-
def
|
90
|
+
def append_to_newrelic_yml(name)
|
91
|
+
insert_into_file(
|
92
|
+
NEWRELIC_YML_LOCATION,
|
93
|
+
yaml_block(name),
|
94
|
+
after: "# instrumentation.bunny: auto\n"
|
95
|
+
)
|
96
|
+
end
|
97
|
+
|
98
|
+
def config_block(name)
|
89
99
|
<<-CONFIG
|
90
|
-
:'instrumentation.#{
|
100
|
+
:'instrumentation.#{name.downcase}' => {
|
91
101
|
:default => 'auto',
|
92
102
|
:public => true,
|
93
103
|
:type => String,
|
94
104
|
:dynamic_name => true,
|
95
105
|
:allowed_from_server => false,
|
96
|
-
:description => 'Controls auto-instrumentation of the #{
|
106
|
+
:description => 'Controls auto-instrumentation of the #{name} library at start up. May be one of [auto|prepend|chain|disabled].'
|
97
107
|
},
|
98
108
|
CONFIG
|
99
109
|
end
|
110
|
+
|
111
|
+
# TODO: OLD RUBIES - RUBY_VERSION 2.2
|
112
|
+
# When we only support 2.3+ this can be changed to a sqiggle heredoc (<<~)
|
113
|
+
# and use standard indentation
|
114
|
+
def yaml_block(name)
|
115
|
+
<<HEREDOC # rubocop:disable Layout/IndentationWidth
|
116
|
+
|
117
|
+
# Controls auto-instrumentation of #{name} at start up.
|
118
|
+
# May be one of [auto|prepend|chain|disabled]
|
119
|
+
# instrumentation.#{name.downcase}: auto
|
120
|
+
HEREDOC
|
121
|
+
end
|
100
122
|
end
|
101
123
|
|
102
124
|
Instrumentation.start(ARGV)
|
@@ -9,9 +9,10 @@ module NewRelic::Agent::Instrumentation
|
|
9
9
|
include NewRelic::Agent::Instrumentation::<%= @class_name %>
|
10
10
|
|
11
11
|
alias_method(:<%= @method.downcase %>_without_new_relic, :<%= @method.downcase %>)
|
12
|
+
alias_method(:<%= @method.downcase %>, :<%= @method.downcase %>_with_new_relic)
|
12
13
|
|
13
14
|
def <%= @method.downcase %><%= "(#{@args})" unless @args.empty? %>
|
14
|
-
<%= @method.downcase %>
|
15
|
+
<%= @method.downcase %>_with_new_relic<%= "(#{@args})" unless @args.empty? %> do
|
15
16
|
<%= @method.downcase %>_without_new_relic<%= "(#{@args})" unless @args.empty? %>
|
16
17
|
end
|
17
18
|
end
|
@@ -1,7 +1,8 @@
|
|
1
|
-
alias_method
|
1
|
+
alias_method(:<%= @method.downcase %>_without_new_relic, :<%= @method.downcase %>)
|
2
|
+
alias_method(:<%= @method.downcase %>, :<%= @method.downcase %>_with_new_relic)
|
2
3
|
|
3
4
|
def <%= @method.downcase %><%= "(#{@args})" unless @args.empty? %>
|
4
|
-
<%= @method.downcase %>
|
5
|
+
<%= @method.downcase %>_with_new_relic<%= "(#{@args})" unless @args.empty? %> do
|
5
6
|
<%= @method.downcase %>_without_new_relic<%= "(#{@args})" unless @args.empty? %>
|
6
7
|
end
|
7
8
|
end
|
@@ -5,8 +5,9 @@
|
|
5
5
|
module NewRelic::Agent::Instrumentation
|
6
6
|
module <%= @class_name %>
|
7
7
|
|
8
|
-
def <%= @method.downcase %>
|
8
|
+
def <%= @method.downcase %>_with_new_relic<%= "(#{@args})" unless @args.empty? %>
|
9
9
|
# add instrumentation content here
|
10
|
+
yield
|
10
11
|
end
|
11
12
|
end
|
12
13
|
end
|
@@ -7,7 +7,7 @@ module NewRelic::Agent::Instrumentation
|
|
7
7
|
include NewRelic::Agent::Instrumentation::<%= @class_name %>
|
8
8
|
|
9
9
|
def <%= @method.downcase %><%= "(#{@args})" unless @args.empty? %>
|
10
|
-
<%= @method.downcase %>
|
10
|
+
<%= @method.downcase %>_with_new_relic<%= "(#{@args})" unless @args.empty? %> { super }
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
data/newrelic.yml
CHANGED
@@ -145,7 +145,7 @@ common: &default_settings
|
|
145
145
|
|
146
146
|
# Specify a maximum number of custom Insights events to buffer in memory at a
|
147
147
|
# time.
|
148
|
-
# custom_insights_events.max_samples_stored:
|
148
|
+
# custom_insights_events.max_samples_stored: 3000
|
149
149
|
|
150
150
|
# If false, the agent will not add database_name parameter to transaction or #
|
151
151
|
# slow sql traces.
|
@@ -271,7 +271,7 @@ common: &default_settings
|
|
271
271
|
|
272
272
|
# Forces the exit handler that sends all cached data to collector before
|
273
273
|
# shutting down to be installed regardless of detecting scenarios where it
|
274
|
-
# generally should
|
274
|
+
# generally should not be. Known use-case for this option is where Sinatra is
|
275
275
|
# running as an embedded service within another framework and the agent is
|
276
276
|
# detecting the Sinatra app and skipping the at_exit handler as a result.
|
277
277
|
# Sinatra classically runs the entire application in an at_exit block and would
|
@@ -322,6 +322,10 @@ common: &default_settings
|
|
322
322
|
# May be one of [auto|prepend|chain|disabled].
|
323
323
|
# instrumentation.delayed_job: auto
|
324
324
|
|
325
|
+
# Controls auto-instrumentation of the elasticsearch library at start up.
|
326
|
+
# May be one of [auto|prepend|chain|disabled].
|
327
|
+
# instrumentation.elasticsearch: auto
|
328
|
+
|
325
329
|
# Controls auto-instrumentation of Excon at start up.
|
326
330
|
# May be one of [enabled|disabled].
|
327
331
|
# instrumentation.excon: auto
|
@@ -434,7 +438,7 @@ common: &default_settings
|
|
434
438
|
# instrumentation.grpc.host_denylist: ""
|
435
439
|
|
436
440
|
# A dictionary of label names and values that will be applied to the data sent
|
437
|
-
# from this agent. May also be expressed
|
441
|
+
# from this agent. May also be expressed as a semicolon-delimited ; string of
|
438
442
|
# colon-separated : pairs.
|
439
443
|
# For example,<var>Server</var>:<var>One</var>;<var>Data Center</var>:<var>Primary</var>.
|
440
444
|
# labels: ""
|
@@ -459,6 +463,12 @@ common: &default_settings
|
|
459
463
|
# If true, the agent obfuscates Mongo queries in transaction traces.
|
460
464
|
# mongo.obfuscate_queries: true
|
461
465
|
|
466
|
+
# If true, the agent captures Elasticsearch queries in transaction traces.
|
467
|
+
# elasticsearch.capture_queries: true
|
468
|
+
|
469
|
+
# If true, the agent obfuscates Elasticsearch queries in transaction traces.
|
470
|
+
# elasticsearch.obfuscate_queries: true
|
471
|
+
|
462
472
|
# When true, the agent transmits data about your app to the New Relic collector.
|
463
473
|
# monitor_mode: true
|
464
474
|
|
data/newrelic_rpm.gemspec
CHANGED
@@ -54,11 +54,11 @@ https://github.com/newrelic/newrelic-ruby-agent/
|
|
54
54
|
s.add_development_dependency 'mocha', '~> 1.14.0'
|
55
55
|
s.add_development_dependency 'pry' unless ENV['CI']
|
56
56
|
s.add_development_dependency 'rake', '12.3.3'
|
57
|
-
s.add_development_dependency 'rubocop'
|
58
|
-
s.add_development_dependency 'rubocop-minitest'
|
59
|
-
s.add_development_dependency 'rubocop-performance'
|
60
|
-
s.add_development_dependency 'rubocop-rake'
|
57
|
+
s.add_development_dependency 'rubocop' unless ENV['CI'] && RUBY_VERSION < '3.0.0'
|
58
|
+
s.add_development_dependency 'rubocop-minitest' unless ENV['CI'] && RUBY_VERSION < '3.0.0'
|
59
|
+
s.add_development_dependency 'rubocop-performance' unless ENV['CI'] && RUBY_VERSION < '3.0.0'
|
60
|
+
s.add_development_dependency 'rubocop-rake' unless ENV['CI'] && RUBY_VERSION < '3.0.0'
|
61
61
|
s.add_development_dependency 'simplecov' if RUBY_VERSION >= '2.7.0'
|
62
|
-
s.add_development_dependency 'thor'
|
63
|
-
s.add_development_dependency 'yard'
|
62
|
+
s.add_development_dependency 'thor' unless ENV['CI']
|
63
|
+
s.add_development_dependency 'yard', "#{RUBY_VERSION < '2.3.0' ? '0.9.26' : '> 0.9.26'}"
|
64
64
|
end
|
data/test/agent_helper.rb
CHANGED
@@ -411,6 +411,7 @@ end
|
|
411
411
|
def build_deferred_error_attributes(segment)
|
412
412
|
return unless segment.noticed_error
|
413
413
|
return if segment.noticed_error_attributes.frozen?
|
414
|
+
|
414
415
|
segment.noticed_error.build_error_attributes
|
415
416
|
end
|
416
417
|
|
@@ -454,6 +455,7 @@ end
|
|
454
455
|
|
455
456
|
def last_transaction_trace
|
456
457
|
return unless last_sample = NewRelic::Agent.agent.transaction_sampler.last_sample
|
458
|
+
|
457
459
|
NewRelic::Agent::Transaction::TraceBuilder.build_trace(last_sample)
|
458
460
|
end
|
459
461
|
|
@@ -639,6 +641,7 @@ def constant_path(name, opts = {})
|
|
639
641
|
if !path.last.constants.include?(part.to_sym)
|
640
642
|
return allow_partial ? path : nil
|
641
643
|
end
|
644
|
+
|
642
645
|
path << path.last.const_get(part)
|
643
646
|
end
|
644
647
|
path
|
@@ -655,6 +658,7 @@ def undefine_constant(constant_symbol)
|
|
655
658
|
parent = get_parent(const_str)
|
656
659
|
const_name = const_str.gsub(/.*::/, '')
|
657
660
|
return yield unless parent && parent.constants.include?(const_name.to_sym)
|
661
|
+
|
658
662
|
removed_constant = parent.send(:remove_const, const_name)
|
659
663
|
yield
|
660
664
|
ensure
|
@@ -929,6 +933,7 @@ def mock_http_response(headers, wrap_it = true)
|
|
929
933
|
net_http_resp.add_field(key.to_s, value)
|
930
934
|
end
|
931
935
|
return net_http_resp unless wrap_it
|
936
|
+
|
932
937
|
NewRelic::Agent::HTTPClients::NetHTTPResponse.new(net_http_resp)
|
933
938
|
end
|
934
939
|
|
@@ -974,6 +979,7 @@ def refute_raises(*exp)
|
|
974
979
|
rescue MiniTest::Skip => e
|
975
980
|
puts "SKIP REPORTS: #{e.inspect}"
|
976
981
|
return e if exp.include?(MiniTest::Skip)
|
982
|
+
|
977
983
|
raise e
|
978
984
|
rescue Exception => e
|
979
985
|
puts "EXCEPTION RAISED: #{e.inspect}\n#{e.backtrace}"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: newrelic_rpm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.
|
4
|
+
version: 8.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tanna McClure
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2022-10-
|
14
|
+
date: 2022-10-26 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
@@ -83,62 +83,6 @@ dependencies:
|
|
83
83
|
- - '='
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: 12.3.3
|
86
|
-
- !ruby/object:Gem::Dependency
|
87
|
-
name: rubocop
|
88
|
-
requirement: !ruby/object:Gem::Requirement
|
89
|
-
requirements:
|
90
|
-
- - ">="
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
version: '0'
|
93
|
-
type: :development
|
94
|
-
prerelease: false
|
95
|
-
version_requirements: !ruby/object:Gem::Requirement
|
96
|
-
requirements:
|
97
|
-
- - ">="
|
98
|
-
- !ruby/object:Gem::Version
|
99
|
-
version: '0'
|
100
|
-
- !ruby/object:Gem::Dependency
|
101
|
-
name: rubocop-minitest
|
102
|
-
requirement: !ruby/object:Gem::Requirement
|
103
|
-
requirements:
|
104
|
-
- - ">="
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
version: '0'
|
107
|
-
type: :development
|
108
|
-
prerelease: false
|
109
|
-
version_requirements: !ruby/object:Gem::Requirement
|
110
|
-
requirements:
|
111
|
-
- - ">="
|
112
|
-
- !ruby/object:Gem::Version
|
113
|
-
version: '0'
|
114
|
-
- !ruby/object:Gem::Dependency
|
115
|
-
name: rubocop-performance
|
116
|
-
requirement: !ruby/object:Gem::Requirement
|
117
|
-
requirements:
|
118
|
-
- - ">="
|
119
|
-
- !ruby/object:Gem::Version
|
120
|
-
version: '0'
|
121
|
-
type: :development
|
122
|
-
prerelease: false
|
123
|
-
version_requirements: !ruby/object:Gem::Requirement
|
124
|
-
requirements:
|
125
|
-
- - ">="
|
126
|
-
- !ruby/object:Gem::Version
|
127
|
-
version: '0'
|
128
|
-
- !ruby/object:Gem::Dependency
|
129
|
-
name: rubocop-rake
|
130
|
-
requirement: !ruby/object:Gem::Requirement
|
131
|
-
requirements:
|
132
|
-
- - ">="
|
133
|
-
- !ruby/object:Gem::Version
|
134
|
-
version: '0'
|
135
|
-
type: :development
|
136
|
-
prerelease: false
|
137
|
-
version_requirements: !ruby/object:Gem::Requirement
|
138
|
-
requirements:
|
139
|
-
- - ">="
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
version: '0'
|
142
86
|
- !ruby/object:Gem::Dependency
|
143
87
|
name: simplecov
|
144
88
|
requirement: !ruby/object:Gem::Requirement
|
@@ -153,34 +97,20 @@ dependencies:
|
|
153
97
|
- - ">="
|
154
98
|
- !ruby/object:Gem::Version
|
155
99
|
version: '0'
|
156
|
-
- !ruby/object:Gem::Dependency
|
157
|
-
name: thor
|
158
|
-
requirement: !ruby/object:Gem::Requirement
|
159
|
-
requirements:
|
160
|
-
- - ">="
|
161
|
-
- !ruby/object:Gem::Version
|
162
|
-
version: '0'
|
163
|
-
type: :development
|
164
|
-
prerelease: false
|
165
|
-
version_requirements: !ruby/object:Gem::Requirement
|
166
|
-
requirements:
|
167
|
-
- - ">="
|
168
|
-
- !ruby/object:Gem::Version
|
169
|
-
version: '0'
|
170
100
|
- !ruby/object:Gem::Dependency
|
171
101
|
name: yard
|
172
102
|
requirement: !ruby/object:Gem::Requirement
|
173
103
|
requirements:
|
174
|
-
- - "
|
104
|
+
- - ">"
|
175
105
|
- !ruby/object:Gem::Version
|
176
|
-
version:
|
106
|
+
version: 0.9.26
|
177
107
|
type: :development
|
178
108
|
prerelease: false
|
179
109
|
version_requirements: !ruby/object:Gem::Requirement
|
180
110
|
requirements:
|
181
|
-
- - "
|
111
|
+
- - ">"
|
182
112
|
- !ruby/object:Gem::Version
|
183
|
-
version:
|
113
|
+
version: 0.9.26
|
184
114
|
description: |
|
185
115
|
New Relic is a performance management system, developed by New Relic,
|
186
116
|
Inc (http://www.newrelic.com). New Relic provides you with deep
|
@@ -272,7 +202,7 @@ files:
|
|
272
202
|
- lib/new_relic/agent/datastores/mongo.rb
|
273
203
|
- lib/new_relic/agent/datastores/mongo/event_formatter.rb
|
274
204
|
- lib/new_relic/agent/datastores/mongo/metric_translator.rb
|
275
|
-
- lib/new_relic/agent/datastores/
|
205
|
+
- lib/new_relic/agent/datastores/nosql_obfuscator.rb
|
276
206
|
- lib/new_relic/agent/datastores/redis.rb
|
277
207
|
- lib/new_relic/agent/deprecator.rb
|
278
208
|
- lib/new_relic/agent/distributed_tracing.rb
|
@@ -339,6 +269,10 @@ files:
|
|
339
269
|
- lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb
|
340
270
|
- lib/new_relic/agent/instrumentation/delayed_job/prepend.rb
|
341
271
|
- lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb
|
272
|
+
- lib/new_relic/agent/instrumentation/elasticsearch.rb
|
273
|
+
- lib/new_relic/agent/instrumentation/elasticsearch/chain.rb
|
274
|
+
- lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb
|
275
|
+
- lib/new_relic/agent/instrumentation/elasticsearch/prepend.rb
|
342
276
|
- lib/new_relic/agent/instrumentation/excon.rb
|
343
277
|
- lib/new_relic/agent/instrumentation/excon/middleware.rb
|
344
278
|
- lib/new_relic/agent/instrumentation/grape.rb
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# This file is distributed under New Relic's license terms.
|
2
|
-
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
3
|
-
# frozen_string_literal: true
|
4
|
-
|
5
|
-
module NewRelic
|
6
|
-
module Agent
|
7
|
-
module Datastores
|
8
|
-
module Mongo
|
9
|
-
module Obfuscator
|
10
|
-
ALLOWLIST = [:operation].freeze
|
11
|
-
|
12
|
-
def self.obfuscate_statement(source, allowlist = ALLOWLIST)
|
13
|
-
if source.is_a?(Hash)
|
14
|
-
obfuscated = {}
|
15
|
-
source.each do |key, value|
|
16
|
-
if allowlist.include?(key)
|
17
|
-
obfuscated[key] = value
|
18
|
-
else
|
19
|
-
obfuscated[key] = obfuscate_value(value, allowlist)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
obfuscated
|
23
|
-
else
|
24
|
-
obfuscate_value(source, allowlist)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
QUESTION_MARK = '?'.freeze
|
29
|
-
|
30
|
-
def self.obfuscate_value(value, allowlist = ALLOWLIST)
|
31
|
-
if value.is_a?(Hash)
|
32
|
-
obfuscate_statement(value, allowlist)
|
33
|
-
elsif value.is_a?(Array)
|
34
|
-
value.map { |v| obfuscate_value(v, allowlist) }
|
35
|
-
else
|
36
|
-
QUESTION_MARK
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|