Class: Lapsoss::Adapters::SentryAdapter
- Defined in:
- lib/lapsoss/adapters/sentry_adapter.rb
Direct Known Subclasses
Constant Summary
Constants included from Concerns::EnvelopeBuilder
Concerns::EnvelopeBuilder::GZIP_THRESHOLD
Constants included from Concerns::LevelMapping
Concerns::LevelMapping::LEVEL_MAPPINGS
Constants inherited from Base
Base::JSON_CONTENT_TYPE, Base::USER_AGENT
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #capabilities ⇒ Object
- #capture(event) ⇒ Object
-
#initialize(name, settings = {}) ⇒ SentryAdapter
constructor
A new instance of SentryAdapter.
Methods included from Concerns::HttpDelivery
#deliver, #git_branch, #git_sha, #handle_client_error, #handle_delivery_error, #handle_response, #mark_error_handled
Methods included from Concerns::EnvelopeBuilder
#build_envelope_wrapper, #format_breadcrumbs, #format_timestamp, #sdk_info
Methods included from Concerns::LevelMapping
Methods inherited from Base
#disable!, #enable!, #enabled?, #flush, #shutdown, #supports?
Methods included from Validators
logger, validate_api_key!, validate_callable!, validate_dsn!, validate_environment!, validate_presence!, validate_retries!, validate_sample_rate!, validate_timeout!, validate_url!
Constructor Details
#initialize(name, settings = {}) ⇒ SentryAdapter
Returns a new instance of SentryAdapter.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/lapsoss/adapters/sentry_adapter.rb', line 17 def initialize(name, settings = {}) super if settings[:dsn].blank? Lapsoss.configuration.logger&.warn "[Lapsoss::SentryAdapter] No DSN provided, adapter disabled" @enabled = false return end if validate_dsn!(settings[:dsn], "Sentry DSN") @dsn = parse_dsn(settings[:dsn]) setup_endpoint else @enabled = false end end |
Instance Method Details
#capabilities ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/lapsoss/adapters/sentry_adapter.rb', line 38 def capabilities super.merge( code_context: true, breadcrumbs: true, data_scrubbing: true ) end |
#capture(event) ⇒ Object
34 35 36 |
# File 'lib/lapsoss/adapters/sentry_adapter.rb', line 34 def capture(event) deliver(event.scrubbed) end |