Module: Sentry::Integrable

Defined in:
lib/sentry/integrable.rb

Instance Method Summary collapse

Instance Method Details

#capture_check_in(slug, status, **options, &block) ⇒ Object



30
31
32
33
34
# File 'lib/sentry/integrable.rb', line 30

def capture_check_in(slug, status, **options, &block)
  options[:hint] ||= {}
  options[:hint][:integration] = integration_name
  Sentry.capture_check_in(slug, status, **options, &block)
end

#capture_exception(exception, **options, &block) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/sentry/integrable.rb', line 14

def capture_exception(exception, **options, &block)
  options[:hint] ||= {}
  options[:hint][:integration] = integration_name

  # within an integration, we usually intercept uncaught exceptions so we set handled to false.
  options[:hint][:mechanism] ||= Sentry::Mechanism.new(type: integration_name, handled: false)

  Sentry.capture_exception(exception, **options, &block)
end

#capture_message(message, **options, &block) ⇒ Object



24
25
26
27
28
# File 'lib/sentry/integrable.rb', line 24

def capture_message(message, **options, &block)
  options[:hint] ||= {}
  options[:hint][:integration] = integration_name
  Sentry.capture_message(message, **options, &block)
end

#integration_nameObject



10
11
12
# File 'lib/sentry/integrable.rb', line 10

def integration_name
  @integration_name
end

#register_integration(name:, version:) ⇒ Object



5
6
7
8
# File 'lib/sentry/integrable.rb', line 5

def register_integration(name:, version:)
  Sentry.register_integration(name, version)
  @integration_name = name
end