class Opbeat::Configuration
Attributes
App ID to use with Opbeat
Optional Proc to be used to send events asynchronously
Optional Proc to be used to send events asynchronously
Backoff multipler
Number of lines of code context to capture, or nil for none
Whitelist of environments that will send notifications to Opbeat
Which exceptions should never be sent
An array of parameters whould should be filtered from the log
Logger
to use internally
Timout when opening connection to the server
Organization ID to use with Opbeat
Secret access token for authentication with Opbeat
Base URL of the Opbeat
server
Should the SSL certificate of the server be verified?
Timeout when waiting for the server to return data in seconds
Public Class Methods
# File lib/opbeat/configuration.rb, line 50 def initialize self.server = ENV['OPBEAT_SERVER'] || "https://intake.opbeat.com" self.secret_token = ENV['OPBEAT_SECRET_TOKEN'] if ENV['OPBEAT_SECRET_TOKEN'] self.organization_id = ENV['OPBEAT_ORGANIZATION_ID'] if ENV['OPBEAT_ORGANIZATION_ID'] self.app_id = ENV['OPBEAT_APP_ID'] if ENV['OPBEAT_APP_ID'] @context_lines = 3 self.environments = %w[ development production default ] self.current_environment = (defined?(::Rails) && ::Rails.env) || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'default' self.excluded_exceptions = [] self.timeout = 1 self.open_timeout = 1 self.backoff_multiplier = 2 self.ssl_verification = true self.user_controller_method = 'current_user' self.async = false end
Public Instance Methods
Allows config options to be read like a hash
@param [Symbol] option Key for a given attribute
# File lib/opbeat/configuration.rb, line 70 def [](option) send(option) end
# File lib/opbeat/configuration.rb, line 82 def async=(value) raise ArgumentError.new("async must be callable (or false to disable)") unless (value == false || value.respond_to?(:call)) @async = value end
# File lib/opbeat/configuration.rb, line 74 def current_environment=(environment) @current_environment = environment.to_s end
# File lib/opbeat/configuration.rb, line 78 def send_in_current_environment? environments.include? current_environment end