appsignal 1.1.4 → 1.1.5.beta.1
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/ext/agent.yml +11 -7
- data/lib/appsignal/cli/install.rb +11 -0
- data/lib/appsignal/transaction.rb +13 -1
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/cli/install_spec.rb +21 -0
- data/spec/lib/appsignal/transaction_spec.rb +31 -8
- data/spec/spec_helper.rb +4 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfdc08fdd42809a6cffc841c28a20596d2db3f3d
|
4
|
+
data.tar.gz: 9f892def0286d4b5cbcb247c31132cee44b69def
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fed1598d4d05ec88e9eeb400eb53b94af578b3c0d7184ecb3213d1c517250f53b44fe3cee4ef63c1b9a2a8d509f66439f10ba8c2c089da7cdee84922493d70d7
|
7
|
+
data.tar.gz: 1ea337a28fbc4817b820aa0cd78d9767f9f8a1cf77dccaa1ffd56cb8a4106a880b0c8ef05c5ae7a49f877869597205a1da44f41e98ad60f1757a690826d6f518
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# 1.1.5
|
2
|
+
* Support for null in sql sanitization
|
3
|
+
* Add require to deploy.rb if present on installation
|
4
|
+
* Warn when overwriting already existing transaction
|
5
|
+
* Support for x86-linux
|
6
|
+
|
1
7
|
# 1.1.4
|
2
8
|
* Better debug logging for agent issues
|
3
9
|
* Fix for exception with nil messages
|
data/ext/agent.yml
CHANGED
@@ -1,15 +1,19 @@
|
|
1
1
|
---
|
2
|
-
version:
|
2
|
+
version: 1776f03
|
3
3
|
triples:
|
4
4
|
x86_64-linux:
|
5
|
-
checksum:
|
6
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
5
|
+
checksum: e7762cef292e9449e4d86f833ee7a80651845c3847122b4d4d995fb171462697
|
6
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/1776f03/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: 0407af36bc2d417a6fa5533f75f442489b71c4df7dc744421e199b2949d57d1f
|
10
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/1776f03/appsignal-agent-i686-linux-static.tar.gz
|
11
|
+
lib_filename: libappsignal.a
|
12
|
+
x86-linux:
|
13
|
+
checksum: 0407af36bc2d417a6fa5533f75f442489b71c4df7dc744421e199b2949d57d1f
|
14
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/1776f03/appsignal-agent-i686-linux-static.tar.gz
|
11
15
|
lib_filename: libappsignal.a
|
12
16
|
x86_64-darwin:
|
13
|
-
checksum:
|
14
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
17
|
+
checksum: 5438333a6402ca07a606387086e4206a7fd7b5d884a291ccf44f9dffd39bd7c3
|
18
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/1776f03/appsignal-agent-x86_64-darwin-static.tar.gz
|
15
19
|
lib_filename: libappsignal.a
|
@@ -187,6 +187,17 @@ module Appsignal
|
|
187
187
|
end
|
188
188
|
|
189
189
|
def configure(config, environments, name_overwritten)
|
190
|
+
deploy_rb_file = File.join(ENV['PWD'], 'config/deploy.rb')
|
191
|
+
if File.exists?(deploy_rb_file) && (File.read(deploy_rb_file) =~ /require (\'|\").\/appsignal\/capistrano/).nil?
|
192
|
+
print 'Adding AppSignal integration to deploy.rb'
|
193
|
+
File.open(deploy_rb_file, 'a') do |f|
|
194
|
+
f.write "\nrequire 'appsignal/capistrano'\n"
|
195
|
+
end
|
196
|
+
periods
|
197
|
+
puts
|
198
|
+
puts
|
199
|
+
end
|
200
|
+
|
190
201
|
puts "How do you want to configure AppSignal?"
|
191
202
|
puts " (1) a config file"
|
192
203
|
puts " (2) environment variables"
|
@@ -17,7 +17,19 @@ module Appsignal
|
|
17
17
|
|
18
18
|
class << self
|
19
19
|
def create(id, namespace, request, options={})
|
20
|
-
|
20
|
+
# Check if we already have a running transaction
|
21
|
+
if Thread.current[:appsignal_transaction] != nil
|
22
|
+
|
23
|
+
# Log the issue and return the current transaction
|
24
|
+
Appsignal.logger.debug("Trying to start new transaction #{id} but #{current.transaction_id} is already running. Using #{current.transaction_id}")
|
25
|
+
|
26
|
+
# Return the current (running) transaction
|
27
|
+
current
|
28
|
+
|
29
|
+
# Otherwise, start a new transaction
|
30
|
+
else
|
31
|
+
Thread.current[:appsignal_transaction] = Appsignal::Transaction.new(id, namespace, request, options)
|
32
|
+
end
|
21
33
|
end
|
22
34
|
|
23
35
|
def current
|
data/lib/appsignal/version.rb
CHANGED
@@ -374,6 +374,27 @@ describe Appsignal::CLI::Install do
|
|
374
374
|
out_stream.string.should include("Config file written to config/appsignal.yml")
|
375
375
|
end
|
376
376
|
end
|
377
|
+
|
378
|
+
context "when deploy.rb is present" do
|
379
|
+
let(:config_dir) { File.join(tmp_dir, 'config') }
|
380
|
+
let(:deploy_rb_file) { File.join(tmp_dir, 'config/deploy.rb') }
|
381
|
+
before do
|
382
|
+
ENV['PWD'] = tmp_dir
|
383
|
+
FileUtils.mkdir_p(config_dir)
|
384
|
+
FileUtils.touch(deploy_rb_file)
|
385
|
+
cli.should_receive(:gets).once.and_return('2')
|
386
|
+
end
|
387
|
+
after do
|
388
|
+
FileUtils.rm_rf(config_dir)
|
389
|
+
end
|
390
|
+
|
391
|
+
it "should add a require to deploy.rb" do
|
392
|
+
cli.configure(config, [], false)
|
393
|
+
|
394
|
+
out_stream.string.should include 'Adding AppSignal integration to deploy.rb'
|
395
|
+
File.read(deploy_rb_file).should include "require 'appsignal/capistrano'"
|
396
|
+
end
|
397
|
+
end
|
377
398
|
end
|
378
399
|
|
379
400
|
describe ".done_notice" do
|
@@ -17,33 +17,56 @@ describe Appsignal::Transaction do
|
|
17
17
|
let(:merged_env) { http_request_env_with_data(env) }
|
18
18
|
let(:options) { {} }
|
19
19
|
let(:request) { Rack::Request.new(merged_env) }
|
20
|
-
let(:transaction) { Appsignal::Transaction.
|
20
|
+
let(:transaction) { Appsignal::Transaction.new('1', namespace, request, options) }
|
21
21
|
|
22
22
|
before { Timecop.freeze(time) }
|
23
23
|
after { Timecop.return }
|
24
24
|
|
25
25
|
context "class methods" do
|
26
26
|
describe ".create" do
|
27
|
-
subject { transaction }
|
28
27
|
|
29
28
|
it "should add the transaction to thread local" do
|
30
29
|
Appsignal::Extension.should_receive(:start_transaction).with('1', 'http_request')
|
31
|
-
|
32
|
-
|
30
|
+
|
31
|
+
created_transaction = Appsignal::Transaction.create('1', namespace, request, options)
|
32
|
+
|
33
|
+
Thread.current[:appsignal_transaction].should == created_transaction
|
33
34
|
end
|
34
35
|
|
35
36
|
it "should create a transaction" do
|
36
|
-
|
37
|
-
|
38
|
-
|
37
|
+
created_transaction = Appsignal::Transaction.create('1', namespace, request, options)
|
38
|
+
|
39
|
+
created_transaction.should be_a Appsignal::Transaction
|
40
|
+
created_transaction.transaction_id.should == '1'
|
41
|
+
created_transaction.namespace.should == 'http_request'
|
42
|
+
end
|
43
|
+
|
44
|
+
context "when a transaction is already running" do
|
45
|
+
let(:running_transaction) { double(:transaction_id => 2) }
|
46
|
+
before { Thread.current[:appsignal_transaction] = running_transaction }
|
47
|
+
|
48
|
+
it "should not create a new transaction" do
|
49
|
+
expect(
|
50
|
+
Appsignal::Transaction.create('1', namespace, request, options)
|
51
|
+
).to eq(running_transaction)
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should output a debug message" do
|
55
|
+
expect( Appsignal.logger ).to receive(:debug)
|
56
|
+
.with("Trying to start new transaction 1 but 2 is already running. Using 2")
|
57
|
+
|
58
|
+
Appsignal::Transaction.create('1', namespace, request, options)
|
59
|
+
end
|
39
60
|
end
|
40
61
|
end
|
41
62
|
|
42
63
|
describe '.current' do
|
64
|
+
before { Thread.current[:appsignal_transaction] = transaction }
|
65
|
+
|
43
66
|
subject { Appsignal::Transaction.current }
|
44
67
|
|
45
68
|
context "if there is a transaction" do
|
46
|
-
before {
|
69
|
+
before { Appsignal::Transaction.create('1', namespace, request, options) }
|
47
70
|
|
48
71
|
it "should return the correct transaction" do
|
49
72
|
should == transaction
|
data/spec/spec_helper.rb
CHANGED
@@ -128,6 +128,10 @@ RSpec.configure do |config|
|
|
128
128
|
FileUtils.mkdir_p(tmp_dir)
|
129
129
|
end
|
130
130
|
|
131
|
+
config.after do
|
132
|
+
Thread.current[:appsignal_transaction] = nil
|
133
|
+
end
|
134
|
+
|
131
135
|
config.before do
|
132
136
|
ENV['PWD'] = File.expand_path(File.join(File.dirname(__FILE__), '../'))
|
133
137
|
ENV['RAILS_ENV'] = 'test'
|
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.1.
|
4
|
+
version: 1.1.5.beta.1
|
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-04-
|
12
|
+
date: 2016-04-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -291,9 +291,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
291
291
|
version: '1.9'
|
292
292
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
293
293
|
requirements:
|
294
|
-
- - "
|
294
|
+
- - ">"
|
295
295
|
- !ruby/object:Gem::Version
|
296
|
-
version:
|
296
|
+
version: 1.3.1
|
297
297
|
requirements: []
|
298
298
|
rubyforge_project:
|
299
299
|
rubygems_version: 2.4.5
|