Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Or install it yourself as:

### Dependency
* [Datadog](https://github.com/DataDog/dd-trace-rb) must be integrated in the project before we use this gem

* use version <=1.0.4 for ruby <3.4
# Quick Use
## Send notification to datadog(Traces to add errors in Datadog)
```DatadogNotifier.notify(exception, payload_json)```
Expand Down
13 changes: 10 additions & 3 deletions datadog_notifier.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,27 @@

lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'datadog_notifier'
# Don't require datadog_notifier here - it has dependencies that aren't installed yet during bundle install
require 'datadog_notifier/version'

Gem::Specification.new do |spec|
spec.name = 'datadog_notifier'
spec.version = DatadogNotifier::VERSION
spec.authors = ['Patterninc']
spec.email = ['[email protected]']
spec.summary = 'Datadog notifier to send custom errors with ddtrace'
spec.summary = 'Datadog notifier to send custom errors with datadog'
spec.description = 'Datadog notifier to send custom errors in Datadog error tracking dashboard'
spec.homepage = 'https://github.com/patterninc/datadog_notifier'
spec.license = 'MIT'

spec.add_dependency 'ddtrace', '>= 1.13.0'
ruby_version = Gem::Version.new(RUBY_VERSION)
breaking_version = Gem::Version.new('3.4')

if ruby_version >= breaking_version
spec.add_dependency 'datadog', '>= 2.0.0'
else
spec.add_dependency 'ddtrace', '>= 1.13.0'
end

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
Expand Down
6 changes: 5 additions & 1 deletion lib/datadog_notifier.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# frozen_string_literal: true

require 'ddtrace'
if RUBY_VERSION < '3.4'
require 'ddtrace'
else
require 'datadog'
end
require 'datadog_notifier_exception'
require 'datadog_notifier/version'

Expand Down