instana 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 44d2db00220595e42136a421be4f1d9d149fb958
4
- data.tar.gz: 0e52f23d95fbfdf296c4632da28319d170298ca9
3
+ metadata.gz: 5188167998cd8f55f33cb1e5efabd7743d9320be
4
+ data.tar.gz: a8b730858f4f70b2cfdd4fedcda867b54484e580
5
5
  SHA512:
6
- metadata.gz: 1e753d5fbd1c60c52afaa5a8219ee5c4e980dff40c22d27ccfc719ffc4068c72dae09e8a7fe5e072b30aa63e6a4fd5b240af054444df2a7f4a6a1a7b333aed05
7
- data.tar.gz: 768f34f163485454e6371ab0ce2b39e44020a19ff44a9efe5a107b9efe282574f9cdcd6c62893a473fd86e323cb94438f2a751e06063e45cadc0c286c3ccf1a8
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
- add_error(nil)
49
+ ::Instana.tracer.log_error(nil)
50
50
  end
51
51
 
52
52
  response
@@ -1,4 +1,4 @@
1
1
  module Instana
2
- VERSION = "1.3.2"
2
+ VERSION = "1.3.3"
3
3
  VERSION_FULL = "instana-#{VERSION}"
4
4
  end
@@ -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.2
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-02-28 00:00:00.000000000 Z
11
+ date: 2017-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler