restash 0.3.1 → 0.4.0

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
- NDVhNzlhN2RhM2U0OWEwOGJmYzRjMGM5Njc4YmI2ODJiMGQyNmE3Zg==
4
+ MGQzYzljNzMzM2UyNDU4OGU1OGUzMmRlNTI0ZDRiODUxZDY3NzNjYg==
5
5
  data.tar.gz: !binary |-
6
- ZTAzODBkNDBmNDk5OGNhZTVlZjFiMDdkMDJmNjMyZmE2ZmIxOGM4ZA==
6
+ MDZmZmQ5ZTkyNjcwOTAxYjFjYjI2ZmJmYjYyOTk0NjMzZjQ2YTBmOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YWRjNzQxNGRkOGQ1YTE0MTkwNjZmMTJiYzJlM2FiOTAzODFiOGUyNDg3ZTQw
10
- OTkwMTUzN2I3MTNkNWM5YzQ5NjU0NWY3MjQyMDE3OTgwNDk1YmExOTEyMDZh
11
- OTY5Y2Y0YzlhOGEzOGZiNGNkNDVlNzg3M2EwYzZhZjM2ZDhiMGY=
9
+ YjllZmEwZjgyN2UyOWM3YjViNTVkM2IxMGEwMGFhODBlZDVlYTMxNDcwYTdh
10
+ YjFkNWQwNmQxMjNkYjY3MzkwMzA5NGNiOTNjNjFkZWI0NjRlNzk2ZGZlZWIy
11
+ MDM4YTdlMGMzMTkyYzYxMTNiMTU0YTc2NjY2OTNkZWUyYjY3MGI=
12
12
  data.tar.gz: !binary |-
13
- Y2M2YjNkZTQxMTNlNzQ0YWZmNWVhODZmOGRmMzI3MDBkMDdkM2RlNTY4ZWM2
14
- YTkwZmVlNDMwZGY3Y2U3N2Q3NTFjZWYwODQ4YjllNDIwOGM0MTcyNTVjZDFi
15
- MDg4ZGNjMjY1ZDU4ZDZkY2RjNjMzYTlhY2VlMDY4YmQ2OTg3NjU=
13
+ Njg1ZmE0NDU0ZDJhOGY3OTdkZDZkMmEyMTYyZDk5NmNjOTVhODkxYzNlNDUz
14
+ MGFkODhmNzcyNWE0OWU0ZWJkYjdmMGI0M2JmNTZkYzhlMTM2YTI4NGU4ZWYx
15
+ MTU1YTdiYzMwMmVlNjQ1YjFmOTJhNGU2MTVkZDQ5MDNlNWFjNmI=
data/README.md CHANGED
@@ -16,6 +16,7 @@ Restash::Conf.configure do |conf|
16
16
  conf.logstash_host = ENV['LOGSTASH_HOST']
17
17
  conf.logstash_port = ENV['LOGSTASH_PORT']
18
18
  conf.options = {connect_timeout: timeout1, write_timeout: timeout2, read_timeout: timeout3}
19
+ conf.extra_options[:some_option_key] = :some_option_value
19
20
  end
20
21
  ```
21
22
 
@@ -7,12 +7,14 @@ module Resque
7
7
 
8
8
  def save
9
9
  begin
10
- Restash::Conf.logger.write({ exception: exception.to_s,
11
- backtrace: exception.backtrace,
12
- worker: worker.to_s,
13
- queue: queue,
14
- payload: payload,
15
- tags: [:resque_failure] }.to_json)
10
+ message = { exception: exception.to_s,
11
+ backtrace: exception.backtrace,
12
+ worker: worker.to_s,
13
+ queue: queue,
14
+ payload: payload,
15
+ tags: [:resque_failure] }
16
+ message.merge! Restash::Conf.extra_options
17
+ Restash::Conf.logger.write(message.to_json)
16
18
  rescue => e
17
19
  puts "Failed to send to logstash: #{e.message}\n#{e.backtrace}"
18
20
  end
@@ -5,9 +5,10 @@ module Restash
5
5
 
6
6
  class << self
7
7
 
8
- attr_accessor :logstash_host, :logstash_port, :options
8
+ attr_accessor :logstash_host, :logstash_port, :options, :extra_options
9
9
 
10
10
  def configure
11
+ self.extra_options = {}
11
12
  yield self
12
13
  true
13
14
  end
@@ -1,3 +1,3 @@
1
1
  module Restash
2
- VERSION = '0.3.1'
2
+ VERSION = '0.4.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ariel Cabib
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-17 00:00:00.000000000 Z
11
+ date: 2016-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler