appsignal 1.2.0.beta.1 → 1.2.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d44539c4d934bc6c75a61244bc52dcc2a67d75a5
|
4
|
+
data.tar.gz: a90fa4a59e8d2529aa5bfd67e8e80d0184d26792
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4714eeb4f848bd99460320f35dfcd9429462a49b178c1cb0dcf6e94bab432a4af261ecd68bf07975c4eb15699cd729539cd3f0b109789338405ef7096681c80
|
7
|
+
data.tar.gz: 66db0f2a4b0019a00b052ae6fde322c6fd4de6621ea7068a90e7f61e5f1740c281ba6817ae7d59ca54819136d44d001ce735b29940c40162928e1055e1c678db
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
* Restart background thread when FD's are closed
|
3
3
|
* Beta version of collecting host metrics (disabled by default)
|
4
4
|
* Hooks for Shuryoken
|
5
|
+
* Don't add errors from env if raise_errors is off for Sinatra
|
5
6
|
|
6
7
|
# 1.1.9
|
7
8
|
* Fix for race condition when creating working dir exactly at the same time
|
@@ -3,9 +3,12 @@ require 'rack'
|
|
3
3
|
module Appsignal
|
4
4
|
module Rack
|
5
5
|
class SinatraInstrumentation
|
6
|
+
attr_reader :raise_errors_on
|
7
|
+
|
6
8
|
def initialize(app, options = {})
|
7
9
|
Appsignal.logger.debug 'Initializing Appsignal::Rack::SinatraInstrumentation'
|
8
10
|
@app, @options = app, options
|
11
|
+
@raise_errors_on = @app.settings.raise_errors
|
9
12
|
end
|
10
13
|
|
11
14
|
def call(env)
|
@@ -34,9 +37,9 @@ module Appsignal
|
|
34
37
|
transaction.set_error(error)
|
35
38
|
raise error
|
36
39
|
ensure
|
37
|
-
#
|
40
|
+
# If raise_error is off versions of Sinatra don't raise errors, but store
|
38
41
|
# them in the sinatra.error env var.
|
39
|
-
transaction.set_error(env['sinatra.error']) if env['sinatra.error']
|
42
|
+
transaction.set_error(env['sinatra.error']) if !@raise_errors_on && env['sinatra.error']
|
40
43
|
transaction.set_action(env['sinatra.route'])
|
41
44
|
transaction.set_metadata('path', request.path)
|
42
45
|
transaction.set_metadata('method', request.request_method)
|
data/lib/appsignal/version.rb
CHANGED
@@ -11,13 +11,13 @@ describe "Sequel integration", if: sequel_present? do
|
|
11
11
|
before { Appsignal::Transaction.create('uuid', Appsignal::Transaction::HTTP_REQUEST, 'test') }
|
12
12
|
|
13
13
|
it "should instrument queries" do
|
14
|
-
expect( Appsignal::
|
14
|
+
expect( Appsignal::Transaction.current ).to receive(:start_event)
|
15
15
|
.at_least(:once)
|
16
|
-
expect( Appsignal::
|
16
|
+
expect( Appsignal::Transaction.current ).to receive(:finish_event)
|
17
17
|
.at_least(:once)
|
18
|
-
.with(
|
18
|
+
.with("sql.sequel", nil, kind_of(String), 1)
|
19
19
|
|
20
|
-
db['SELECT 1'].all
|
20
|
+
db['SELECT 1'].all.to_a
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -12,7 +12,8 @@ if defined?(::Sinatra)
|
|
12
12
|
start_agent
|
13
13
|
end
|
14
14
|
|
15
|
-
let(:
|
15
|
+
let(:settings) { double(:raise_errors => false) }
|
16
|
+
let(:app) { double(:call => true, :settings => settings) }
|
16
17
|
let(:env) { {'sinatra.route' => 'GET /', :path => '/', :method => 'GET'} }
|
17
18
|
let(:options) { {} }
|
18
19
|
let(:middleware) { Appsignal::Rack::SinatraInstrumentation.new(app, options) }
|
@@ -63,6 +64,7 @@ if defined?(::Sinatra)
|
|
63
64
|
let(:app) do
|
64
65
|
double.tap do |d|
|
65
66
|
d.stub(:call).and_raise(error)
|
67
|
+
d.stub(:settings => settings)
|
66
68
|
end
|
67
69
|
end
|
68
70
|
|
@@ -78,6 +80,14 @@ if defined?(::Sinatra)
|
|
78
80
|
it "should set the error" do
|
79
81
|
Appsignal::Transaction.any_instance.should_receive(:set_error).with(error)
|
80
82
|
end
|
83
|
+
|
84
|
+
context "if raise_errors is on" do
|
85
|
+
let(:settings) { double(:raise_errors => true) }
|
86
|
+
|
87
|
+
it "should not set the error" do
|
88
|
+
Appsignal::Transaction.any_instance.should_not_receive(:set_error)
|
89
|
+
end
|
90
|
+
end
|
81
91
|
end
|
82
92
|
|
83
93
|
it "should set the action" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appsignal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.0
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Beekman
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-06-
|
12
|
+
date: 2016-06-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -299,9 +299,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
299
299
|
version: '1.9'
|
300
300
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
301
301
|
requirements:
|
302
|
-
- - "
|
302
|
+
- - ">="
|
303
303
|
- !ruby/object:Gem::Version
|
304
|
-
version:
|
304
|
+
version: '0'
|
305
305
|
requirements: []
|
306
306
|
rubyforge_project:
|
307
307
|
rubygems_version: 2.4.5
|