instana 1.203.1 → 1.204.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30b95f7d7a20b4c6e978178d9708495c307111d2659ddaf29c6638665c9c42ca
4
- data.tar.gz: 5bc631b90006f67a4212ec8c829aed86c0570da5a971900a51437e451cbaa0ea
3
+ metadata.gz: 16c9cdd17a56509785d25d08fad5de5785f558408cba098c42eab712a4fffd5b
4
+ data.tar.gz: d1a482064a6df6988fccb5ae72c39bf575ec5e2e50c5c2c2b652c18aa26b2f6c
5
5
  SHA512:
6
- metadata.gz: c8baf2c88198df4ff332d27d19d4273bf451099f52a97ab3b140b07bd54dd02a2edbf42a1751d81f4093beefd484dd8c38c01b53a84492ed7688a173504e69e6
7
- data.tar.gz: fe458114c4e7062b327f2491b4d4b04889deab2c121a6810626887c45453f83343f497c2f86b895772a354b3755d2317a2c46c0474aec3400a1835efdf09b06f
6
+ metadata.gz: a797522fc38b6eed1b5b7f6a38ca7f25659fade4a16528e69ab2ebc96128e15e67c1bedcf5dec6dfff5b5e33a20862f933ad65cdf95ea5481d2dd92f0958944d
7
+ data.tar.gz: 68531c76fe1ef1a79cf58f69f9f0a4cca17c69fc00926d9efd584d161f5b19d5647958666fe79885f20f218c04cdf9aa663212b792c8c77f61369b9c37e683ba
@@ -5,7 +5,7 @@ module Instana
5
5
  module Activators
6
6
  class ActionMailer < Activator
7
7
  def can_instrument?
8
- defined?(::ActionMailer::Base)
8
+ defined?(::ActionMailer::Base) && defined?(ActiveSupport::Executor)
9
9
  end
10
10
 
11
11
  def instrument
@@ -11,7 +11,7 @@ module Instana
11
11
  end
12
12
 
13
13
  def remove_from_query(str, secret_values = Instana.agent.secret_values)
14
- return str unless secret_values
14
+ return str unless secret_values && str
15
15
 
16
16
  begin
17
17
  url = URI(str)
@@ -2,6 +2,7 @@
2
2
  # (c) Copyright Instana Inc. 2016
3
3
 
4
4
  require 'thread'
5
+ require 'forwardable'
5
6
 
6
7
  module Instana
7
8
  class Processor
@@ -80,34 +80,16 @@ module Instana
80
80
  # @param limit [Integer] Limit the backtrace to the top <limit> frames
81
81
  #
82
82
  def add_stack(limit: 30, stack: Kernel.caller)
83
- frame_count = 0
84
- sanitized_stack = []
85
- @data[:stack] = []
86
- limit = 40 if limit > 40
87
-
88
- stack.each do |i|
89
- # If the stack has the full instana gem version in it's path
90
- # then don't include that frame. Also don't exclude the Rack module.
91
- if !i.match(/instana\/instrumentation\/rack.rb/).nil? ||
92
- (i.match(::Instana::VERSION_FULL).nil? && i.match('lib/instana/').nil?)
93
-
94
- x = i.split(':')
95
-
96
- sanitized_stack << {
97
- :c => x[0],
98
- :n => x[1],
99
- :m => x[2]
100
- }
101
- end
102
- end
103
-
104
- if sanitized_stack.length > limit
105
- # (limit * -1) gives us negative form of <limit> used for
106
- # slicing from the end of the list. e.g. stack[-30, 30]
107
- @data[:stack] = sanitized_stack[limit*-1, limit]
108
- else
109
- @data[:stack] = sanitized_stack
110
- end
83
+ @data[:stack] = stack
84
+ .map do |call|
85
+ file, line, *method = call.split(':')
86
+
87
+ {
88
+ c: file,
89
+ n: line,
90
+ m: method.join(' ')
91
+ }
92
+ end.take(limit > 40 ? 40 : limit)
111
93
  end
112
94
 
113
95
  # Log an error into the span
@@ -2,6 +2,6 @@
2
2
  # (c) Copyright Instana Inc. 2016
3
3
 
4
4
  module Instana
5
- VERSION = "1.203.1"
5
+ VERSION = "1.204.0"
6
6
  VERSION_FULL = "instana-#{VERSION}"
7
7
  end
@@ -29,6 +29,24 @@ class NetHTTPTest < Minitest::Test
29
29
  WebMock.disable_net_connect!
30
30
  end
31
31
 
32
+ def test_get_without_query
33
+ clear_all!
34
+ WebMock.allow_net_connect!
35
+
36
+ Instana.tracer.start_or_continue_trace(:"net-http-test") do
37
+ Net::HTTP.get(URI('http://127.0.0.1:6511/'))
38
+ end
39
+
40
+ spans = ::Instana.processor.queued_spans
41
+ assert_equal 3, spans.length
42
+
43
+ http_span = find_first_span_by_name(spans, :'net-http')
44
+ assert_equal "http://127.0.0.1:6511/", http_span[:data][:http][:url]
45
+ assert_equal "200", http_span[:data][:http][:status]
46
+
47
+ WebMock.disable_net_connect!
48
+ end
49
+
32
50
  def test_block_request
33
51
  clear_all!
34
52
  WebMock.allow_net_connect!
data/test/secrets_test.rb CHANGED
@@ -88,6 +88,15 @@ class SecretsTest < Minitest::Test
88
88
  assert_redacted @subject.remove_from_query(url, sample_config), %w(filter[instantiate]), raw_str: true
89
89
  end
90
90
 
91
+ def test_with_nil
92
+ sample_config = {
93
+ "matcher"=>"contains",
94
+ "list"=>["stan"]
95
+ }
96
+
97
+ assert_equal @subject.remove_from_query(nil, sample_config), nil
98
+ end
99
+
91
100
  private
92
101
 
93
102
  def url_for(keys)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instana
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.203.1
4
+ version: 1.204.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Giacomo Lombardo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-07 00:00:00.000000000 Z
11
+ date: 2021-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler