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.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +15 -14
  3. data/CHANGELOG +21 -1
  4. data/lib/new_relic/agent.rb +25 -10
  5. data/lib/new_relic/agent/agent.rb +3 -1
  6. data/lib/new_relic/agent/audit_logger.rb +1 -0
  7. data/lib/new_relic/agent/commands/thread_profiler_session.rb +1 -0
  8. data/lib/new_relic/agent/configuration/default_source.rb +8 -0
  9. data/lib/new_relic/agent/configuration/manager.rb +1 -1
  10. data/lib/new_relic/agent/error_collector.rb +5 -1
  11. data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +59 -0
  12. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +1 -1
  13. data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +3 -1
  14. data/lib/new_relic/agent/instrumentation/http.rb +36 -0
  15. data/lib/new_relic/agent/instrumentation/rack.rb +1 -1
  16. data/lib/new_relic/agent/new_relic_service/encoders.rb +1 -0
  17. data/lib/new_relic/agent/pipe_channel_manager.rb +1 -0
  18. data/lib/new_relic/agent/sampler.rb +7 -7
  19. data/lib/new_relic/agent/samplers/memory_sampler.rb +2 -0
  20. data/lib/new_relic/agent/supported_versions.rb +8 -1
  21. data/lib/new_relic/agent/threading/backtrace_service.rb +1 -0
  22. data/lib/new_relic/agent/transaction.rb +7 -4
  23. data/lib/new_relic/agent/transaction/attributes.rb +1 -0
  24. data/lib/new_relic/agent/transaction/trace_node.rb +5 -10
  25. data/lib/new_relic/agent/transaction_state.rb +1 -0
  26. data/lib/new_relic/agent/worker_loop.rb +3 -2
  27. data/lib/new_relic/cli/commands/deployments.rb +3 -0
  28. data/lib/new_relic/cli/commands/install.rb +2 -1
  29. data/lib/new_relic/control/frameworks/rails.rb +4 -4
  30. data/lib/new_relic/helper.rb +0 -4
  31. data/lib/new_relic/metric_data.rb +1 -0
  32. data/lib/new_relic/noticed_error.rb +2 -0
  33. data/lib/new_relic/version.rb +1 -1
  34. data/lib/tasks/config.rake +1 -1
  35. data/lib/tasks/tests.rake +1 -1
  36. data/lib/tasks/versions.rake +2 -2
  37. data/newrelic_rpm.gemspec +1 -1
  38. data/test/agent_helper.rb +5 -10
  39. data/test/fixtures/cross_agent_tests/docker_container_id/README.md +2 -2
  40. data/test/fixtures/cross_agent_tests/labels.json +71 -9
  41. data/test/fixtures/cross_agent_tests/rules.json +1 -1
  42. data/test/fixtures/cross_agent_tests/synthetics/README.md +2 -2
  43. data/test/fixtures/cross_agent_tests/synthetics/synthetics.json +5 -5
  44. data/test/multiverse/lib/multiverse/runner.rb +1 -1
  45. data/test/multiverse/suites/agent_only/labels_test.rb +1 -1
  46. data/test/multiverse/suites/agent_only/start_up_test.rb +11 -0
  47. data/test/multiverse/suites/httprb/Envfile +19 -0
  48. data/test/multiverse/suites/httprb/config/newrelic.yml +18 -0
  49. data/test/multiverse/suites/httprb/httprb_test.rb +78 -0
  50. data/test/multiverse/suites/rails/error_tracing_test.rb +19 -0
  51. data/test/new_relic/agent/agent_logger_test.rb +0 -14
  52. data/test/new_relic/agent/commands/thread_profiler_session_test.rb +1 -0
  53. data/test/new_relic/agent/configuration/manager_test.rb +3 -2
  54. data/test/new_relic/agent/error_collector_test.rb +27 -2
  55. data/test/new_relic/agent/instrumentation/middleware_proxy_test.rb +2 -3
  56. data/test/new_relic/agent/instrumentation/net_instrumentation_test.rb +2 -0
  57. data/test/new_relic/agent/method_tracer_test.rb +1 -0
  58. data/test/new_relic/agent/sampler_test.rb +2 -2
  59. data/test/new_relic/agent/synthetics_event_aggregator_test.rb +1 -0
  60. data/test/new_relic/agent/threading/backtrace_service_test.rb +8 -0
  61. data/test/new_relic/agent/transaction/trace_node_test.rb +4 -4
  62. data/test/new_relic/agent_test.rb +31 -0
  63. data/test/new_relic/cli/commands/deployments_test.rb +11 -6
  64. data/test/new_relic/control/class_methods_test.rb +5 -1
  65. data/test/performance/lib/performance/instrumentation/gc_stats.rb +1 -1
  66. data/test/performance/lib/performance/instrumentation/stackprof.rb +2 -2
  67. data/test/performance/lib/performance/platform.rb +1 -0
  68. data/test/performance/suites/active_record_subscriber.rb +100 -0
  69. data/ui/helpers/developer_mode_helper.rb +2 -1
  70. data/ui/helpers/google_pie_chart.rb +1 -0
  71. data/ui/views/newrelic/explain_sql.rhtml +1 -1
  72. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/action_mailer.rb +1 -1
  73. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/active_merchant.rb +1 -1
  74. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/active_record.rb +1 -1
  75. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/apdex.rb +1 -1
  76. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/controller.rb +1 -1
  77. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/controller_cpu.rb +1 -1
  78. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/errors.rb +1 -1
  79. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/external.rb +1 -1
  80. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/mem_cache.rb +1 -4
  81. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/middleware.rb +1 -2
  82. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/nested.rb +1 -2
  83. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/other_transaction.rb +1 -1
  84. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/view.rb +1 -1
  85. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_frontend.rb +1 -1
  86. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_service.rb +1 -1
  87. metadata +8 -3
