Project

restash

0.0
No release in over 3 years
Low commit activity in last 3 years
Logs Resque failures to Logstash
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.12
~> 10.0
~> 3.0

Runtime

 Project Readme

Restash

Build Status Log Resque failures to Logstash

Usage

Add to your backend:

Resque::Failure::Multiple.classes = [Resque::Failure::Redis, Resque::Failure::Logstash]
Resque::Failure.backend = Resque::Failure::Multiple

Configure logstash host and port. Supports only tcp, due to the large payload. A timeout can be passed in the options.

Restash::Conf.configure do |conf|
  conf.logstash_host = ENV['LOGSTASH_HOST']
  conf.logstash_port = ENV['LOGSTASH_PORT']
  conf.options = {connect_timeout: timeout1, write_timeout: timeout2, read_timeout: timeout3}
  conf.extra_options[:some_option_key] = :some_option_value
  conf.message_mutator = Proc.new do |message|
    message[:special_line] = message[:backtrace].try(:find) {|line| line.include?('special')}
  end
end

Additional options can be explored in the TCPTimeout project. The options are passed as is to a new TCPTimeout::TCPSocket object on every message.

License

The gem is available as open source under the terms of the MIT License.