appsignal 0.6.1 → 0.6.2
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 +8 -8
- data/.travis.yml +3 -16
- data/CHANGELOG.md +3 -0
- data/README.md +11 -4
- data/Rakefile +2 -0
- data/gemfiles/3.0.gemfile +1 -1
- data/gemfiles/3.1.gemfile +1 -1
- data/gemfiles/3.2.gemfile +1 -1
- data/gemfiles/{edge.gemfile → 4.0.gemfile} +1 -1
- data/lib/appsignal/exception_notification.rb +8 -5
- data/lib/appsignal/version.rb +1 -1
- data/spec/appsignal/auth_check_spec.rb +1 -1
- data/spec/appsignal/capistrano_spec.rb +1 -1
- data/spec/appsignal/cli_spec.rb +1 -1
- data/spec/appsignal/exception_notification_spec.rb +28 -2
- data/spec/appsignal/listener_spec.rb +2 -2
- data/spec/appsignal/marker_spec.rb +1 -1
- data/spec/appsignal/middleware/chain_spec.rb +3 -3
- data/spec/appsignal/railtie_spec.rb +2 -2
- data/spec/appsignal/transaction_spec.rb +3 -3
- data/spec/appsignal/transmitter_spec.rb +3 -3
- data/spec/appsignal_spec.rb +1 -1
- data/spec/generators/appsignal/appsignal_generator_spec.rb +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmJjMGRiZGFhZmQxMGU0N2MwMzkzNDQ1YmZhMjlkYzZkMDM0YmJjMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTJhNzg1NTBmMDA4ZDlhZDU3YTgzY2YzNzMxOGVmY2RlNjI5YmY0Yw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZWNiMDkyZjI0MGNmZDE0Njg4ZDdkMGVhZWUzYWU2OTdkNzg2NmY5MzgwODAy
|
10
|
+
NjMwOTNiMmQyZGI5NGI2NWIwNjllNWMzMTQ3OWRjNDRmMDgxYzRiMDcxMjI0
|
11
|
+
MTY4ZTY3MjNkMWUxOGU1MTFjYjNjN2YxMTg4Zjc0OWUxMmNlMzc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTk2ZjVjNTIxYjlmMTIwNDVhNDEyMmZkMzE2YWY3ODE2NWM3NDFhY2VhMWVk
|
14
|
+
YzA0OTgyODVhNmU2ZWZiMWI4NDE5YWI5N2RlNDlmYWExMTkzZGNmMTY1MTk1
|
15
|
+
ZmNhOTAyMGJkYTJjOTcxMmU3ZTQ4YmU1MDhjNDA4Yjg4YTcwYzQ=
|
data/.travis.yml
CHANGED
@@ -1,31 +1,18 @@
|
|
1
1
|
language: ruby
|
2
2
|
|
3
3
|
rvm:
|
4
|
-
- 1.8.7
|
5
|
-
- 1.9.2
|
6
4
|
- 1.9.3
|
7
|
-
-
|
8
|
-
- ruby-head
|
9
|
-
- jruby-18mode
|
5
|
+
- 2.0.0
|
10
6
|
- jruby-19mode
|
11
|
-
- jruby-head
|
12
7
|
|
13
8
|
gemfile:
|
14
9
|
- gemfiles/3.0.gemfile
|
15
10
|
- gemfiles/3.1.gemfile
|
16
11
|
- gemfiles/3.2.gemfile
|
17
|
-
- gemfiles/
|
12
|
+
- gemfiles/4.0.gemfile
|
18
13
|
|
19
14
|
matrix:
|
20
|
-
exclude:
|
21
|
-
- rvm: 1.8.7
|
22
|
-
gemfile: gemfiles/edge.gemfile
|
23
15
|
allow_failures:
|
24
|
-
-
|
25
|
-
- gemfile: gemfiles/edge.gemfile
|
16
|
+
- rvm: jruby-19mode
|
26
17
|
|
27
18
|
script: RAILS_ENV=test bundle exec rspec spec
|
28
|
-
|
29
|
-
notifications:
|
30
|
-
campfire: 80beans:d43f43244263cafb088182aa79e7d96419da0372@188927
|
31
|
-
email: false
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,12 +1,16 @@
|
|
1
|
-
|
1
|
+
AppSignal agent
|
2
2
|
=================
|
3
3
|
|
4
|
+
This gem collects error and performance data from your Rails
|
5
|
+
applications and sends it to [AppSignal](https://appsignal.com)
|
6
|
+
|
7
|
+
[](https://travis-ci.org/appsignal/appsignal)
|
8
|
+
[](https://codeclimate.com/github/appsignal/appsignal)
|
4
9
|
|
5
10
|
## Pull requests / issues
|
6
11
|
|
7
12
|
New features should be made in an issue or pullrequest. Title format is as follows:
|
8
13
|
|
9
|
-
|
10
14
|
name [request_count]
|
11
15
|
|
12
16
|
example
|
@@ -14,9 +18,10 @@ example
|
|
14
18
|
tagging [2]
|
15
19
|
|
16
20
|
## Postprocessing middleware
|
17
|
-
|
21
|
+
|
22
|
+
Appsignal sends Rails
|
18
23
|
[ActiveSupport::Notification](http://api.rubyonrails.org/classes/ActiveSupport/Notifications.html)-events
|
19
|
-
to
|
24
|
+
to AppSignal over SSL. These events contain basic metadata such as a name
|
20
25
|
and timestamps, and additional 'payload' log data. Appsignal uses a postprocessing
|
21
26
|
middleware stack to clean up events before they get sent to appsignal.com. You
|
22
27
|
can add your own middleware to this stack in `config/environment/my_env.rb`.
|
@@ -24,6 +29,7 @@ can add your own middleware to this stack in `config/environment/my_env.rb`.
|
|
24
29
|
### Examples
|
25
30
|
|
26
31
|
#### Minimal template
|
32
|
+
|
27
33
|
```ruby
|
28
34
|
class MiddlewareTemplate
|
29
35
|
def call(event)
|
@@ -37,6 +43,7 @@ Appsignal.postprocessing_middleware.add MiddlewareTemplate
|
|
37
43
|
```
|
38
44
|
|
39
45
|
#### Remove boring payloads
|
46
|
+
|
40
47
|
```ruby
|
41
48
|
class RemoveBoringPayload
|
42
49
|
def call(event)
|
data/Rakefile
CHANGED
@@ -3,6 +3,7 @@ require 'appsignal/version'
|
|
3
3
|
task :publish do
|
4
4
|
NAME = 'appsignal'
|
5
5
|
VERSION_FILE = 'lib/appsignal/version.rb'
|
6
|
+
CHANGELOG_FILE = 'CHANGELOG.md'
|
6
7
|
|
7
8
|
raise '$EDITOR should be set' unless ENV['EDITOR']
|
8
9
|
|
@@ -49,6 +50,7 @@ task :publish do
|
|
49
50
|
if changes.member?(VERSION_FILE)
|
50
51
|
Appsignal.send(:remove_const, :VERSION)
|
51
52
|
load File.expand_path(VERSION_FILE)
|
53
|
+
system("$EDITOR #{CHANGELOG_FILE}")
|
52
54
|
build_and_push_gem
|
53
55
|
create_and_push_tag
|
54
56
|
else
|
data/gemfiles/3.0.gemfile
CHANGED
data/gemfiles/3.1.gemfile
CHANGED
data/gemfiles/3.2.gemfile
CHANGED
@@ -5,13 +5,16 @@ module Appsignal
|
|
5
5
|
end
|
6
6
|
|
7
7
|
class ExceptionNotification
|
8
|
-
attr_reader :env, :exception, :
|
8
|
+
attr_reader :env, :exception, :backtrace
|
9
9
|
|
10
|
-
def initialize(env, exception,
|
10
|
+
def initialize(env, exception, run_rails_cleaner=true)
|
11
|
+
@env = env
|
11
12
|
@exception = exception
|
12
|
-
|
13
|
-
Rails.backtrace_cleaner.
|
14
|
-
|
13
|
+
if run_rails_cleaner && Rails.respond_to?(:backtrace_cleaner)
|
14
|
+
@backtrace = Rails.backtrace_cleaner.clean(@exception.backtrace, nil)
|
15
|
+
else
|
16
|
+
@backtrace = @exception.backtrace
|
17
|
+
end
|
15
18
|
end
|
16
19
|
|
17
20
|
def name
|
data/lib/appsignal/version.rb
CHANGED
data/spec/appsignal/cli_spec.rb
CHANGED
@@ -2,11 +2,37 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Appsignal::ExceptionNotification do
|
4
4
|
let(:error) { StandardError.new('moo') }
|
5
|
-
let(:notification) { Appsignal::ExceptionNotification.new({}, error) }
|
5
|
+
let(:notification) { Appsignal::ExceptionNotification.new({}, error, false) }
|
6
6
|
subject { notification }
|
7
|
-
before
|
7
|
+
before do
|
8
|
+
Rails.stub(:root => '/home/app/current')
|
9
|
+
end
|
8
10
|
|
11
|
+
its(:env) { should == {} }
|
9
12
|
its(:exception) { should == error }
|
10
13
|
its(:name) { should == 'StandardError' }
|
11
14
|
its(:message) { should == 'moo' }
|
15
|
+
|
16
|
+
context "backtrace" do
|
17
|
+
let(:backtrace) do
|
18
|
+
[
|
19
|
+
'/home/app/current/app/controllers/somethings_controller.rb:10',
|
20
|
+
'/user/local/ruby/path.rb:8'
|
21
|
+
]
|
22
|
+
end
|
23
|
+
before { error.stub(:backtrace => backtrace) }
|
24
|
+
|
25
|
+
subject { notification.backtrace }
|
26
|
+
|
27
|
+
it { should == backtrace }
|
28
|
+
|
29
|
+
context "when running the backtrace cleaner" do
|
30
|
+
let(:notification) { Appsignal::ExceptionNotification.new({}, error) }
|
31
|
+
|
32
|
+
it { should == [
|
33
|
+
'app/controllers/somethings_controller.rb:10',
|
34
|
+
'/user/local/ruby/path.rb:8'
|
35
|
+
] }
|
36
|
+
end
|
37
|
+
end
|
12
38
|
end
|
@@ -12,10 +12,10 @@ end
|
|
12
12
|
|
13
13
|
describe Appsignal::Listener do
|
14
14
|
describe '#call' do
|
15
|
-
let(:app) {
|
15
|
+
let(:app) { double(:call => true) }
|
16
16
|
let(:env) { {'action_dispatch.request_id' => '1'} }
|
17
17
|
let(:middleware) { Appsignal::Listener.new(app, {})}
|
18
|
-
let(:current) {
|
18
|
+
let(:current) { double(:complete! => true, :add_exception => true) }
|
19
19
|
before { Appsignal::Transaction.stub(:current => current) }
|
20
20
|
|
21
21
|
describe 'around call' do
|
@@ -7,8 +7,8 @@ describe Appsignal::Middleware do
|
|
7
7
|
let(:entry) { entry_klass.new(object, {:foo => :bar}) }
|
8
8
|
|
9
9
|
describe Appsignal::Middleware::Chain do
|
10
|
-
let(:object) {
|
11
|
-
let(:other_object) {
|
10
|
+
let(:object) { double(:object) }
|
11
|
+
let(:other_object) { double(:other_object) }
|
12
12
|
|
13
13
|
describe "#initialize" do
|
14
14
|
it "yields itself when passing a block" do
|
@@ -156,7 +156,7 @@ describe Appsignal::Middleware do
|
|
156
156
|
describe Appsignal::Middleware::Entry do
|
157
157
|
|
158
158
|
describe "#make_new" do
|
159
|
-
let(:object) {
|
159
|
+
let(:object) { double }
|
160
160
|
subject { entry.make_new }
|
161
161
|
|
162
162
|
it "initializes the passed object" do
|
@@ -36,7 +36,7 @@ describe Appsignal::Railtie do
|
|
36
36
|
|
37
37
|
context "non action_controller event" do
|
38
38
|
it "should call add_event for non action_controller event" do
|
39
|
-
current =
|
39
|
+
current = double(:current)
|
40
40
|
current.should_receive(:add_event)
|
41
41
|
Appsignal::Transaction.should_receive(:current).twice.
|
42
42
|
and_return(current)
|
@@ -47,7 +47,7 @@ describe Appsignal::Railtie do
|
|
47
47
|
|
48
48
|
context "action_controller event" do
|
49
49
|
it "should call set_process_action_event for action_controller event" do
|
50
|
-
current =
|
50
|
+
current = double(:current)
|
51
51
|
current.should_receive(:set_process_action_event)
|
52
52
|
current.should_receive(:add_event)
|
53
53
|
Appsignal::Transaction.should_receive(:current).exactly(3).times.
|
@@ -49,7 +49,7 @@ describe Appsignal::Transaction do
|
|
49
49
|
end
|
50
50
|
|
51
51
|
describe '#add_event' do
|
52
|
-
let(:event) {
|
52
|
+
let(:event) { double(:event, :name => 'test') }
|
53
53
|
|
54
54
|
it 'should add an event' do
|
55
55
|
expect {
|
@@ -59,7 +59,7 @@ describe Appsignal::Transaction do
|
|
59
59
|
end
|
60
60
|
|
61
61
|
context "using exceptions" do
|
62
|
-
let(:exception) {
|
62
|
+
let(:exception) { double(:exception, :name => 'test') }
|
63
63
|
|
64
64
|
describe '#add_exception' do
|
65
65
|
it 'should add an exception' do
|
@@ -225,7 +225,7 @@ describe Appsignal::Transaction do
|
|
225
225
|
end
|
226
226
|
|
227
227
|
describe '#complete!' do
|
228
|
-
let(:event) {
|
228
|
+
let(:event) { double(:event) }
|
229
229
|
before { transaction.set_process_action_event(notification_event) }
|
230
230
|
|
231
231
|
it 'should remove transaction from the list' do
|
@@ -19,8 +19,8 @@ describe Appsignal::Transmitter do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
describe "#transmit" do
|
22
|
-
let(:response) {
|
23
|
-
let(:http_client) {
|
22
|
+
let(:response) { double(:response, :code => '200') }
|
23
|
+
let(:http_client) { double(:request, :request => response) }
|
24
24
|
before { instance.stub(:http_client => http_client) }
|
25
25
|
|
26
26
|
subject { instance.transmit(:shipit => :payload) }
|
@@ -30,7 +30,7 @@ describe Appsignal::Transmitter do
|
|
30
30
|
|
31
31
|
describe "#http_post" do
|
32
32
|
it "calls Net::HTTP.post_form with the correct params" do
|
33
|
-
post =
|
33
|
+
post = double(:post)
|
34
34
|
post.should_receive(:[]=).
|
35
35
|
with('Content-Type', 'application/json; charset=UTF-8')
|
36
36
|
post.should_receive(:[]=).
|
data/spec/appsignal_spec.rb
CHANGED
@@ -105,7 +105,7 @@ describe Appsignal do
|
|
105
105
|
|
106
106
|
describe ".send_exception" do
|
107
107
|
it "should raise exception" do
|
108
|
-
agent =
|
108
|
+
agent = double
|
109
109
|
Appsignal.should_receive(:agent).exactly(3).times.and_return(agent)
|
110
110
|
agent.should_receive(:send_queue)
|
111
111
|
agent.should_receive(:enqueue).with(kind_of(Appsignal::Transaction))
|
@@ -19,7 +19,7 @@ describe AppsignalGenerator do
|
|
19
19
|
context "known key" do
|
20
20
|
before do
|
21
21
|
prepare_destination
|
22
|
-
authcheck =
|
22
|
+
authcheck = double
|
23
23
|
Appsignal::AuthCheck.should_receive(:new).and_return(authcheck)
|
24
24
|
authcheck.should_receive(:perform_with_result).
|
25
25
|
and_return(['200', 'everything ok'])
|
@@ -34,7 +34,7 @@ describe AppsignalGenerator do
|
|
34
34
|
context "invalid key" do
|
35
35
|
before do
|
36
36
|
prepare_destination
|
37
|
-
authcheck =
|
37
|
+
authcheck = double
|
38
38
|
Appsignal::AuthCheck.should_receive(:new).and_return(authcheck)
|
39
39
|
authcheck.should_receive(:perform_with_result).
|
40
40
|
and_return(['401', 'unauthorized'])
|
@@ -49,7 +49,7 @@ describe AppsignalGenerator do
|
|
49
49
|
context "failed check" do
|
50
50
|
before do
|
51
51
|
prepare_destination
|
52
|
-
authcheck =
|
52
|
+
authcheck = double
|
53
53
|
Appsignal::AuthCheck.should_receive(:new).and_return(authcheck)
|
54
54
|
authcheck.should_receive(:perform_with_result).
|
55
55
|
and_return(['500', 'error!'])
|
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: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Beekman
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-
|
15
|
+
date: 2013-08-03 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rails
|
@@ -134,7 +134,7 @@ files:
|
|
134
134
|
- gemfiles/3.0.gemfile
|
135
135
|
- gemfiles/3.1.gemfile
|
136
136
|
- gemfiles/3.2.gemfile
|
137
|
-
- gemfiles/
|
137
|
+
- gemfiles/4.0.gemfile
|
138
138
|
- lib/appsignal.rb
|
139
139
|
- lib/appsignal/agent.rb
|
140
140
|
- lib/appsignal/aggregator.rb
|