appsignal 0.12.beta.54 → 0.12.rc.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c869da1b4f47565f79929f3b4fa58dcf1b16a4e7
4
- data.tar.gz: 841f08c157e237bb3b86f2050e36ae0ffa24e9af
3
+ metadata.gz: 559ea6e18f3d92fb41f936b1a16a0c01e40cd3e9
4
+ data.tar.gz: dd82dde078ae58a729ac950bbe92427ad202eed1
5
5
  SHA512:
6
- metadata.gz: b5fee20a893a776c958c7dd39dd66cf5126dfd401aa8beaf2d9d111c977e032d93b05fab0a2c77feaf02050c0de44e5f2ea702bb681b72e57df03cd333b317bb
7
- data.tar.gz: c1dcf58993ba75b63f82dc86942d8e7613ae5f81a2a9f7c4f49f8d4647dbd00c195b7d337036e3f777fdd8c02b9a4af3e88e67576346ec15d15a1b88ea79d900
6
+ metadata.gz: 4c200a468497ca6f42effa0b3ebf59076b6e2a887381ee06948fc45954dbac4197e5996162d6b1924ba96181ea4e4d6ba293440df05b8cb49781893ca3507b5d
7
+ data.tar.gz: 55257c67b8e114f48b1d309182b682df70d3d713328a97163fd68790ab92264d7a147d56741a0ade2399da43d5e5352bce1ddb92784261bbbe13cb2d8bc67e30
@@ -1,11 +1,15 @@
1
1
  ---
2
- :version: 235949b
2
+ :version: 6be50ae
3
3
  :triples:
4
4
  x86_64-linux:
5
- :checksum: 75f5e16f5f21bf2ea52c8d37a4b6aee54e3ebfdee25c84a6580327f575d167a2
6
- :download_url: https://appsignal-agent-releases.global.ssl.fastly.net/235949b/appsignal-agent-x86_64-linux-static.tar.gz
5
+ :checksum: 45f63fb48a8d17e0b3b0a0d43d305db9a3200f9aae3452d7bab9daf6125ecc8c
6
+ :download_url: https://appsignal-agent-releases.global.ssl.fastly.net/6be50ae/appsignal-agent-x86_64-linux-static.tar.gz
7
+ :lib_filename: libappsignal.a
8
+ i686-linux:
9
+ :checksum: e32bcd41124f88ca4dda0b17bacbf7ab25213cf9d3d20108e601c32fa554748d
10
+ :download_url: https://appsignal-agent-releases.global.ssl.fastly.net/6be50ae/appsignal-agent-i686-linux-static.tar.gz
7
11
  :lib_filename: libappsignal.a
8
12
  x86_64-darwin:
9
- :checksum: 4ffe599644f3ca56613a94a5656838f3ead6ae7751369aa0d0abf37dd518a367
10
- :download_url: https://appsignal-agent-releases.global.ssl.fastly.net/235949b/appsignal-agent-x86_64-darwin-static.tar.gz
13
+ :checksum: c0f654e86dde847efda00d7c7186e0a1bd53b06d20c6a9edee80632fe017aa22
14
+ :download_url: https://appsignal-agent-releases.global.ssl.fastly.net/6be50ae/appsignal-agent-x86_64-darwin-static.tar.gz
11
15
  :lib_filename: libappsignal.a
@@ -19,12 +19,13 @@ module Appsignal
19
19
  require 'appsignal/integrations/puma'
20
20
  require 'appsignal/integrations/sidekiq'
21
21
  require 'appsignal/integrations/resque'
22
- require 'appsignal/integrations/sequel'
23
22
  require 'appsignal/integrations/unicorn'
24
23
  end
25
24
 
26
25
  def load_instrumentations
27
26
  require 'appsignal/instrumentations/net_http' if config[:instrument_net_http]
27
+ require 'appsignal/instrumentations/redis' if config[:instrument_redis]
28
+ require 'appsignal/instrumentations/sequel' if config[:instrument_sequel]
28
29
  end
29
30
 
30
31
  def extensions
@@ -14,6 +14,8 @@ module Appsignal
14
14
  :send_params => true,
15
15
  :endpoint => 'https://push.appsignal.com',
16
16
  :instrument_net_http => true,
17
+ :instrument_redis => true,
18
+ :instrument_sequel => true,
17
19
  :skip_session_data => false,
18
20
  :enable_frontend_error_catching => false,
19
21
  :frontend_error_catching_path => '/appsignal_error_catcher',
@@ -30,6 +32,8 @@ module Appsignal
30
32
  'APPSIGNAL_DEBUG' => :debug,
