peastash 0.2.4 → 0.2.5

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
  SHA256:
3
- metadata.gz: 6f2f09c34ca13d8ab6ee2842add1d06fb4f49efbf1825c904c053d8a50ae75c2
4
- data.tar.gz: cd336e4d3ac448b4dc9b43e1ff230388c99e9d0532c136bed87c9359fdb5d893
3
+ metadata.gz: 3523f0e68ce08c25fb5190edc2adf0d4552e7f83fb0999bdfa2c5a0416a86f20
4
+ data.tar.gz: c9be85c295ef6cac39e48af37e0b0047e8612950e8588398ca8c07d11ddbad53
5
5
  SHA512:
6
- metadata.gz: 4ccb538320167ad2b078161bcb0a7c5d0c9a2ab59b9b327735241a69d4ef0494ce978a2a171ac405491015bd5459ee14b0308aa24bc6ab07e8f3ce98a58f3646
7
- data.tar.gz: 88c9574c661cf6841c42a12733f9a66d5058facad72baa8f7fdf7d6561e0ee4f902a47aa63c7da1a0e55be2590b77c6a462a84a79d87587fbdde7eccaf817bf6
6
+ metadata.gz: 8502a33c3850bcb20e78a5b23612328749f69cf65c5b337540481c5bcfc2b608d64cfa54dadb6b9b51b9959c32524db820420d8b3d172a8230693fd5e5bb8073
7
+ data.tar.gz: b50c0f042e7828317aafd27705278c212a298cd827794f40977797333e9c7b9a7013d18dad8918f38edd6c3cc6a430b35798f3fcdf4cb2829b78d730a460990a
data/README.md CHANGED
@@ -101,6 +101,8 @@ config.peastash.enabled = true
101
101
  # You can also configure Peastash from here, for example:
102
102
  config.peastash.output = Peastash::Outputs::IO.new(File.join(Rails.root, 'log', "logstash_#{Rails.env}.log"))
103
103
  config.peastash.source = Rails.application.class.parent_name
104
+ config.peastash.before_block = ->(env, response) { Peastash.with_instance.store[:path] = Rack::Request.new(env).path }
105
+ config.peastash.after_block = ->(env, response) { Peastash.with_instance.store[:puma_wait] = env['puma.request_body_wait'] }
104
106
  ```
105
107
 
106
108
  By default, Peastash's Rails integration will log the same parameters as the Middleware version, plus the fields in the payload of the [``process_action.action_controller``](http://edgeguides.rubyonrails.org/active_support_instrumentation.html#process_action.action_controller) notification (except the params).
@@ -23,7 +23,7 @@ class Peastash
23
23
  Peastash.with_instance.store.merge!(payload) { |key, old_val, new_val| old_val }
24
24
  end
25
25
  before_middleware = app.config.peastash[:insert_before] || ActionDispatch::ShowExceptions
26
- app.config.middleware.insert_before before_middleware, Peastash::Middleware
26
+ app.config.middleware.insert_before before_middleware, Peastash::Middleware, app.config.peastash[:before_block], app.config.peastash[:after_block]
27
27
  end
28
28
  end
29
29
  end
@@ -1,3 +1,3 @@
1
1
  class Peastash
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peastash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Boisard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-18 00:00:00.000000000 Z
11
+ date: 2019-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-event
@@ -292,7 +292,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
292
292
  - !ruby/object:Gem::Version
293
293
  version: '0'
294
294
  requirements: []
295
- rubygems_version: 3.0.1
295
+ rubygems_version: 3.0.3
296
296
  signing_key:
297
297
  specification_version: 4
298
298
  summary: Peastash allows you to instrument your code with the ELK stack easily.