@@ -26,6 +26,7 @@ module NewRelic
26
26
  def initialize(event_listener=nil)
27
27
  @profiles = {}
28
28
  @buffer = {}
29
+ @last_poll = nil
29
30
 
30
31
  # synchronizes access to @profiles and @buffer above
31
32
  @lock = Mutex.new
@@ -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 had_error?
796
- @exceptions.each do |exception, _|
797
- return true unless NewRelic::Agent.instance.error_collector.error_is_ignored?(exception)
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, had_error?, current_apdex_t)
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)
@@ -25,6 +25,7 @@ module NewRelic
25
25
 
26
26
  @custom_destinations = {}
27
27
  @agent_destinations = {}
28
+ @already_warned_count_limit = nil
28
29
  end
29
30
 
30
31
  def add_agent_attribute(key, value, default_destinations)
@@ -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
- (@params || {}) ] +
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)
@@ -38,6 +38,7 @@ module NewRelic
38
38
  @traced_method_stack = TracedMethodStack.new
39
39
  @current_transaction = nil
40
40
  @record_tt = nil
41
+ @record_sql = nil
41
42
  end
42
43
 
43
44
  # This starts the timer for the transaction.
@@ -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] if opts[:duration]
24
- @limit = opts[:limit] if 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 !@dest_dir
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 @installed
100
- @installed = true
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'
@@ -47,9 +47,5 @@ module NewRelic
47
47
  def time_to_millis(time)
48
48
  (time.to_f * 1000).round
49
49
  end
50
-
51
- def milliseconds_to_seconds(milliseconds)
52
- milliseconds / 1000.0
53
- end
54
50
  end
55
51
  end
@@ -12,6 +12,7 @@ module NewRelic
12
12
  attr_accessor :stats
13
13
 
14
14
  def initialize(metric_spec, stats)
15
+ @original_spec = nil
15
16
  @metric_spec = metric_spec
16
17
  self.stats = stats
17
18
  end
@@ -57,6 +57,8 @@ class NewRelic::NoticedError
57
57
  @message = STRIPPED_EXCEPTION_REPLACEMENT_MESSAGE
58
58
  end
59
59
 
60
+ @attributes_from_notice_error = nil
61
+ @attributes = nil
60
62
  @timestamp = timestamp
61
63
  end
62
64
 
@@ -12,7 +12,7 @@ module NewRelic
12
12
 
13
13
  MAJOR = 3
14
14
  MINOR = 16
15
- TINY = 2
15
+ TINY = 3
16
16
 
17
17
  begin
18
18
  require File.join(File.dirname(__FILE__), 'build')
@@ -23,7 +23,7 @@ namespace :newrelic do
23
23
 
24
24
  def output(format)
25
25
  config_hash = build_config_hash
26
- sections = flatten_config_hash(config_hash)
26
+ flatten_config_hash(config_hash)
27
27
 
28
28
  puts build_erb(format).result(binding)
29
29
  end
@@ -1,6 +1,6 @@
1
1
  begin
2
2
  require 'rake/testtask'
3
- rescue LoadError => e
3
+ rescue LoadError
4
4
  end
5
5
 
6
6
  if defined? Rake::TestTask
@@ -33,8 +33,8 @@ namespace :newrelic do
33
33
  end
34
34
 
35
35
  def write_versions(title, type, erb)
36
- anchor = title.downcase.gsub(" ", "_")
37
- versions = versions_for_type(type)
36
+ title.downcase.gsub(" ", "_")
37
+ versions_for_type(type)
38
38
  puts erb.result(binding).gsub(/^ *$/, '')
39
39
  end
40
40
 
@@ -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", "Caito Scherr", "Kenichi Nakamura" ]
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
@@ -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 /^request\.parameters\./, key.to_s
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 = replace_camelcase(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": false,
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": false,
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": "key", "label_value": "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345" }
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 first",
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, `encodingKey` and `syntheticsEncodingKey` are the same. |
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 `syntheticsHeaderPayload` using the CAT obfuscation algorithm, this should be the output. |
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
- "encodingKey": "1234567890123456789012345678901234567890",
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
- "encodingKey": "1234567890123456789012345678901234567890",
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
- "encodingKey": "0000000000000000000000000000000000000000",
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
- "encodingKey": "1234567890123456789012345678901234567890",
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
- "encodingKey": "1234567890123456789012345678901234567890",
273
+ "agentEncodingKey": "1234567890123456789012345678901234567890",
274
274
  "syntheticsEncodingKey": "1234567890123456789012345678901234567890",
275
275
  "transactionGuid": "9323dc260548ed0e",
276
276
  "trustedAccountIds": [