31
33
  'APPSIGNAL_LOG_FILE_PATH' => :log_file_path,
32
34
  'APPSIGNAL_INSTRUMENT_NET_HTTP' => :instrument_net_http,
35
+ 'APPSIGNAL_INSTRUMENT_REDIS' => :instrument_redis,
36
+ 'APPSIGNAL_INSTRUMENT_SEQUEL' => :instrument_sequel,
33
37
  'APPSIGNAL_SKIP_SESSION_DATA' => :skip_session_data,
34
38
  'APPSIGNAL_ENABLE_FRONTEND_ERROR_CATCHING' => :enable_frontend_error_catching,
35
39
  'APPSIGNAL_IGNORE_ERRORS' => :ignore_errors,
@@ -76,18 +80,19 @@ module Appsignal
76
80
  end
77
81
 
78
82
  def write_to_environment
79
- ENV['APPSIGNAL_ACTIVE'] = active?.to_s
80
- ENV['APPSIGNAL_APP_PATH'] = root_path.to_s
81
- ENV['APPSIGNAL_AGENT_PATH'] = File.expand_path('../../../ext', __FILE__).to_s
82
- ENV['APPSIGNAL_ENVIRONMENT'] = env
83
- ENV['APPSIGNAL_AGENT_VERSION'] = Appsignal::Extension.agent_version
84
- ENV['APPSIGNAL_DEBUG_LOGGING'] = config_hash[:debug].to_s
85
- ENV['APPSIGNAL_LOG_FILE_PATH'] = config_hash[:log_file_path].to_s if config_hash[:log_file_path]
86
- ENV['APPSIGNAL_PUSH_API_ENDPOINT'] = config_hash[:endpoint]
87
- ENV['APPSIGNAL_PUSH_API_KEY'] = config_hash[:push_api_key]
88
- ENV['APPSIGNAL_APP_NAME'] = config_hash[:name]
89
- ENV['APPSIGNAL_HTTP_PROXY'] = config_hash[:http_proxy]
90
- ENV['APPSIGNAL_IGNORE_ACTIONS'] = config_hash[:ignore_actions].join(',')
83
+ ENV['APPSIGNAL_ACTIVE'] = active?.to_s
84
+ ENV['APPSIGNAL_APP_PATH'] = root_path.to_s
85
+ ENV['APPSIGNAL_AGENT_PATH'] = File.expand_path('../../../ext', __FILE__).to_s
86
+ ENV['APPSIGNAL_ENVIRONMENT'] = env
87
+ ENV['APPSIGNAL_AGENT_VERSION'] = Appsignal::Extension.agent_version
88
+ ENV['APPSIGNAL_LANGUAGE_INTEGRATION_VERSION'] = Appsignal::VERSION
89
+ ENV['APPSIGNAL_DEBUG_LOGGING'] = config_hash[:debug].to_s
90
+ ENV['APPSIGNAL_LOG_FILE_PATH'] = config_hash[:log_file_path].to_s if config_hash[:log_file_path]
91
+ ENV['APPSIGNAL_PUSH_API_ENDPOINT'] = config_hash[:endpoint]
92
+ ENV['APPSIGNAL_PUSH_API_KEY'] = config_hash[:push_api_key]
93
+ ENV['APPSIGNAL_APP_NAME'] = config_hash[:name]
94
+ ENV['APPSIGNAL_HTTP_PROXY'] = config_hash[:http_proxy]
95
+ ENV['APPSIGNAL_IGNORE_ACTIONS'] = config_hash[:ignore_actions].join(',')
91
96
  end
92
97
 
93
98
  protected
@@ -0,0 +1,13 @@
1
+ if defined?(::Redis)
2
+ Appsignal.logger.info("Loading Redis (#{ Redis::VERSION }) integration")
3
+
4
+ ::Redis::Client.class_eval do
5
+ alias process_without_appsignal process
6
+
7
+ def process(commands, &block)
8
+ ActiveSupport::Notifications.instrument('query.redis') do
9
+ process_without_appsignal(commands, &block)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -6,10 +6,15 @@ if defined?(::Sequel)
6
6
  module Sequel
7
7
  # Add query instrumentation
8
8
  def log_yield(sql, args = nil)
9
- name = 'sql.sequel'
10
- payload = {:sql => sql, :args => args}
11
9
 
12
- ActiveSupport::Notifications.instrument(name, payload) { yield }
10
+ # We'd like to get full sql queries in the payloads as well. To do
11
+ # that we need to find out a way to ask Sequel which quoting strategy
12
+ # is used by the adapter. We can then do something similar to the AR
13
+ # formatter.
14
+
15
+ ActiveSupport::Notifications.instrument('sql.sequel') do
16
+ yield
17
+ end
13
18
  end
