appsignal 0.11.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e9fd11fafb3322ce74b514c93301324d737e4946
4
- data.tar.gz: 9075e749b6dd0f34b966057fd5e0535b5cde5e21
3
+ metadata.gz: d41abe0ea106adaa95e6273e1187136769252aaf
4
+ data.tar.gz: 3c1e7c0345cdd1e32eff0d33493025ac13b4e24f
5
5
  SHA512:
6
- metadata.gz: 0fdbf566062f6f4aaad9c37f640ac0d39d0600807dccc1344b89f7518d9dcf325b921a11c362c6e279f0d3e401859932064827e1195fd0f06529f9c3d776afd7
7
- data.tar.gz: c01cdf83266ffea67aa0131a5909485b96638948dea3e415fb30f7303182c98fe3e1f35a7ee89839924f7b0c17f55cf409ede336cb51e05c4c12342e76cd2dca
6
+ metadata.gz: 1d3dc0a5722caa2109cd7b15ef2bf9929df3e1927b6d2e16f17de79d27d01724d62f8266e4274a6dc8d4b9ea0d8bbf55786ad12f1d19dceaa4ebfde5d852f80f
7
+ data.tar.gz: 28001d15fced01dd048fd66dada12216ed8044cae66b0d7354964a1fcf6a467341a37003edb03b216af13a505052590d8842d1c3419eb24fec7870cf5fb8adfb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.11.1
2
+ * Allow a custom request_class and params_method on Rack instrumentation
3
+ * Loop through env methods instead of env
4
+ * Add HTTP_CLIENT_IP to env methods
5
+
1
6
  # 0.11.0
2
7
  * Improved inter process communication
3
8
  * Retry sending data when the push api is not reachable
data/README.md CHANGED
@@ -67,6 +67,7 @@ bundle --gemfile gemfiles/rails-3.1.gemfile
67
67
  bundle --gemfile gemfiles/rails-3.2.gemfile
68
68
  bundle --gemfile gemfiles/rails-4.0.gemfile
69
69
  bundle --gemfile gemfiles/rails-4.1.gemfile
70
+ bundle --gemfile gemfiles/rails-4.2.gemfile
70
71
  bundle --gemfile gemfiles/sinatra.gemfile
71
72
  ```
72
73
 
@@ -81,6 +82,7 @@ BUNDLE_GEMFILE=gemfiles/rails-3.1.gemfile bundle exec rspec
81
82
  BUNDLE_GEMFILE=gemfiles/rails-3.2.gemfile bundle exec rspec
82
83
  BUNDLE_GEMFILE=gemfiles/rails-4.0.gemfile bundle exec rspec
83
84
  BUNDLE_GEMFILE=gemfiles/rails-4.1.gemfile bundle exec rspec
85
+ BUNDLE_GEMFILE=gemfiles/rails-4.2.gemfile bundle exec rspec
84
86
  BUNDLE_GEMFILE=gemfiles/sinatra.gemfile bundle exec rspec
85
87
  ```
86
88
 
data/Rakefile CHANGED
@@ -7,6 +7,7 @@ GEMFILES = %w(
7
7
  rails-3.2
8
8
  rails-4.0
9
9
  rails-4.1
10
+ rails-4.2
10
11
  sinatra
11
12
  )
12
13
 
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '~> 4.1.0.beta'
3
+ gem 'rails', '~> 4.1.0'
4
4
 
5
5
  gem 'generator_spec'
6
6
 
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', '~> 4.2.0.rc'
4
+
5
+ gem 'generator_spec'
6
+
7
+ gemspec :path => '../'
@@ -16,10 +16,11 @@ module Appsignal
16
16
  end
17
17
 
18
18
  def raw_payload(env)
19
- request = ::Rack::Request.new(env)
19
+ request = @options.fetch(:request_class, ::Rack::Request).new(env)
20
+ params = request.public_send(@options.fetch(:params_method, :params))
20
21
  {
21
22
  :action => "#{request.request_method}:#{request.path}",
22
- :params => request.params,
23
+ :params => params,
23
24
  :method => request.request_method,
24
25
  :path => request.path
25
26
  }
@@ -9,7 +9,7 @@ module Appsignal
9
9
  HTTP_X_QUEUE_TIME HTTP_X_HEROKU_QUEUE_WAIT_TIME HTTP_X_APPLICATION_START
10
10
  HTTP_ACCEPT HTTP_ACCEPT_CHARSET HTTP_ACCEPT_ENCODING HTTP_ACCEPT_LANGUAGE
11
11
  HTTP_CACHE_CONTROL HTTP_CONNECTION HTTP_USER_AGENT HTTP_FROM HTTP_NEGOTIATE
12
- HTTP_PRAGMA HTTP_REFERER HTTP_X_FORWARDED_FOR).freeze
12
+ HTTP_PRAGMA HTTP_REFERER HTTP_X_FORWARDED_FOR HTTP_CLIENT_IP).freeze
13
13
 
14
14
  def self.create(request_id, env)
15
15
  Appsignal.logger.debug("Creating transaction: #{request_id}")
@@ -197,8 +197,8 @@ module Appsignal
197
197
 
198
198
  def sanitize_environment!
199
199
  return unless env
200
- env.each do |key, value|
201
- sanitized_environment[key] = value if ENV_METHODS.include?(key)
200
+ ENV_METHODS.each do |key|
201
+ sanitized_environment[key] = env[key]
202
202
  end
203
203
  end
204
204
 
@@ -1,3 +1,3 @@
1
1
  module Appsignal
2
- VERSION = '0.11.0'
2
+ VERSION = '0.11.1'
3
3
  end
@@ -46,4 +46,28 @@ describe Appsignal::Rack::Instrumentation do
46
46
  :path => '/homepage'
47
47
  } }
48
48
  end
49
+
50
+ describe "use a custom request class and parameters method" do
51
+ let(:request_class) do
52
+ double(
53
+ new: double(
54
+ request_method: 'POST',
55
+ path: '/somewhere',
56
+ filtered_params: {'param' => 'changed_something'}
57
+ )
58
+ )
59
+ end
60
+ let(:options) do
61
+ { request_class: request_class, params_method: :filtered_params }
62
+ end
63
+ let(:middleware) { Appsignal::Rack::Instrumentation.new(app, options) }
64
+ subject { middleware.raw_payload(env) }
65
+
66
+ it { should == {
67
+ :action => 'POST:/somewhere',
68
+ :params => {'param' => 'changed_something'},
69
+ :method => 'POST',
70
+ :path => '/somewhere'
71
+ } }
72
+ end
49
73
  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.11.0
4
+ version: 0.11.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-11-17 00:00:00.000000000 Z
15
+ date: 2014-12-15 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rack
@@ -138,6 +138,7 @@ files:
138
138
  - gemfiles/rails-3.2.gemfile
139
139
  - gemfiles/rails-4.0.gemfile
140
140
  - gemfiles/rails-4.1.gemfile
141
+ - gemfiles/rails-4.2.gemfile
141
142
  - gemfiles/sinatra.gemfile
142
143
  - lib/appsignal.rb
143
144
  - lib/appsignal/agent.rb