appsignal 0.8.6.beta.0 → 0.8.6.beta.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTFjZWJlMmZlZDk5YzFiZGZmN2E4ODZiYWNlNDM4ZWM0MGUzODBjMQ==
4
+ NzlhYWQ4OGJmZTVkOWRhYzIzNGQzNmU5YzJlZGRiNTEwMGMzMTZjNw==
5
5
  data.tar.gz: !binary |-
6
- ZDBlMDAxZjMwNDdiN2VlMjBiM2Y5ZTUxMjQ0ZjFhY2M0ZGQ2MWEwMg==
6
+ NjY2MTUyOWFjMjUyMGRiNWZjYjNhYTc1MDQ1OTk2MjI1NDA4ZmI5OQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NTM0NGE3Y2JlNTQ1NzI3YTQ3MzIwYjRmYTkxZmVmZWFiY2YxODMyYmNjMmYw
10
- OTM1YmYzODQzMGJiNWNhZWQ0OTMyZTRkNDkwOWNjNTRkMjczNGNkYWNmMTY4
11
- NWUyYjU4YWNkMzU1NjYwOGNiNjA1OGM5YmZjN2ViMzM4ODQyMTM=
9
+ YmMwOTdkMjBmM2RjY2M0Y2ViYmFhNzc3NGEwY2IyNzU5YzAyMmMzZWNkNDI2
10
+ ZTA0MGQzYTk0YzM0YWVjYTJmN2Q3NDMxNmYyNTgwMTVkYWM1ZmYzMWU3MDc2
11
+ ZmIxYTU1MmZkNTA4NjBiM2M5ZjkxZjcyYTYwYTI3MGUyZWVhNTE=
12
12
  data.tar.gz: !binary |-
13
- MzE1MDg5ODE2YjJmMDkzMGNjY2I0NTk1ODhhNzBkYzZjMzZkZmE2NzZmMGM1
14
- NTgyZTZhNjk4MTZjOTA3NzU1NGI1MmMzMDBkMzUwNjIxOThjYTBkNjhhZTUy
15
- YTA3NGE2OTAyN2FjYTcxNDgxZjRmMTA0MzhiODhkOWFlMTE1NzA=
13
+ NGM3MWMwOTRmN2MxYmRiMWE5NmUyMzE5ODU1MDllOWQxMGZjZWU5YTMzMjcx
14
+ ZWIzMWNjYTQzZjdiMTg2MmVmNjZmNGMzZDFjNTc5ZWFjNWRkOGM1OTQ4Mzdh
15
+ ZTQxMmZkNGVjYzgyOWMwZjJiNjViMzY1OTRhZmY4NDdhZWU5NWQ=
@@ -1,5 +1,9 @@
1
1
  # 0.8.6
2
2
  * Resque support
3
+ * Support tags in Appsignal.send_exception
4
+ * Alias tag_request to tag_job, for background jobs
5
+ * Skip sanitization of env if env is nil
6
+ * Small bugfix in forking logic
3
7
 
4
8
  # 0.8.5
5
9
  * Don't require revision in CLI notify_of_deploy
@@ -61,10 +61,11 @@ module Appsignal
61
61
  raise exception
62
62
  end
63
63
 
64
- def send_exception(exception)
64
+ def send_exception(exception, tags=nil)
65
65
  return if is_ignored_exception?(exception)
66
66
  transaction = Appsignal::Transaction.create(SecureRandom.uuid, ENV.to_hash)
67
67
  transaction.add_exception(exception)
68
+ transaction.set_tags(tags) if tags
68
69
  transaction.complete!
69
70
  Appsignal.agent.send_queue
70
71
  end
@@ -81,6 +82,7 @@ module Appsignal
81
82
  return false unless transaction
82
83
  transaction.set_tags(params)
83
84
  end
85
+ alias :tag_job :tag_request
84
86
 
85
87
  def transactions
86
88
  @transactions ||= {}
@@ -62,9 +62,9 @@ module Appsignal
62
62
  end
63
63
 
64
64
  def enqueue(transaction)
65
+ forked! if @pid != Process.pid
65
66
  Appsignal.logger.debug('Enqueueing transaction')
66
67
  aggregator.add(transaction)
67
- forked! if @pid != Process.pid
68
68
  end
69
69
 
70
70
  def send_queue
@@ -167,6 +167,7 @@
167
167
  end
168
168
 
169
169
  def sanitize_environment!
170
+ return unless env
170
171
  env.each do |key, value|
171
172
  sanitized_environment[key] = value if ENV_METHODS.include?(key)
172
173
  end
@@ -1,3 +1,3 @@
1
1
  module Appsignal
2
- VERSION = '0.8.6.beta.0'
2
+ VERSION = '0.8.6.beta.1'
3
3
  end
@@ -453,6 +453,12 @@ describe Appsignal::Transaction do
453
453
  before { transaction.send(:sanitize_environment!) }
454
454
 
455
455
  its(:keys) { should =~ whitelisted_keys }
456
+
457
+ context "when env is nil" do
458
+ let(:env) { nil }
459
+
460
+ it { should be_empty }
461
+ end
456
462
  end
457
463
 
458
464
  describe '#sanitize_tags!' do
@@ -132,6 +132,10 @@ describe Appsignal do
132
132
  Appsignal.tag_request.should be_false
133
133
  end
134
134
  end
135
+
136
+ it "should also listen to tag_job" do
137
+ Appsignal.should respond_to(:tag_job)
138
+ end
135
139
  end
136
140
 
137
141
  describe ".transactions" do
@@ -253,6 +257,7 @@ describe Appsignal do
253
257
 
254
258
  describe ".send_exception" do
255
259
  before { Appsignal::Pipe.stub(:current => false) }
260
+ let(:tags) { nil }
256
261
 
257
262
  it "should send the exception to AppSignal" do
258
263
  agent = double(:shutdown => true)
@@ -263,6 +268,16 @@ describe Appsignal do
263
268
  Appsignal::Transaction.should_receive(:create).and_call_original
264
269
  end
265
270
 
271
+ context "with tags" do
272
+ let(:tags) { {:a => 'a', :b => 'b'} }
273
+
274
+ it "should tag the request before sending" do
275
+ transaction = Appsignal::Transaction.create(SecureRandom.uuid, {})
276
+ Appsignal::Transaction.stub(:create => transaction)
277
+ transaction.should_receive(:set_tags).with(tags)
278
+ end
279
+ end
280
+
266
281
  it "should not send the exception if it's in the ignored list" do
267
282
  Appsignal.stub(:is_ignored_exception? => true)
268
283
  Appsignal::Transaction.should_not_receive(:create)
@@ -272,7 +287,7 @@ describe Appsignal do
272
287
  begin
273
288
  raise "I am an exception"
274
289
  rescue Exception => e
275
- Appsignal.send_exception(e)
290
+ Appsignal.send_exception(e, tags)
276
291
  end
277
292
  end
278
293
  end
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.8.6.beta.0
4
+ version: 0.8.6.beta.1
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: 2014-02-14 00:00:00.000000000 Z
15
+ date: 2014-02-20 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activesupport