14
19
  end # Sequel
15
20
  end # Integrations
@@ -21,7 +21,8 @@ module Appsignal
21
21
  transaction = Appsignal::Transaction.create(
22
22
  env['action_dispatch.request_id'],
23
23
  Appsignal::Transaction::HTTP_REQUEST,
24
- request
24
+ request,
25
+ :params_method => :filtered_parameters
25
26
  )
26
27
  begin
27
28
  @app.call(env)
@@ -29,7 +30,10 @@ module Appsignal
29
30
  transaction.set_error(error)
30
31
  raise error
31
32
  ensure
32
- transaction.set_http_or_background_action
33
+ controller = env['action_controller.instance']
34
+ if controller
35
+ transaction.set_action("#{controller.class.to_s}##{controller.action_name}")
36
+ end
33
37
  transaction.set_http_or_background_queue_start
34
38
  transaction.set_metadata('path', request.path)
35
39
  transaction.set_metadata('method', request.request_method)
@@ -1,5 +1,5 @@
1
1
  require 'yaml'
2
2
 
3
3
  module Appsignal
4
- VERSION = '0.12.beta.54'
4
+ VERSION = '0.12.rc.5'
5
5
  end
@@ -1,3 +1,3 @@
1
1
  # This is just a placeholder file, as +Sequel.extensions+ forcefully loads it
2
2
  # instead of assuming we already did. If you're looking for the integration
3
- # implementation, you can find it in +lib/appsignal/integrations/sequel.rb+
3
+ # implementation, you can find it in +lib/appsignal/instrumentations/sequel.rb+
@@ -20,6 +20,8 @@ describe Appsignal::Config do
20
20
  :ignore_errors => [],
21
21
  :ignore_actions => [],
22
22
  :instrument_net_http => true,
23
+ :instrument_redis => true,
24
+ :instrument_sequel => true,
23
25
  :skip_session_data => false,
24
26
  :send_params => true,
25
27
  :endpoint => 'https://push.appsignal.com',
@@ -68,18 +70,19 @@ describe Appsignal::Config do
68
70
  end
69
71
 
70
72
  it "should write the current config to env vars" do
71
- ENV['APPSIGNAL_ACTIVE'].should == 'true'
72
- ENV['APPSIGNAL_APP_PATH'].should end_with('spec/support/project_fixture')
73
- ENV['APPSIGNAL_AGENT_PATH'].should end_with('/ext')
74
- ENV['APPSIGNAL_DEBUG_LOGGING'].should == 'false'
75
- ENV['APPSIGNAL_LOG_FILE_PATH'].should == '/var/log/appsignal.log'
76
- ENV['APPSIGNAL_PUSH_API_ENDPOINT'].should == 'https://push.appsignal.com'
77
- ENV['APPSIGNAL_PUSH_API_KEY'].should == 'abc'
78
- ENV['APPSIGNAL_APP_NAME'].should == 'TestApp'
79
- ENV['APPSIGNAL_ENVIRONMENT'].should == 'production'
80
- ENV['APPSIGNAL_AGENT_VERSION'].should == Appsignal::Extension.agent_version
81
- ENV['APPSIGNAL_HTTP_PROXY'].should == 'http://localhost'
82
- ENV['APPSIGNAL_IGNORE_ACTIONS'].should == 'action1,action2'
73
+ ENV['APPSIGNAL_ACTIVE'].should == 'true'
74
+ ENV['APPSIGNAL_APP_PATH'].should end_with('spec/support/project_fixture')
75
+ ENV['APPSIGNAL_AGENT_PATH'].should end_with('/ext')
76
+ ENV['APPSIGNAL_DEBUG_LOGGING'].should == 'false'
77
+ ENV['APPSIGNAL_LOG_FILE_PATH'].should == '/var/log/appsignal.log'
78
+ ENV['APPSIGNAL_PUSH_API_ENDPOINT'].should == 'https://push.appsignal.com'
79
+ ENV['APPSIGNAL_PUSH_API_KEY'].should == 'abc'
80
+ ENV['APPSIGNAL_APP_NAME'].should == 'TestApp'
81
+ ENV['APPSIGNAL_ENVIRONMENT'].should == 'production'
82
+ ENV['APPSIGNAL_AGENT_VERSION'].should == Appsignal::Extension.agent_version
83
+ ENV['APPSIGNAL_LANGUAGE_INTEGRATION_VERSION'].should == Appsignal::VERSION
84
+ ENV['APPSIGNAL_HTTP_PROXY'].should == 'http://localhost'
85
+ ENV['APPSIGNAL_IGNORE_ACTIONS'].should == 'action1,action2'
83
86
  end
