0.0
No commit activity in last 3 years
No release in over 3 years
Wrapper for sending exceptions to datadog as events
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 5.0
~> 10.0

Runtime

 Project Readme

ExceptionDog

Exception dog is a simple exception notifier gem that pushes exceptions out to Dotadog as metric events. You can set up rules within datadog to push new occurrences of the events into slack for instance, to have a reasonably good exception service.

Installation

Add this line to your application's Gemfile:

gem 'exception_dog'

Usage

exception_dog can be configured to use the datadog agent or the public cloud API. You can configure in an initialiser, for example: in a file config/initializers/exception_dog.rb

Datadog Agent Configuration Example

ExceptionDog.configure do |config|
  config.environment = ENV["RAILS_ENV"]
  config.notifier = Rails.env.test? ? "ExceptionDog::LogNotifier" : "ExceptionDog::AgentNotifier"
  config.agent_host = 'localhost'
  config.agent_port = 8125
  config.logger = Rails.logger
  config.service_name = Rails.application.class.parent.name.underscore
  config.ignore_exceptions = ["ActionController::RoutingError"]
end

Datadog API configuration

ExceptionDog.configure do |config|
  config.environment = ENV["RAILS_ENV"]
  config.api_key = ENV["DATA_DOG_API_KEY"]
  config.notifier = Rails.env.test? ? "ExceptionDog::LogNotifier" : "ExceptionDog::HttpNotifier"
  config.logger = Rails.logger
  config.service_name = Rails.application.class.parent.name.underscore
  config.ignore_exceptions = ["ActionController::RoutingError"]
end

Middleware Configuration You can set up a simple middleware to catch and report exceptions for Rack based apps.

require 'exception_dog/integrations/rack'
Rails.application.config.middleware.insert_after ActionDispatch::ShowExceptions, ExceptionDog::Integrations::Rack

Running tests

ruby -Ilib -Itest test/*.rb

License

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