Class: Lapsoss::Adapters::RollbarAdapter
- Defined in:
- lib/lapsoss/adapters/rollbar_adapter.rb
Constant Summary collapse
- DEFAULT_API_ENDPOINT =
"https://api.rollbar.com"- DEFAULT_API_PATH =
"/api/1/item/"
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 = {}) ⇒ RollbarAdapter
constructor
A new instance of RollbarAdapter.
Methods included from Concerns::HttpDelivery
#build_delivery_headers, #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, #serialize_payload
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 = {}) ⇒ RollbarAdapter
Returns a new instance of RollbarAdapter.
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/lapsoss/adapters/rollbar_adapter.rb', line 17 def initialize(name, settings = {}) super @api_endpoint = DEFAULT_API_ENDPOINT @api_path = DEFAULT_API_PATH @access_token = settings[:access_token].presence || ENV["ROLLBAR_ACCESS_TOKEN"] if @access_token.blank? Lapsoss.configuration.logger&.warn "[Lapsoss::RollbarAdapter] No access token provided, adapter disabled" @enabled = false else validate_api_key!(@access_token, "Rollbar access token", format: :alphanumeric) end end |
Instance Method Details
#capabilities ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/lapsoss/adapters/rollbar_adapter.rb', line 35 def capabilities super.merge( breadcrumbs: true, user_tracking: true, custom_context: true, release_tracking: true ) end |
#capture(event) ⇒ Object
31 32 33 |
# File 'lib/lapsoss/adapters/rollbar_adapter.rb', line 31 def capture(event) deliver(event.scrubbed) end |