We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fdd5aa5 commit d60b341Copy full SHA for d60b341
lib/datadog_notifier.rb
@@ -3,10 +3,14 @@
3
require 'ddtrace'
4
require 'datadog_notifier_exception'
5
6
+# DatadogNotifier for custom error notification to datadog
7
class DatadogNotifier
8
def self.notify(exception, payload = {})
9
root_span = find_root_span(Datadog::Tracing.active_span)
- exception = DatadogNotifierException.new exception if exception.is_a?(String)
10
+ if exception.is_a?(String)
11
+ exception = DatadogNotifierException.new exception
12
+ exception.set_backtrace(payload.inspect)
13
+ end
14
root_span.set_error(exception)
15
root_span.set_tag('custom_dd_notifier', true)
16
root_span.set_tag('payload', payload.to_json) if payload.present?
0 commit comments