instana 1.10.9-java → 1.10.10-java

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: 2e0b041f1a4ee7018a3b441ba1c37f9ed292ea21a44699ce3a0ac6c45c1169a5
4
- data.tar.gz: a03afa75870034fa4a9b028efafaf175e4583359af5be87ecaccd5577bd6c415
3
+ metadata.gz: f41161af3f02da722d5c6ea5909141cbae165095a623213f4734f1ff6f7d8ea2
4
+ data.tar.gz: ecfdd99be5ccca896b46c53db9be42c1b542d89ef7f036c28ecd42c8290144b1
5
5
  SHA512:
6
- metadata.gz: 28fd81fd665342354a1b4d8ada57c850c059a2eb2ddccac6b243ee73cc18affe0a23bdfb1e9df7f22c59bce10e60f14f7af752465bb2ba6d7a710beb262850f4
7
- data.tar.gz: d7a2fccc5c2e2c45ae3fe580cb7361e8cf854a0c05e2c75f4deb59c8e586deffefbce94e6382030da7109fa4317cd77ca9afb722d29f6171aeb63e1c008846be
6
+ metadata.gz: 7e00c3e9d3f66f7585e5b6f41a6cc44d692296f1f048083976eb1949c51cd2c05e0912d7f2e4de052c09f8c2669b972598371e6311ca121f8a7131531f52b496
7
+ data.tar.gz: 65e824158c542d2cf0756bc37da41288e14d7c4efa22df38b9cadc18c1736b7d140eadede22f1d8dd8be5656b107fde8ee4ddbe39523ee606180481676ef3823
@@ -51,9 +51,13 @@ module Instana
51
51
  status, headers, response = @app.call(env)
52
52
 
53
53
  if ::Instana.tracer.tracing?
54
- kvs[:http][:status] = status
54
+ # In case some previous middleware returned a string status, make sure that we're dealing with
55
+ # an integer. In Ruby nil.to_i, "asdfasdf".to_i will always return 0 from Ruby versions 1.8.7 and newer.
56
+ # So if an 0 status is reported here, it indicates some other issue (e.g. no status from previous middleware)
57
+ # See Rack Spec: https://www.rubydoc.info/github/rack/rack/file/SPEC#label-The+Status
58
+ kvs[:http][:status] = status.to_i
55
59
 
56
- if !status.is_a?(Integer) || status.between?(500, 511)
60
+ if status.to_i.between?(500, 511)
57
61
  # Because of the 5xx response, we flag this span as errored but
58
62
  # without a backtrace (no exception)
59
63
  ::Instana.tracer.log_error(nil)
@@ -1,4 +1,4 @@
1
1
  module Instana
2
- VERSION = "1.10.9"
2
+ VERSION = "1.10.10"
3
3
  VERSION_FULL = "instana-#{VERSION}"
4
4
  end
@@ -78,6 +78,49 @@ class ActionControllerTest < Minitest::Test
78
78
  assert_equal "Exception", ac_span[:data][:log][:parameters]
79
79
  end
80
80
 
