Add this line to your application's Gemfile:
gem 'datadog_notifier'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install datadog_notifier
- Datadog must be integrated in the project before we use this gem
DatadogNotifier.notify(exception, payload_json)
Here exception
is the error same as we send for Airbrake i.e ErrorTracking.notify(exception)
and payload_json
is an optional parameter where we can pass the payload(json value) to share extra details in datadog error tracking
- Error Tracking
- We can filter out these custom errors using
@custom_dd_notifier:true
as we are passing this custom_dd_notifier while sending custom errors to datadog.
We have kept DatadogNotifier signature same as other ErrorTracking services. This will help us to just search and replace all occurences. Just replace ErrorTracking.notify with DatadogNotifier.notify
Before: ErrorTracking.notify("ProductErrorForm: Error while scraping new product", error_params_json)
After: DatadogNotifier.notify("ProductErrorForm: Error while scraping new product", error_params_json)
Bug reports and pull requests are welcome on GitHub at https://github.com/patterninc/datadog_notifier
The gem is available as open source under the terms of the MIT License.