Class: RailsRiemannMiddleware::ExceptionNotification
- Inherits:
-
Object
- Object
- RailsRiemannMiddleware::ExceptionNotification
- Defined in:
- lib/rails_riemann_middleware/exception_notification.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
Instance Method Summary collapse
- #deliver ⇒ Object
-
#initialize(event, env, exception, options = {}) ⇒ ExceptionNotification
constructor
A new instance of ExceptionNotification.
- #message ⇒ Object
- #send ⇒ Object
Constructor Details
#initialize(event, env, exception, options = {}) ⇒ ExceptionNotification
Returns a new instance of ExceptionNotification.
8 9 10 11 |
# File 'lib/rails_riemann_middleware/exception_notification.rb', line 8 def initialize(event, env, exception, ={}) @event, @env, @exception = event, env, exception @headers = .fetch(:headers, []) end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
6 7 8 |
# File 'lib/rails_riemann_middleware/exception_notification.rb', line 6 def env @env end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
6 7 8 |
# File 'lib/rails_riemann_middleware/exception_notification.rb', line 6 def event @event end |
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
6 7 8 |
# File 'lib/rails_riemann_middleware/exception_notification.rb', line 6 def exception @exception end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
6 7 8 |
# File 'lib/rails_riemann_middleware/exception_notification.rb', line 6 def headers @headers end |
Instance Method Details
#deliver ⇒ Object
17 18 19 |
# File 'lib/rails_riemann_middleware/exception_notification.rb', line 17 def deliver send end |
#message ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rails_riemann_middleware/exception_notification.rb', line 21 def msg = { :host => env['HTTP_HOST'], :service => "#{event.app_prefix} exception".strip, :state => 'error', :description => backtrace, :tags => ["exception"] } # ap msg msg end |
#send ⇒ Object
13 14 15 |
# File 'lib/rails_riemann_middleware/exception_notification.rb', line 13 def send event << end |