81
+ def test_api_controller_404
82
+ # Run only when ActionController::API is used/defined
83
+ skip unless defined?(::ActionController::API)
84
+
85
+ clear_all!
86
+
87
+ Net::HTTP.get(URI.parse('http://localhost:3205/api/thispathdoesnotexist'))
88
+
89
+ spans = ::Instana.processor.queued_spans
90
+ assert_equal 1, spans.length
91
+
92
+ rack_span = find_first_span_by_name(spans, :rack)
93
+
94
+ assert_equal false, rack_span.key?(:error)
95
+ assert_equal "/api/thispathdoesnotexist", rack_span[:data][:http][:url]
96
+ assert_equal 404, rack_span[:data][:http][:status]
97
+ assert_equal "GET", rack_span[:data][:http][:method]
98
+ end
99
+
100
+ def test_api_controller_raise_routing_error
101
+ # Run only when ActionController::API is used/defined
102
+ skip unless defined?(::ActionController::API)
103
+
104
+ clear_all!
105
+
106
+ Net::HTTP.get(URI.parse('http://localhost:3205/api/raise_route_error'))
107
+
108
+ spans = ::Instana.processor.queued_spans
109
+ assert_equal 2, spans.length
110
+
111
+ rack_span = find_first_span_by_name(spans, :rack)
112
+ ac_span = find_first_span_by_name(spans, :actioncontroller)
113
+
114
+ assert_equal false, rack_span.key?(:error)
115
+ assert_equal "/api/raise_route_error", rack_span[:data][:http][:url]
116
+ assert_equal 404, rack_span[:data][:http][:status]
117
+ assert_equal "GET", rack_span[:data][:http][:method]
118
+
119
+ assert_equal true, ac_span[:error]
120
+ assert ac_span.key?(:stack)
121
+ assert 1, ac_span[:ec]
122
+ end
123
+
81
124
  def test_404
82
125
  clear_all!
83
126
 
@@ -86,8 +129,28 @@ class ActionControllerTest < Minitest::Test
86
129
  spans = ::Instana.processor.queued_spans
87
130
  assert_equal 1, spans.length
88
131
 
89
- first_span = spans[0]
132
+ rack_span = find_first_span_by_name(spans, :rack)
90
133
 
91
- assert_equal :rack, first_span[:n]
134
+ assert_equal false, rack_span.key?(:error)
135
+ assert_equal 404, rack_span[:data][:http][:status]
136
+ end
137
+
138
+ def test_raise_routing_error
139
+ clear_all!
140
+
141
+ Net::HTTP.get(URI.parse('http://localhost:3205/test/raise_route_error'))
142
+
143
+ spans = ::Instana.processor.queued_spans
144
+ assert_equal 2, spans.length
145
+
146
+ rack_span = find_first_span_by_name(spans, :rack)
147
+ ac_span = find_first_span_by_name(spans, :actioncontroller)
148
+
149
+ assert_equal false, rack_span.key?(:error)
150
+ assert_equal 404, rack_span[:data][:http][:status]
151
+
152
+ assert_equal true, ac_span[:error]
153
+ assert ac_span.key?(:stack)
154
+ assert 1, ac_span[:ec]
92
155
  end
93
156
  end
@@ -39,9 +39,11 @@ class RailsTestApp < Rails::Application
39
39
  get "/test/render_js" => "test#render_js"
40
40
  get "/test/render_alternate_layout" => "test#render_alternate_layout"
41
41
  get "/test/render_partial_that_errors" => "test#render_partial_that_errors"
42
+ get "/test/raise_route_error" => "test#raise_route_error"
42
43
 
43
44
  get "/api/world" => "socket#world"
44
45
  get "/api/error" => "socket#error"
46
+ get "/api/raise_route_error" => "socket#raise_route_error"
45
47
  end
46
48
 
47
49
  # Enable cache classes. Production style.
@@ -172,6 +174,10 @@ class TestController < ActionController::Base
172
174
  def error
173
175
  raise Exception.new("Warning: This is a simulated Error")
174
176
  end
177
+
178
+ def raise_route_error
179
+ raise ActionController::RoutingError.new('Simulated not found')
180
+ end
175
181
  end
176
182
 
177
183
  if ::Rails::VERSION::MAJOR > 4
@@ -184,6 +190,10 @@ if ::Rails::VERSION::MAJOR > 4
184
190
  end
185
191
  end
186
192
 
193
+ def raise_route_error
194
+ raise ActionController::RoutingError.new('Simulated not found')
195
+ end
196
+
187
197
  def error
188
198
  raise Exception.new("Warning: This is a simulated Socket API Error")
189
199
  end
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.10.9
4
+ version: 1.10.10
5
5
  platform: java
6
6
  authors:
7
7
  - Peter Giacomo Lombardo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-07 00:00:00.000000000 Z
11
+ date: 2019-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement