appsignal 0.12.rc.8 → 0.12.rc.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +0 -2
- data/ext/agent.yml +7 -7
- data/gemfiles/rails-3.2.gemfile +2 -0
- data/lib/appsignal.rb +3 -3
- data/lib/appsignal/config.rb +11 -3
- data/lib/appsignal/hooks/redis.rb +1 -0
- data/lib/appsignal/hooks/sequel.rb +1 -0
- data/lib/appsignal/integrations/padrino.rb +1 -1
- data/lib/appsignal/integrations/railtie.rb +1 -1
- data/lib/appsignal/integrations/sinatra.rb +1 -2
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/config_spec.rb +15 -7
- data/spec/lib/appsignal/integrations/railtie_spec.rb +11 -10
- data/spec/lib/appsignal_spec.rb +5 -4
- data/spec/support/helpers/config_helpers.rb +2 -7
- metadata +2 -4
- data/gemfiles/rails-3.0.gemfile +0 -7
- data/gemfiles/rails-3.1.gemfile +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17f4e46dd0c600079ccdb20831f64e73451749b4
|
4
|
+
data.tar.gz: 723ed8e27a02f660f8dc5135c8d4982a909c2bf6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33d094d086f748d6932e93960bb1ebfd3cf1dcc3a77be03c68a3f32fca800caf35bb73551141c084702e6ecac3352cdad2f5d271dc083a74c9b3c8aca3fd16c7
|
7
|
+
data.tar.gz: ee504d004f15bab3e1786ef0b5241e8efa661d67883266559f81fc658b2e488c6d2904a53de91a01f54e0f72b0880577532002115d56411ca3b8c7b301e94daf
|
data/Rakefile
CHANGED
data/ext/agent.yml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
|
-
:version:
|
2
|
+
:version: 526bdf1
|
3
3
|
:triples:
|
4
4
|
x86_64-linux:
|
5
|
-
:checksum:
|
6
|
-
:download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
5
|
+
:checksum: d5d83c289af971b40f23dc41a41567e0d41e98d2754eeed4427b7b2473881818
|
6
|
+
:download_url: https://appsignal-agent-releases.global.ssl.fastly.net/526bdf1/appsignal-agent-x86_64-linux-static.tar.gz
|
7
7
|
:lib_filename: libappsignal.a
|
8
8
|
i686-linux:
|
9
|
-
:checksum:
|
10
|
-
:download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
9
|
+
:checksum: b8b3bf1a5ae67e97ff623e1252c6f0299306951033e4fb93478aa76dc95218f1
|
10
|
+
:download_url: https://appsignal-agent-releases.global.ssl.fastly.net/526bdf1/appsignal-agent-i686-linux-static.tar.gz
|
11
11
|
:lib_filename: libappsignal.a
|
12
12
|
x86_64-darwin:
|
13
|
-
:checksum:
|
14
|
-
:download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
13
|
+
:checksum: 4eab82317a874d4d3b7fc666ce562fa7e5f346cda22707d556a236894269a838
|
14
|
+
:download_url: https://appsignal-agent-releases.global.ssl.fastly.net/526bdf1/appsignal-agent-x86_64-darwin-static.tar.gz
|
15
15
|
:lib_filename: libappsignal.a
|
data/gemfiles/rails-3.2.gemfile
CHANGED
data/lib/appsignal.rb
CHANGED
@@ -41,7 +41,7 @@ module Appsignal
|
|
41
41
|
logger.level = Logger::INFO
|
42
42
|
end
|
43
43
|
if config.active?
|
44
|
-
logger.info("Starting AppSignal #{Appsignal::VERSION}
|
44
|
+
logger.info("Starting AppSignal #{Appsignal::VERSION} (#{$0}, Ruby #{RUBY_VERSION}, #{RUBY_PLATFORM})")
|
45
45
|
config.write_to_environment
|
46
46
|
Appsignal::Extension.start
|
47
47
|
Appsignal::Hooks.load_hooks
|
@@ -192,8 +192,8 @@ module Appsignal
|
|
192
192
|
end
|
193
193
|
|
194
194
|
def start_logger(path_arg=nil)
|
195
|
-
path = Appsignal.config ? Appsignal.config
|
196
|
-
if path && File.writable?(path) &&
|
195
|
+
path = Appsignal.config ? Appsignal.config.log_file_path : nil
|
196
|
+
if path && File.writable?(File.dirname(path)) &&
|
197
197
|
!ENV['DYNO'] &&
|
198
198
|
!ENV['SHELLYCLOUD_DEPLOYMENT']
|
199
199
|
@logger = Logger.new(path)
|
data/lib/appsignal/config.rb
CHANGED
@@ -30,7 +30,7 @@ module Appsignal
|
|
30
30
|
'APPSIGNAL_PUSH_API_ENDPOINT' => :endpoint,
|
31
31
|
'APPSIGNAL_FRONTEND_ERROR_CATCHING_PATH' => :frontend_error_catching_path,
|
32
32
|
'APPSIGNAL_DEBUG' => :debug,
|
33
|
-
'
|
33
|
+
'APPSIGNAL_LOG_PATH' => :log_path,
|
34
34
|
'APPSIGNAL_INSTRUMENT_NET_HTTP' => :instrument_net_http,
|
35
35
|
'APPSIGNAL_INSTRUMENT_REDIS' => :instrument_redis,
|
36
36
|
'APPSIGNAL_INSTRUMENT_SEQUEL' => :instrument_sequel,
|
@@ -71,6 +71,14 @@ module Appsignal
|
|
71
71
|
config_hash[key]
|
72
72
|
end
|
73
73
|
|
74
|
+
def log_file_path
|
75
|
+
path = config_hash[:log_path] || root_path
|
76
|
+
File.join(File.realpath(path), 'appsignal.log')
|
77
|
+
rescue Errno::ENOENT
|
78
|
+
puts "appsignal: WARNING: log file path '#{path}' does not exist or is not writable"
|
79
|
+
nil
|
80
|
+
end
|
81
|
+
|
74
82
|
def valid?
|
75
83
|
@valid
|
76
84
|
end
|
@@ -87,7 +95,7 @@ module Appsignal
|
|
87
95
|
ENV['APPSIGNAL_AGENT_VERSION'] = Appsignal::Extension.agent_version
|
88
96
|
ENV['APPSIGNAL_LANGUAGE_INTEGRATION_VERSION'] = Appsignal::VERSION
|
89
97
|
ENV['APPSIGNAL_DEBUG_LOGGING'] = config_hash[:debug].to_s
|
90
|
-
ENV['APPSIGNAL_LOG_FILE_PATH'] =
|
98
|
+
ENV['APPSIGNAL_LOG_FILE_PATH'] = log_file_path.to_s if log_file_path
|
91
99
|
ENV['APPSIGNAL_PUSH_API_ENDPOINT'] = config_hash[:endpoint]
|
92
100
|
ENV['APPSIGNAL_PUSH_API_KEY'] = config_hash[:push_api_key]
|
93
101
|
ENV['APPSIGNAL_APP_NAME'] = config_hash[:name]
|
@@ -134,7 +142,7 @@ module Appsignal
|
|
134
142
|
|
135
143
|
# Configuration with string type
|
136
144
|
%w(APPSIGNAL_PUSH_API_KEY APPSIGNAL_APP_NAME APPSIGNAL_PUSH_API_ENDPOINT
|
137
|
-
APPSIGNAL_FRONTEND_ERROR_CATCHING_PATH APPSIGNAL_HTTP_PROXY
|
145
|
+
APPSIGNAL_FRONTEND_ERROR_CATCHING_PATH APPSIGNAL_HTTP_PROXY APPSIGNAL_LOG_PATH).each do |var|
|
138
146
|
if env_var = ENV[var]
|
139
147
|
config[ENV_TO_KEY_MAPPING[var]] = env_var
|
140
148
|
end
|
@@ -6,8 +6,7 @@ Appsignal.logger.info("Loading Sinatra (#{Sinatra::VERSION}) integration")
|
|
6
6
|
app_settings = ::Sinatra::Application.settings
|
7
7
|
Appsignal.config = Appsignal::Config.new(
|
8
8
|
app_settings.root,
|
9
|
-
app_settings.environment
|
10
|
-
:log_file_path => File.join(app_settings.root, 'appsignal.log')
|
9
|
+
app_settings.environment
|
11
10
|
)
|
12
11
|
|
13
12
|
Appsignal.start_logger
|
data/lib/appsignal/version.rb
CHANGED
@@ -11,8 +11,9 @@ describe Appsignal::Config do
|
|
11
11
|
subject
|
12
12
|
end
|
13
13
|
|
14
|
-
its(:valid?)
|
15
|
-
its(:active?)
|
14
|
+
its(:valid?) { should be_true }
|
15
|
+
its(:active?) { should be_true }
|
16
|
+
its(:log_file_path) { should end_with('spec/support/project_fixture/appsignal.log') }
|
16
17
|
|
17
18
|
it "should merge with the default config and fill the config hash" do
|
18
19
|
subject.config_hash.should == {
|
@@ -35,6 +36,12 @@ describe Appsignal::Config do
|
|
35
36
|
}
|
36
37
|
end
|
37
38
|
|
39
|
+
context "if a log file path is set" do
|
40
|
+
let(:config) { project_fixture_config('production', :log_path => '/tmp') }
|
41
|
+
|
42
|
+
its(:log_file_path) { should end_with('/tmp/appsignal.log') }
|
43
|
+
end
|
44
|
+
|
38
45
|
context "when there is a pre 0.12 style endpoint" do
|
39
46
|
let(:config) { project_fixture_config('production', :endpoint => 'https://push.appsignal.com/1') }
|
40
47
|
|
@@ -65,7 +72,7 @@ describe Appsignal::Config do
|
|
65
72
|
before do
|
66
73
|
subject.config_hash[:http_proxy] = 'http://localhost'
|
67
74
|
subject.config_hash[:ignore_actions] = ['action1', 'action2']
|
68
|
-
subject.config_hash[:
|
75
|
+
subject.config_hash[:log_path] = '/tmp'
|
69
76
|
subject.write_to_environment
|
70
77
|
end
|
71
78
|
|
@@ -74,7 +81,7 @@ describe Appsignal::Config do
|
|
74
81
|
ENV['APPSIGNAL_APP_PATH'].should end_with('spec/support/project_fixture')
|
75
82
|
ENV['APPSIGNAL_AGENT_PATH'].should end_with('/ext')
|
76
83
|
ENV['APPSIGNAL_DEBUG_LOGGING'].should == 'false'
|
77
|
-
ENV['APPSIGNAL_LOG_FILE_PATH'].should
|
84
|
+
ENV['APPSIGNAL_LOG_FILE_PATH'].should end_with('/tmp/appsignal.log')
|
78
85
|
ENV['APPSIGNAL_PUSH_API_ENDPOINT'].should == 'https://push.appsignal.com'
|
79
86
|
ENV['APPSIGNAL_PUSH_API_KEY'].should == 'abc'
|
80
87
|
ENV['APPSIGNAL_APP_NAME'].should == 'TestApp'
|
@@ -148,10 +155,11 @@ describe Appsignal::Config do
|
|
148
155
|
|
149
156
|
context "when there is no config file" do
|
150
157
|
let(:initial_config) { {} }
|
151
|
-
let(:config) { Appsignal::Config.new('/
|
158
|
+
let(:config) { Appsignal::Config.new('/tmp', 'production', initial_config) }
|
152
159
|
|
153
|
-
its(:valid?)
|
154
|
-
its(:active?)
|
160
|
+
its(:valid?) { should be_false }
|
161
|
+
its(:active?) { should be_false }
|
162
|
+
its(:log_file_path) { should end_with('/tmp/appsignal.log') }
|
155
163
|
|
156
164
|
context "with valid config in the environment" do
|
157
165
|
before do
|
@@ -23,15 +23,17 @@ if rails_present?
|
|
23
23
|
end
|
24
24
|
|
25
25
|
context "config" do
|
26
|
-
before { Appsignal::Integrations::Railtie.initialize_appsignal(app) }
|
27
26
|
subject { Appsignal.config }
|
27
|
+
context "basics" do
|
28
|
+
before { Appsignal::Integrations::Railtie.initialize_appsignal(app) }
|
28
29
|
|
29
|
-
|
30
|
+
it { should be_a(Appsignal::Config) }
|
30
31
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
32
|
+
its(:root_path) { should == Pathname.new(project_fixture_path) }
|
33
|
+
its(:env) { should == 'test' }
|
34
|
+
its([:name]) { should == 'TestApp' }
|
35
|
+
its([:log_path]) { should == Pathname.new(File.join(project_fixture_path, 'log')) }
|
36
|
+
end
|
35
37
|
|
36
38
|
context "initial config" do
|
37
39
|
before { Appsignal::Integrations::Railtie.initialize_appsignal(app) }
|
@@ -41,10 +43,9 @@ if rails_present?
|
|
41
43
|
end
|
42
44
|
|
43
45
|
context "with APPSIGNAL_APP_ENV ENV var set" do
|
44
|
-
|
45
|
-
ENV
|
46
|
-
|
47
|
-
ENV.delete('APPSIGNAL_APP_ENV')
|
46
|
+
before do
|
47
|
+
ENV.should_receive(:fetch).with('APPSIGNAL_APP_ENV', 'test').and_return('env_test')
|
48
|
+
Appsignal::Integrations::Railtie.initialize_appsignal(app)
|
48
49
|
end
|
49
50
|
|
50
51
|
its(:env) { should == 'env_test' }
|
data/spec/lib/appsignal_spec.rb
CHANGED
@@ -426,16 +426,17 @@ describe Appsignal do
|
|
426
426
|
|
427
427
|
describe ".start_logger" do
|
428
428
|
let(:out_stream) { StringIO.new }
|
429
|
-
let(:
|
430
|
-
let(:log_file) { File.join(
|
429
|
+
let(:log_path) { File.join(project_fixture_path, 'log') }
|
430
|
+
let(:log_file) { File.join(log_path, 'appsignal.log') }
|
431
431
|
|
432
432
|
before do
|
433
|
+
FileUtils.rm_f(log_file)
|
433
434
|
@original_stdout = $stdout
|
434
435
|
$stdout = out_stream
|
435
436
|
Appsignal.logger.error('Log something')
|
436
437
|
Appsignal.config = project_fixture_config(
|
437
438
|
'production',
|
438
|
-
:
|
439
|
+
:log_path => log_path
|
439
440
|
)
|
440
441
|
end
|
441
442
|
after do
|
@@ -453,7 +454,7 @@ describe Appsignal do
|
|
453
454
|
end
|
454
455
|
|
455
456
|
context "when the log path is not writable" do
|
456
|
-
let(:
|
457
|
+
let(:log_path) { '/nonsense/log' }
|
457
458
|
|
458
459
|
it "should log to stdout" do
|
459
460
|
Appsignal.start_logger
|
@@ -5,16 +5,11 @@ module ConfigHelpers
|
|
5
5
|
)
|
6
6
|
end
|
7
7
|
|
8
|
-
def
|
9
|
-
File.join(project_fixture_path, 'log/appsignal.log')
|
10
|
-
end
|
11
|
-
|
12
|
-
def project_fixture_config(env='production', initial_config={}, logger=Logger.new(project_fixture_log_file))
|
8
|
+
def project_fixture_config(env='production', initial_config={})
|
13
9
|
Appsignal::Config.new(
|
14
10
|
project_fixture_path,
|
15
11
|
env,
|
16
|
-
initial_config
|
17
|
-
logger
|
12
|
+
initial_config
|
18
13
|
)
|
19
14
|
end
|
20
15
|
|
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.12.rc.
|
4
|
+
version: 0.12.rc.9
|
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: 2015-11-
|
12
|
+
date: 2015-11-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -136,8 +136,6 @@ files:
|
|
136
136
|
- gemfiles/capistrano3.gemfile
|
137
137
|
- gemfiles/no_dependencies.gemfile
|
138
138
|
- gemfiles/padrino.gemfile
|
139
|
-
- gemfiles/rails-3.0.gemfile
|
140
|
-
- gemfiles/rails-3.1.gemfile
|
141
139
|
- gemfiles/rails-3.2.gemfile
|
142
140
|
- gemfiles/rails-4.0.gemfile
|
143
141
|
- gemfiles/rails-4.1.gemfile
|
data/gemfiles/rails-3.0.gemfile
DELETED