84
87
  end
85
88
 
@@ -0,0 +1,45 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Net::HTTP instrumentation" do
4
+ let(:file) { File.expand_path('lib/appsignal/instrumentations/redis.rb') }
5
+
6
+ let(:events) { [] }
7
+ before do
8
+ ActiveSupport::Notifications.subscribe(/^[^!]/) do |*args|
9
+ events << ActiveSupport::Notifications::Event.new(*args)
10
+ end
11
+ end
12
+
13
+ context "with redis" do
14
+ before :all do
15
+ module Redis
16
+ class Client
17
+ def process(commands, &block)
18
+ 1
19
+ end
20
+ end
21
+ VERSION = '1.0'
22
+ end
23
+ end
24
+
25
+ before do
26
+ load file
27
+ end
28
+
29
+ it "should generate an event for a redis call" do
30
+ client = Redis::Client.new
31
+
32
+ client.process([]).should == 1
33
+
34
+ event = events.last
35
+ event.name.should == 'query.redis'
36
+ end
37
+ end
38
+
39
+ context "without redis" do
40
+ before(:all) { Object.send(:remove_const, :Redis) }
41
+
42
+ specify { expect { ::Redis }.to raise_error(NameError) }
43
+ specify { expect { load file }.to_not raise_error }
44
+ end
45
+ end
@@ -1,5 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
+ class MockController
4
+ end
5
+
3
6
  if defined?(::Rails)
4
7
  describe Appsignal::Rack::RailsInstrumentation do
5
8
  before :all do
@@ -7,7 +10,14 @@ if defined?(::Rails)
7
10
  end
8
11
 
9
12
  let(:app) { double(:call => true) }
10
- let(:env) { http_request_env_with_data('action_dispatch.request_id' => '1') }
13
+ let(:env) do
14
+ http_request_env_with_data('action_dispatch.request_id' => '1').tap do |request|
15
+ request['action_controller.instance'] = double(
16
+ :class => MockController,
17
+ :action_name => 'index'
18
+ )
19
+ end
20
+ end
11
21
  let(:middleware) { Appsignal::Rack::RailsInstrumentation.new(app, {}) }
12
22
 
13
23
  describe "#call" do
@@ -43,8 +53,15 @@ if defined?(::Rails)
43
53
  Appsignal::Transaction.should_receive(:create).with(
44
54
  '1',
45
55
  Appsignal::Transaction::HTTP_REQUEST,
46
- kind_of(ActionDispatch::Request)
47
- ).and_return(double(:set_http_or_background_action => nil, :set_http_or_background_queue_start => nil, :set_metadata => nil))
56
+ kind_of(ActionDispatch::Request),
57
+ :params_method=>:filtered_parameters
58
+ ).and_return(
59
+ double(
60
+ :set_action => nil,
61
+ :set_http_or_background_queue_start => nil,
62
+ :set_metadata => nil
63
+ )
64
+ )
48
65
  end
49
66
 
50
67
  it "should call the app" do
@@ -69,7 +86,7 @@ if defined?(::Rails)
69
86
  end
70
87
 
71
88
  it "should set the action and queue start" do
72
- Appsignal::Transaction.any_instance.should_receive(:set_http_or_background_action)
89
+ Appsignal::Transaction.any_instance.should_receive(:set_action).with('MockController#index')
73
90
  Appsignal::Transaction.any_instance.should_receive(:set_http_or_background_queue_start)
74
91
  end
75
92
 
@@ -131,19 +131,25 @@ describe Appsignal do
131
131
  describe ".load_instrumentations" do
132
132
  before { Appsignal.config = project_fixture_config }
133
133
 
134
- context "Net::HTTP" do
135
- context "if on in the config" do
136
- it "should require net_http" do
137
- Appsignal.should_receive(:require).with('appsignal/instrumentations/net_http')
138
- end
134
+ context "if on in the config" do
135
+ it "should require integrations" do
136
+ Appsignal.should_receive(:require).with('appsignal/instrumentations/net_http').once
137
+ Appsignal.should_receive(:require).with('appsignal/instrumentations/redis').once
138
+ Appsignal.should_receive(:require).with('appsignal/instrumentations/sequel').once
139
139
  end
140
+ end
140
141
 
