Class: Opbeat::Configuration
- Inherits:
-
Object
- Object
- Opbeat::Configuration
- Defined in:
- lib/opbeat/configuration.rb
Instance Attribute Summary collapse
-
#app_id ⇒ Object
App ID to use with Opbeat.
-
#backoff_multiplier ⇒ Object
Backoff multipler.
-
#context_lines ⇒ Object
Number of lines of code context to capture, or nil for none.
-
#current_environment ⇒ Object
Returns the value of attribute current_environment.
-
#environments ⇒ Object
Whitelist of environments that will send notifications to Opbeat.
-
#excluded_exceptions ⇒ Object
Which exceptions should never be sent.
-
#logger ⇒ Object
Logger to use internally.
-
#open_timeout ⇒ Object
Timout when opening connection to the server.
-
#organization_id ⇒ Object
Organization ID to use with Opbeat.
-
#processors ⇒ Object
Processors to run on data before sending upstream.
-
#secret_token ⇒ Object
Secret access token for authentication with Opbeat.
-
#server ⇒ Object
Base URL of the Opbeat server.
-
#ssl_verification ⇒ Object
Should the SSL certificate of the server be verified?.
-
#timeout ⇒ Object
Timeout when waiting for the server to return data in seconds.
-
#user_controller_method ⇒ Object
Returns the value of attribute user_controller_method.
Instance Method Summary collapse
-
#[](option) ⇒ Object
Allows config options to be read like a hash.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #send_in_current_environment? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/opbeat/configuration.rb', line 47 def initialize self.server = ENV['OPBEAT_SERVER'] || "https://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 = ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'default' self.excluded_exceptions = [] self.processors = [Opbeat::Processor::SanitizeData] self.timeout = 1 self.backoff_multiplier = 2 self.ssl_verification = true self.user_controller_method = 'current_user' end |
Instance Attribute Details
#app_id ⇒ Object
App ID to use with Opbeat
14 15 16 |
# File 'lib/opbeat/configuration.rb', line 14 def app_id @app_id end |
#backoff_multiplier ⇒ Object
Backoff multipler
38 39 40 |
# File 'lib/opbeat/configuration.rb', line 38 def backoff_multiplier @backoff_multiplier end |
#context_lines ⇒ Object
Number of lines of code context to capture, or nil for none
20 21 22 |
# File 'lib/opbeat/configuration.rb', line 20 def context_lines @context_lines end |
#current_environment ⇒ Object
Returns the value of attribute current_environment.
43 44 45 |
# File 'lib/opbeat/configuration.rb', line 43 def current_environment @current_environment end |
#environments ⇒ Object
Whitelist of environments that will send notifications to Opbeat
23 24 25 |
# File 'lib/opbeat/configuration.rb', line 23 def environments @environments end |
#excluded_exceptions ⇒ Object
Which exceptions should never be sent
26 27 28 |
# File 'lib/opbeat/configuration.rb', line 26 def excluded_exceptions @excluded_exceptions end |
#logger ⇒ Object
Logger to use internally
17 18 19 |
# File 'lib/opbeat/configuration.rb', line 17 def logger @logger end |
#open_timeout ⇒ Object
Timout when opening connection to the server
35 36 37 |
# File 'lib/opbeat/configuration.rb', line 35 def open_timeout @open_timeout end |
#organization_id ⇒ Object
Organization ID to use with Opbeat
11 12 13 |
# File 'lib/opbeat/configuration.rb', line 11 def organization_id @organization_id end |
#processors ⇒ Object
Processors to run on data before sending upstream
29 30 31 |
# File 'lib/opbeat/configuration.rb', line 29 def processors @processors end |
#secret_token ⇒ Object
Secret access token for authentication with Opbeat
8 9 10 |
# File 'lib/opbeat/configuration.rb', line 8 def secret_token @secret_token end |
#server ⇒ Object
Base URL of the Opbeat server
5 6 7 |
# File 'lib/opbeat/configuration.rb', line 5 def server @server end |
#ssl_verification ⇒ Object
Should the SSL certificate of the server be verified?
41 42 43 |
# File 'lib/opbeat/configuration.rb', line 41 def ssl_verification @ssl_verification end |
#timeout ⇒ Object
Timeout when waiting for the server to return data in seconds
32 33 34 |
# File 'lib/opbeat/configuration.rb', line 32 def timeout @timeout end |
#user_controller_method ⇒ Object
Returns the value of attribute user_controller_method.
45 46 47 |
# File 'lib/opbeat/configuration.rb', line 45 def user_controller_method @user_controller_method end |
Instance Method Details
#[](option) ⇒ Object
Allows config options to be read like a hash
66 67 68 |
# File 'lib/opbeat/configuration.rb', line 66 def [](option) send(option) end |
#send_in_current_environment? ⇒ Boolean
74 75 76 |
# File 'lib/opbeat/configuration.rb', line 74 def send_in_current_environment? environments.include? current_environment end |