instana 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +4 -1
- data/lib/instana/instrumentation/net-http.rb +1 -1
- data/lib/instana/version.rb +1 -1
- data/test/instrumentation/net-http_test.rb +28 -0
- data/test/servers/rackapp_6511.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5188167998cd8f55f33cb1e5efabd7743d9320be
|
4
|
+
data.tar.gz: a8b730858f4f70b2cfdd4fedcda867b54484e580
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e78d461c1c5442e885621209f64c3cc47e20f49858d4237b61404caac6e9872f1b8660e9e9ae50443e9cdeeed63345bacf159becb6c1a62e90996c5e7fdd5f57
|
7
|
+
data.tar.gz: 5794cb3bb5b488406d802210a1234a1b2d1293eb2d451aeb6d91651719fca4e00b5ebeaeeaa2961b0fc3bb5137d154da6df39c2b116be94ff2905f3d36b6e9dc
|
data/Rakefile
CHANGED
@@ -24,7 +24,10 @@ Rake::TestTask.new(:test) do |t|
|
|
24
24
|
'test/frameworks/rails/actioncontroller_test.rb',
|
25
25
|
'test/frameworks/rails/actionview3_test.rb' ]
|
26
26
|
when /libraries/
|
27
|
-
t.test_files = FileList['test/instrumentation/*_test.rb'
|
27
|
+
t.test_files = FileList['test/instrumentation/*_test.rb',
|
28
|
+
'test/frameworks/cuba_test.rb',
|
29
|
+
'test/frameworks/roda_test.rb',
|
30
|
+
'test/frameworks/sinatra_test.rb']
|
28
31
|
else
|
29
32
|
t.test_files = FileList['test/agent/*_test.rb'] +
|
30
33
|
FileList['test/tracing/*_test.rb'] +
|
@@ -46,7 +46,7 @@ if defined?(::Net::HTTP) && ::Instana.config[:nethttp][:enabled]
|
|
46
46
|
if response.code.to_i.between?(500, 511)
|
47
47
|
# Because of the 5xx response, we flag this span as errored but
|
48
48
|
# without a backtrace (no exception)
|
49
|
-
|
49
|
+
::Instana.tracer.log_error(nil)
|
50
50
|
end
|
51
51
|
|
52
52
|
response
|
data/lib/instana/version.rb
CHANGED
@@ -137,4 +137,32 @@ class NetHTTPTest < Minitest::Test
|
|
137
137
|
|
138
138
|
WebMock.disable_net_connect!
|
139
139
|
end
|
140
|
+
|
141
|
+
def test_request_with_5xx_response
|
142
|
+
clear_all!
|
143
|
+
WebMock.allow_net_connect!
|
144
|
+
|
145
|
+
response = nil
|
146
|
+
Instana.tracer.start_or_continue_trace('net-http-error-test') do
|
147
|
+
http = Net::HTTP.new("127.0.0.1", 6511)
|
148
|
+
response = http.request(Net::HTTP::Get.new("/error"))
|
149
|
+
end
|
150
|
+
|
151
|
+
traces = Instana.processor.queued_traces
|
152
|
+
assert_equal 2, traces.count
|
153
|
+
|
154
|
+
request_trace = traces[1]
|
155
|
+
assert_equal 2, request_trace.spans.count
|
156
|
+
assert request_trace.has_error?
|
157
|
+
http_span = request_trace.spans.to_a[1]
|
158
|
+
|
159
|
+
refute_nil http_span.key?(:data)
|
160
|
+
refute_nil http_span[:data].key?(:http)
|
161
|
+
assert_equal "http://127.0.0.1:6511/error", http_span[:data][:http][:url]
|
162
|
+
assert_equal "500", http_span[:data][:http][:status]
|
163
|
+
assert_equal :'net-http', http_span.name
|
164
|
+
assert http_span.key?(:stack)
|
165
|
+
|
166
|
+
WebMock.disable_net_connect!
|
167
|
+
end
|
140
168
|
end
|
@@ -12,6 +12,11 @@ Thread.new do
|
|
12
12
|
[200, {"Content-Type" => "application/json"}, ["[\"Stan\",\"is\",\"on\",\"the\",\"scene!\"]"]]
|
13
13
|
}
|
14
14
|
end
|
15
|
+
map "/error" do
|
16
|
+
run Proc.new { |env|
|
17
|
+
[500, {"Content-Type" => "application/json"}, ["[\"Stan\",\"is\",\"on\",\"the\",\"error!\"]"]]
|
18
|
+
}
|
19
|
+
end
|
15
20
|
}
|
16
21
|
|
17
22
|
Rack::Handler::Puma.run(app, {:Host => '127.0.0.1', :Port => 6511})
|
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.3.
|
4
|
+
version: 1.3.3
|
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: 2017-
|
11
|
+
date: 2017-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|