141
- context "if off in the config" do
142
- before { Appsignal.config.config_hash[:instrument_net_http] = false }
142
+ context "if off in the config" do
143
+ before do
144
+ Appsignal.config.config_hash[:instrument_net_http] = false
145
+ Appsignal.config.config_hash[:instrument_redis] = false
146
+ Appsignal.config.config_hash[:instrument_sequel] = false
147
+ end
143
148
 
144
- it "should not require net_http" do
145
- Appsignal.should_not_receive(:require).with('appsignal/instrumentations/net_http')
146
- end
149
+ it "should require integrations" do
150
+ Appsignal.should_not_receive(:require).with('appsignal/instrumentations/net_http')
151
+ Appsignal.should_not_receive(:require).with('appsignal/instrumentations/redis')
152
+ Appsignal.should_not_receive(:require).with('appsignal/instrumentations/sequel')
147
153
  end
148
154
  end
149
155
 
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.beta.54
4
+ version: 0.12.rc.5
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-10-23 00:00:00.000000000 Z
12
+ date: 2015-11-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
@@ -156,6 +156,8 @@ files:
156
156
  - lib/appsignal/event_formatter/net_http/request_formatter.rb
157
157
  - lib/appsignal/extension.rb
158
158
  - lib/appsignal/instrumentations/net_http.rb
159
+ - lib/appsignal/instrumentations/redis.rb
160
+ - lib/appsignal/instrumentations/sequel.rb
159
161
  - lib/appsignal/integrations/capistrano/appsignal.cap
160
162
  - lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
161
163
  - lib/appsignal/integrations/capistrano/careful_logger.rb
@@ -167,7 +169,6 @@ files:
167
169
  - lib/appsignal/integrations/rails.rb
168
170
  - lib/appsignal/integrations/rake.rb
169
171
  - lib/appsignal/integrations/resque.rb
170
- - lib/appsignal/integrations/sequel.rb
171
172
  - lib/appsignal/integrations/sidekiq.rb
172
173
  - lib/appsignal/integrations/sinatra.rb
173
174
  - lib/appsignal/integrations/unicorn.rb
@@ -201,6 +202,8 @@ files:
201
202
  - spec/lib/appsignal/event_formatter_spec.rb
202
203
  - spec/lib/appsignal/extension_spec.rb
203
204
  - spec/lib/appsignal/instrumentations/net_http_spec.rb
205
+ - spec/lib/appsignal/instrumentations/redis_spec.rb
206
+ - spec/lib/appsignal/instrumentations/sequel_spec.rb
204
207
  - spec/lib/appsignal/integrations/capistrano2_spec.rb
205
208
  - spec/lib/appsignal/integrations/capistrano3_spec.rb
206
209
  - spec/lib/appsignal/integrations/celluloid_spec.rb
@@ -211,7 +214,6 @@ files:
211
214
  - spec/lib/appsignal/integrations/rails_spec.rb
212
215
  - spec/lib/appsignal/integrations/rake_spec.rb
213
216
  - spec/lib/appsignal/integrations/resque_spec.rb
214
- - spec/lib/appsignal/integrations/sequel_spec.rb
215
217
  - spec/lib/appsignal/integrations/sidekiq_spec.rb
216
218
  - spec/lib/appsignal/integrations/sinatra_spec.rb
217
219
  - spec/lib/appsignal/integrations/unicorn_spec.rb
@@ -277,6 +279,8 @@ test_files:
277
279
  - spec/lib/appsignal/event_formatter_spec.rb
278
280
  - spec/lib/appsignal/extension_spec.rb
279
281
  - spec/lib/appsignal/instrumentations/net_http_spec.rb
282
+ - spec/lib/appsignal/instrumentations/redis_spec.rb
283
+ - spec/lib/appsignal/instrumentations/sequel_spec.rb
280
284
  - spec/lib/appsignal/integrations/capistrano2_spec.rb
281
285
  - spec/lib/appsignal/integrations/capistrano3_spec.rb
282
286
  - spec/lib/appsignal/integrations/celluloid_spec.rb
@@ -287,7 +291,6 @@ test_files:
287
291
  - spec/lib/appsignal/integrations/rails_spec.rb
288
292
  - spec/lib/appsignal/integrations/rake_spec.rb
289
293
  - spec/lib/appsignal/integrations/resque_spec.rb
290
- - spec/lib/appsignal/integrations/sequel_spec.rb
291
294
  - spec/lib/appsignal/integrations/sidekiq_spec.rb
292
295
  - spec/lib/appsignal/integrations/sinatra_spec.rb
293
296
  - spec/lib/appsignal/integrations/unicorn_spec.rb