newrelic_rpm 3.16.2.321 → 3.16.3.323
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +15 -14
- data/CHANGELOG +21 -1
- data/lib/new_relic/agent.rb +25 -10
- data/lib/new_relic/agent/agent.rb +3 -1
- 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 +8 -0
- data/lib/new_relic/agent/configuration/manager.rb +1 -1
- data/lib/new_relic/agent/error_collector.rb +5 -1
- data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +59 -0
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +1 -1
- data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +3 -1
- data/lib/new_relic/agent/instrumentation/http.rb +36 -0
- data/lib/new_relic/agent/instrumentation/rack.rb +1 -1
- data/lib/new_relic/agent/new_relic_service/encoders.rb +1 -0
- data/lib/new_relic/agent/pipe_channel_manager.rb +1 -0
- data/lib/new_relic/agent/sampler.rb +7 -7
- data/lib/new_relic/agent/samplers/memory_sampler.rb +2 -0
- data/lib/new_relic/agent/supported_versions.rb +8 -1
- data/lib/new_relic/agent/threading/backtrace_service.rb +1 -0
- data/lib/new_relic/agent/transaction.rb +7 -4
- data/lib/new_relic/agent/transaction/attributes.rb +1 -0
- data/lib/new_relic/agent/transaction/trace_node.rb +5 -10
- data/lib/new_relic/agent/transaction_state.rb +1 -0
- data/lib/new_relic/agent/worker_loop.rb +3 -2
- data/lib/new_relic/cli/commands/deployments.rb +3 -0
- data/lib/new_relic/cli/commands/install.rb +2 -1
- data/lib/new_relic/control/frameworks/rails.rb +4 -4
- data/lib/new_relic/helper.rb +0 -4
- data/lib/new_relic/metric_data.rb +1 -0
- data/lib/new_relic/noticed_error.rb +2 -0
- data/lib/new_relic/version.rb +1 -1
- data/lib/tasks/config.rake +1 -1
- data/lib/tasks/tests.rake +1 -1
- data/lib/tasks/versions.rake +2 -2
- data/newrelic_rpm.gemspec +1 -1
- data/test/agent_helper.rb +5 -10
- data/test/fixtures/cross_agent_tests/docker_container_id/README.md +2 -2
- data/test/fixtures/cross_agent_tests/labels.json +71 -9
- data/test/fixtures/cross_agent_tests/rules.json +1 -1
- data/test/fixtures/cross_agent_tests/synthetics/README.md +2 -2
- data/test/fixtures/cross_agent_tests/synthetics/synthetics.json +5 -5
- data/test/multiverse/lib/multiverse/runner.rb +1 -1
- data/test/multiverse/suites/agent_only/labels_test.rb +1 -1
- data/test/multiverse/suites/agent_only/start_up_test.rb +11 -0
- data/test/multiverse/suites/httprb/Envfile +19 -0
- data/test/multiverse/suites/httprb/config/newrelic.yml +18 -0
- data/test/multiverse/suites/httprb/httprb_test.rb +78 -0
- data/test/multiverse/suites/rails/error_tracing_test.rb +19 -0
- data/test/new_relic/agent/agent_logger_test.rb +0 -14
- data/test/new_relic/agent/commands/thread_profiler_session_test.rb +1 -0
- data/test/new_relic/agent/configuration/manager_test.rb +3 -2
- data/test/new_relic/agent/error_collector_test.rb +27 -2
- data/test/new_relic/agent/instrumentation/middleware_proxy_test.rb +2 -3
- data/test/new_relic/agent/instrumentation/net_instrumentation_test.rb +2 -0
- data/test/new_relic/agent/method_tracer_test.rb +1 -0
- data/test/new_relic/agent/sampler_test.rb +2 -2
- data/test/new_relic/agent/synthetics_event_aggregator_test.rb +1 -0
- data/test/new_relic/agent/threading/backtrace_service_test.rb +8 -0
- data/test/new_relic/agent/transaction/trace_node_test.rb +4 -4
- data/test/new_relic/agent_test.rb +31 -0
- data/test/new_relic/cli/commands/deployments_test.rb +11 -6
- data/test/new_relic/control/class_methods_test.rb +5 -1
- data/test/performance/lib/performance/instrumentation/gc_stats.rb +1 -1
- data/test/performance/lib/performance/instrumentation/stackprof.rb +2 -2
- data/test/performance/lib/performance/platform.rb +1 -0
- data/test/performance/suites/active_record_subscriber.rb +100 -0
- data/ui/helpers/developer_mode_helper.rb +2 -1
- data/ui/helpers/google_pie_chart.rb +1 -0
- data/ui/views/newrelic/explain_sql.rhtml +1 -1
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/action_mailer.rb +1 -1
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/active_merchant.rb +1 -1
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/active_record.rb +1 -1
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/apdex.rb +1 -1
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/controller.rb +1 -1
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/controller_cpu.rb +1 -1
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/errors.rb +1 -1
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/external.rb +1 -1
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/mem_cache.rb +1 -4
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/middleware.rb +1 -2
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/nested.rb +1 -2
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/other_transaction.rb +1 -1
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/view.rb +1 -1
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_frontend.rb +1 -1
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_service.rb +1 -1
- metadata +8 -3
@@ -792,15 +792,18 @@ module NewRelic
|
|
792
792
|
APDEX_TXN_METRIC_PREFIX = 'Apdex/'.freeze
|
793
793
|
APDEX_OTHER_TXN_METRIC_PREFIX = 'ApdexOther/Transaction/'.freeze
|
794
794
|
|
795
|
-
def
|
796
|
-
@exceptions.each do |exception,
|
797
|
-
|
795
|
+
def had_error_affecting_apdex?
|
796
|
+
@exceptions.each do |exception, options|
|
797
|
+
ignored = NewRelic::Agent.instance.error_collector.error_is_ignored?(exception)
|
798
|
+
trace_only = options[:trace_only]
|
799
|
+
|
800
|
+
return true unless ignored || trace_only
|
798
801
|
end
|
799
802
|
false
|
800
803
|
end
|
801
804
|
|
802
805
|
def apdex_bucket(duration, current_apdex_t)
|
803
|
-
self.class.apdex_bucket(duration,
|
806
|
+
self.class.apdex_bucket(duration, had_error_affecting_apdex?, current_apdex_t)
|
804
807
|
end
|
805
808
|
|
806
809
|
def record_apdex(state, end_time=Time.now)
|
@@ -12,14 +12,17 @@ module NewRelic
|
|
12
12
|
attr_reader :exit_timestamp
|
13
13
|
attr_reader :parent_node
|
14
14
|
|
15
|
-
attr_accessor :metric_name
|
15
|
+
attr_accessor :metric_name, :params
|
16
16
|
|
17
17
|
UNKNOWN_NODE_NAME = '<unknown>'.freeze
|
18
18
|
|
19
19
|
def initialize(timestamp, metric_name)
|
20
20
|
@entry_timestamp = timestamp
|
21
21
|
@metric_name = metric_name || UNKNOWN_NODE_NAME
|
22
|
+
@exit_timestamp = nil
|
22
23
|
@called_nodes = nil
|
24
|
+
@params = {}
|
25
|
+
@parent_node = nil
|
23
26
|
end
|
24
27
|
|
25
28
|
# sets the final timestamp on a node to indicate the exit
|
@@ -42,7 +45,7 @@ module NewRelic
|
|
42
45
|
[ NewRelic::Helper.time_to_millis(@entry_timestamp),
|
43
46
|
NewRelic::Helper.time_to_millis(@exit_timestamp),
|
44
47
|
NewRelic::Coerce.string(@metric_name),
|
45
|
-
|
48
|
+
params ] +
|
46
49
|
[ (@called_nodes ? @called_nodes.map{|s| s.to_array} : []) ]
|
47
50
|
end
|
48
51
|
|
@@ -116,14 +119,6 @@ module NewRelic
|
|
116
119
|
params[key]
|
117
120
|
end
|
118
121
|
|
119
|
-
def params
|
120
|
-
@params ||= {}
|
121
|
-
end
|
122
|
-
|
123
|
-
def params=(p)
|
124
|
-
@params = p
|
125
|
-
end
|
126
|
-
|
127
122
|
# call the provided block for this node and each
|
128
123
|
# of the called nodes
|
129
124
|
def each_node(&block)
|
@@ -20,10 +20,11 @@ module NewRelic
|
|
20
20
|
@should_run = true
|
21
21
|
@next_invocation_time = Time.now
|
22
22
|
@period = 60.0
|
23
|
-
@duration = opts[:duration]
|
24
|
-
@limit = opts[:limit]
|
23
|
+
@duration = opts[:duration]
|
24
|
+
@limit = opts[:limit]
|
25
25
|
@iterations = 0
|
26
26
|
@propagate_errors = opts.fetch(:propagate_errors, false)
|
27
|
+
@deadline = nil
|
27
28
|
end
|
28
29
|
|
29
30
|
# Reset state that is changed by running the worker loop
|
@@ -30,6 +30,9 @@ class NewRelic::Cli::Deployments < NewRelic::Cli::Command
|
|
30
30
|
#
|
31
31
|
def initialize command_line_args
|
32
32
|
@control = NewRelic::Control.instance
|
33
|
+
@environment = nil
|
34
|
+
@changelog = nil
|
35
|
+
@user = nil
|
33
36
|
super(command_line_args)
|
34
37
|
@description ||= @leftover && @leftover.join(" ")
|
35
38
|
@user ||= ENV['USER']
|
@@ -22,8 +22,9 @@ class NewRelic::Cli::Install < NewRelic::Cli::Command
|
|
22
22
|
#
|
23
23
|
attr_reader :dest_dir, :license_key, :generated_for_user, :quiet, :src_file, :app_name
|
24
24
|
def initialize command_line_args={}
|
25
|
+
@dest_dir = nil
|
25
26
|
super command_line_args
|
26
|
-
if
|
27
|
+
if @dest_dir.nil?
|
27
28
|
# Install a newrelic.yml file into the local config directory.
|
28
29
|
if File.directory? "config"
|
29
30
|
@dest_dir = "config"
|
@@ -69,7 +69,7 @@ module NewRelic
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def install_agent_hooks(config)
|
72
|
-
return if @agent_hooks_installed
|
72
|
+
return if defined?(@agent_hooks_installed) && @agent_hooks_installed
|
73
73
|
@agent_hooks_installed = true
|
74
74
|
return if config.nil? || !config.respond_to?(:middleware)
|
75
75
|
begin
|
@@ -83,7 +83,7 @@ module NewRelic
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def install_browser_monitoring(config)
|
86
|
-
return if @browser_monitoring_installed
|
86
|
+
return if defined?(@browser_monitoring_installed) && @browser_monitoring_installed
|
87
87
|
@browser_monitoring_installed = true
|
88
88
|
return if config.nil? || !config.respond_to?(:middleware) || !Agent.config[:'browser_monitoring.auto_instrument']
|
89
89
|
begin
|
@@ -96,8 +96,8 @@ module NewRelic
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def install_developer_mode(rails_config)
|
99
|
-
return if @
|
100
|
-
@
|
99
|
+
return if defined?(@developer_mode_installed) && @developer_mode_installed
|
100
|
+
@developer_mode_installed = true
|
101
101
|
if rails_config && rails_config.respond_to?(:middleware)
|
102
102
|
begin
|
103
103
|
require 'new_relic/rack/developer_mode'
|
data/lib/new_relic/helper.rb
CHANGED
data/lib/new_relic/version.rb
CHANGED
data/lib/tasks/config.rake
CHANGED
data/lib/tasks/tests.rake
CHANGED
data/lib/tasks/versions.rake
CHANGED
@@ -33,8 +33,8 @@ namespace :newrelic do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def write_versions(title, type, erb)
|
36
|
-
|
37
|
-
|
36
|
+
title.downcase.gsub(" ", "_")
|
37
|
+
versions_for_type(type)
|
38
38
|
puts erb.result(binding).gsub(/^ *$/, '')
|
39
39
|
end
|
40
40
|
|
data/newrelic_rpm.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.version = NewRelic::VERSION::STRING
|
11
11
|
s.required_ruby_version = '>= 1.8.7'
|
12
12
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
13
|
-
s.authors = [ "Tim Krajcar", "Matthew Wear", "Katherine Wu", "
|
13
|
+
s.authors = [ "Tim Krajcar", "Matthew Wear", "Katherine Wu", "Kenichi Nakamura" ]
|
14
14
|
s.date = Time.now.strftime('%Y-%m-%d')
|
15
15
|
s.licenses = ['New Relic', 'MIT', 'Ruby']
|
16
16
|
s.description = <<-EOS
|
data/test/agent_helper.rb
CHANGED
@@ -330,7 +330,7 @@ end
|
|
330
330
|
|
331
331
|
def refute_contains_request_params(attributes)
|
332
332
|
attributes.keys.each do |key|
|
333
|
-
refute_match
|
333
|
+
refute_match(/^request\.parameters\./, key.to_s)
|
334
334
|
end
|
335
335
|
end
|
336
336
|
|
@@ -622,18 +622,13 @@ def cross_agent_tests_dir
|
|
622
622
|
File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', 'cross_agent_tests'))
|
623
623
|
end
|
624
624
|
|
625
|
-
def replace_camelcase(contents)
|
626
|
-
{ "callCount" => "call_count" }.each_pair do |original, replacement|
|
627
|
-
contents.gsub!(original, replacement)
|
628
|
-
end
|
629
|
-
contents
|
630
|
-
end
|
631
|
-
|
632
625
|
def load_cross_agent_test(name)
|
633
626
|
test_file_path = File.join(cross_agent_tests_dir, "#{name}.json")
|
634
627
|
data = File.read(test_file_path)
|
635
|
-
data
|
636
|
-
NewRelic::JSONWrapper.load(data)
|
628
|
+
data.gsub!('callCount', 'call_count')
|
629
|
+
data = NewRelic::JSONWrapper.load(data)
|
630
|
+
data.each { |testcase| testcase['testname'].gsub! ' ', '_' if String === testcase['testname'] }
|
631
|
+
data
|
637
632
|
end
|
638
633
|
|
639
634
|
def each_cross_agent_test(options)
|
@@ -1,6 +1,6 @@
|
|
1
|
-
These tests cover parsing of Docker container IDs on Linux hosts out of
|
1
|
+
These tests cover parsing of Docker container IDs on Linux hosts out of
|
2
2
|
`/proc/self/cgroup` (or `/proc/<pid>/cgroup` more generally).
|
3
3
|
|
4
|
-
The `cases.json` file lists each filename in this directory containing
|
4
|
+
The `cases.json` file lists each filename in this directory containing
|
5
5
|
example `/proc/self/cgroup` content, and the expected Docker container ID that
|
6
6
|
should be parsed from that file.
|
@@ -18,11 +18,11 @@
|
|
18
18
|
"name": "multiple_labels_with_leading_and_trailing_whitespaces",
|
19
19
|
"labelString": " Data Center : East Coast ; Deployment Flavor : Integration Environment ",
|
20
20
|
"warning": false,
|
21
|
-
"expected": [
|
21
|
+
"expected": [
|
22
22
|
{ "label_type": "Data Center", "label_value": "East Coast" },
|
23
23
|
{ "label_type": "Deployment Flavor", "label_value": "Integration Environment" }
|
24
24
|
]
|
25
|
-
},
|
25
|
+
},
|
26
26
|
{
|
27
27
|
"name": "single",
|
28
28
|
"labelString": "Server:East",
|
@@ -53,7 +53,7 @@
|
|
53
53
|
{
|
54
54
|
"name": "truncation",
|
55
55
|
"labelString": "KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK:VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",
|
56
|
-
"warning":
|
56
|
+
"warning": true,
|
57
57
|
"expected": [ {
|
58
58
|
"label_type": "KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK",
|
59
59
|
"label_value": "VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"
|
@@ -62,19 +62,27 @@
|
|
62
62
|
{
|
63
63
|
"name": "single_label_key_to_be_truncated_with_leading_and_trailing_whitespaces",
|
64
64
|
"labelString": " 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345TTTTT :value",
|
65
|
-
"warning":
|
66
|
-
"expected": [
|
65
|
+
"warning": true,
|
66
|
+
"expected": [
|
67
67
|
{ "label_type": "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345", "label_value": "value" }
|
68
68
|
]
|
69
|
-
},
|
69
|
+
},
|
70
70
|
{
|
71
71
|
"name": "single_label_value_to_be_truncated_with_leading_and_trailing_whitespaces",
|
72
72
|
"labelString": "key: 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345TTTTT ",
|
73
|
+
"warning": true,
|
74
|
+
"expected": [
|
75
|
+
{ "label_type": "key", "label_value": "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345" }
|
76
|
+
]
|
77
|
+
},
|
78
|
+
{
|
79
|
+
"name": "utf8",
|
80
|
+
"labelString": "kéÿ:vãlüê",
|
73
81
|
"warning": false,
|
74
|
-
"expected": [
|
75
|
-
{ "label_type": "
|
82
|
+
"expected": [
|
83
|
+
{ "label_type": "kéÿ", "label_value": "vãlüê" }
|
76
84
|
]
|
77
|
-
},
|
85
|
+
},
|
78
86
|
{
|
79
87
|
"name": "failed_no_delimiters",
|
80
88
|
"labelString": "Server",
|
@@ -129,5 +137,59 @@
|
|
129
137
|
{ "label_type": "50", "label_value": "50" }, { "label_type": "51", "label_value": "51" }, { "label_type": "52", "label_value": "52" }, { "label_type": "53", "label_value": "53" }, { "label_type": "54", "label_value": "54" },
|
130
138
|
{ "label_type": "55", "label_value": "55" }, { "label_type": "56", "label_value": "56" }, { "label_type": "57", "label_value": "57" }, { "label_type": "58", "label_value": "58" }, { "label_type": "59", "label_value": "59" },
|
131
139
|
{ "label_type": "60", "label_value": "60" }, { "label_type": "61", "label_value": "61" }, { "label_type": "62", "label_value": "62" }, { "label_type": "63", "label_value": "63" } ]
|
140
|
+
},
|
141
|
+
{
|
142
|
+
"name": "trailing_semicolons",
|
143
|
+
"labelString": "foo:bar;;",
|
144
|
+
"warning": false,
|
145
|
+
"expected": [ { "label_type": "foo", "label_value": "bar" } ]
|
146
|
+
},
|
147
|
+
{
|
148
|
+
"name": "leading_semicolons",
|
149
|
+
"labelString": ";;foo:bar",
|
150
|
+
"warning": false,
|
151
|
+
"expected": [ { "label_type": "foo", "label_value": "bar" } ]
|
152
|
+
},
|
153
|
+
{
|
154
|
+
"name": "empty_label",
|
155
|
+
"labelString": "foo:bar;;zip:zap",
|
156
|
+
"warning": true,
|
157
|
+
"expected": []
|
158
|
+
},
|
159
|
+
{
|
160
|
+
"name": "trailing_colons",
|
161
|
+
"labelString": "foo:bar;:",
|
162
|
+
"warning": true,
|
163
|
+
"expected": []
|
164
|
+
},
|
165
|
+
{
|
166
|
+
"name": "leading_colons",
|
167
|
+
"labelString": ":;foo:bar",
|
168
|
+
"warning": true,
|
169
|
+
"expected": []
|
170
|
+
},
|
171
|
+
{
|
172
|
+
"name": "empty_pair",
|
173
|
+
"labelString": " : ",
|
174
|
+
"warning": true,
|
175
|
+
"expected": []
|
176
|
+
},
|
177
|
+
{
|
178
|
+
"name": "empty_pair_in_middle_of_string",
|
179
|
+
"labelString": "foo:bar; : ;zip:zap",
|
180
|
+
"warning": true,
|
181
|
+
"expected": []
|
182
|
+
},
|
183
|
+
{
|
184
|
+
"name": "long_multibyte_utf8",
|
185
|
+
"labelString": "foo:€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€",
|
186
|
+
"warning": true,
|
187
|
+
"expected": [ { "label_type": "foo", "label_value": "€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€" } ]
|
188
|
+
},
|
189
|
+
{
|
190
|
+
"name": "long_4byte_utf8",
|
191
|
+
"labelString": "foo:𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆",
|
192
|
+
"warning": true,
|
193
|
+
"expected": [ { "label_type": "foo", "label_value": "𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆𝌆"}]
|
132
194
|
}
|
133
195
|
]
|
@@ -19,7 +19,7 @@
|
|
19
19
|
]
|
20
20
|
},
|
21
21
|
{
|
22
|
-
"testname":"replace
|
22
|
+
"testname":"replace segment",
|
23
23
|
"rules":[{"match_expression":"^/userid/.*/folderid", "replacement":"/userid/*/folderid/*", "ignore":false, "eval_order":1},
|
24
24
|
{"match_expression":"/need_not_be_first_segment/.*", "replacement":"*/need_not_be_first_segment/*", "ignore":false, "eval_order":2}],
|
25
25
|
"tests":
|
@@ -19,7 +19,7 @@ The `settings` hash contains a number of key-value pairs that the agent will nee
|
|
19
19
|
| Name | Meaning |
|
20
20
|
| ---- | ------- |
|
21
21
|
| `agentEncodingKey`| The encoding key used by the agent for deobfuscation of the Synthetics request header. |
|
22
|
-
| `syntheticsEncodingKey` | The encoding key used by Synthetics to obfuscate the Synthetics request header. In most tests, `
|
22
|
+
| `syntheticsEncodingKey` | The encoding key used by Synthetics to obfuscate the Synthetics request header. In most tests, `agentEncodingKey` and `syntheticsEncodingKey` are the same. |
|
23
23
|
| `transactionGuid` | The GUID of the simulated transaction. In a non-simulated transaction, this will be randomly generated. But, for testing purposes, you should assign this value as the GUID, since the tests will check for this value to be set in the `nr.guid` attribute of the Transaction Event. |
|
24
24
|
| `trustedAccountIds` | A list of accounts ids that the agent trusts. If the Synthetics request contains a non-trusted account id, it is an invalid request.|
|
25
25
|
|
@@ -30,7 +30,7 @@ The input for each test is a Synthetics request header. The test fixture file sh
|
|
30
30
|
| Name | Meaning |
|
31
31
|
| ---- | ------- |
|
32
32
|
| `inputHeaderPayload` | A decoded form of the contents of the `X-NewRelic-Synthetics` request header. |
|
33
|
-
| `inputObfuscatedHeader` | An obfuscated form of the `X-NewRelic-Synthetics` request header. If you obfuscate `
|
33
|
+
| `inputObfuscatedHeader` | An obfuscated form of the `X-NewRelic-Synthetics` request header. If you obfuscate `inputHeaderPayload` using the `syntheticsEncodingKey`, this should be the output. |
|
34
34
|
|
35
35
|
## Outputs
|
36
36
|
|
@@ -87,7 +87,7 @@
|
|
87
87
|
{
|
88
88
|
"name": "invalid_synthetics_request_unsupported_version",
|
89
89
|
"settings": {
|
90
|
-
"
|
90
|
+
"agentEncodingKey": "1234567890123456789012345678901234567890",
|
91
91
|
"syntheticsEncodingKey": "1234567890123456789012345678901234567890",
|
92
92
|
"transactionGuid": "9323dc260548ed0e",
|
93
93
|
"trustedAccountIds": [
|
@@ -133,7 +133,7 @@
|
|
133
133
|
{
|
134
134
|
"name": "invalid_synthetics_request_untrusted_account_id",
|
135
135
|
"settings": {
|
136
|
-
"
|
136
|
+
"agentEncodingKey": "1234567890123456789012345678901234567890",
|
137
137
|
"syntheticsEncodingKey": "1234567890123456789012345678901234567890",
|
138
138
|
"transactionGuid": "9323dc260548ed0e",
|
139
139
|
"trustedAccountIds": [
|
@@ -179,7 +179,7 @@
|
|
179
179
|
{
|
180
180
|
"name": "invalid_synthetics_request_mismatched_encoding_key",
|
181
181
|
"settings": {
|
182
|
-
"
|
182
|
+
"agentEncodingKey": "0000000000000000000000000000000000000000",
|
183
183
|
"syntheticsEncodingKey": "1234567890123456789012345678901234567890",
|
184
184
|
"transactionGuid": "9323dc260548ed0e",
|
185
185
|
"trustedAccountIds": [
|
@@ -225,7 +225,7 @@
|
|
225
225
|
{
|
226
226
|
"name": "invalid_synthetics_request_too_few_header_elements",
|
227
227
|
"settings": {
|
228
|
-
"
|
228
|
+
"agentEncodingKey": "1234567890123456789012345678901234567890",
|
229
229
|
"syntheticsEncodingKey": "1234567890123456789012345678901234567890",
|
230
230
|
"transactionGuid": "9323dc260548ed0e",
|
231
231
|
"trustedAccountIds": [
|
@@ -270,7 +270,7 @@
|
|
270
270
|
{
|
271
271
|
"name": "invalid_synthetics_request_too_many_header_elements",
|
272
272
|
"settings": {
|
273
|
-
"
|
273
|
+
"agentEncodingKey": "1234567890123456789012345678901234567890",
|
274
274
|
"syntheticsEncodingKey": "1234567890123456789012345678901234567890",
|
275
275
|
"transactionGuid": "9323dc260548ed0e",
|
276
276
|
"trustedAccountIds": [
|