Class: Errplane::Configuration
- Inherits:
-
Object
- Object
- Errplane::Configuration
- Defined in:
- lib/errplane/configuration.rb
Constant Summary collapse
- DEFAULTS =
{ :api_host => "apiv2.errplane.com", :app_host => "app.errplane.com", :ignored_exceptions => %w{ActiveRecord::RecordNotFound ActionController::RoutingError}, :ignored_exception_messages => [], :ignored_reports => [], :ignored_environments => %w{test cucumber selenium}, :ignored_user_agents => %w{GoogleBot}, :environment_variable_filters => [ /password/i, /key/i, /secret/i ], :backtrace_filters => [ lambda { |line| line.gsub(/^\.\//, "") }, lambda { |line| return line if Errplane.configuration.application_root.to_s.empty? line.gsub(/#{Errplane.configuration.application_root}/, "[APP_ROOT]") }, lambda { |line| if defined?(Gem) && !Gem.path.nil? && !Gem.path.empty? Gem.path.each { |path| line = line.gsub(/#{path}/, "[GEM_ROOT]") } end line } ] }
Instance Attribute Summary collapse
-
#aggregated_exception_classes ⇒ Object
Returns the value of attribute aggregated_exception_classes.
-
#api_host ⇒ Object
Returns the value of attribute api_host.
-
#api_host_port ⇒ Object
Returns the value of attribute api_host_port.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#app_host ⇒ Object
Returns the value of attribute app_host.
-
#application_id ⇒ Object
Returns the value of attribute application_id.
-
#application_name ⇒ Object
Returns the value of attribute application_name.
-
#application_root ⇒ Object
Returns the value of attribute application_root.
-
#backtrace_filters ⇒ Object
Returns the value of attribute backtrace_filters.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#environment_variable_filters ⇒ Object
Returns the value of attribute environment_variable_filters.
-
#environment_variables ⇒ Object
Returns the value of attribute environment_variables.
-
#framework ⇒ Object
Returns the value of attribute framework.
-
#framework_version ⇒ Object
Returns the value of attribute framework_version.
-
#ignored_environments ⇒ Object
Returns the value of attribute ignored_environments.
-
#ignored_exception_messages ⇒ Object
Returns the value of attribute ignored_exception_messages.
-
#ignored_exceptions ⇒ Object
Returns the value of attribute ignored_exceptions.
-
#ignored_reports ⇒ Object
Returns the value of attribute ignored_reports.
-
#ignored_user_agents ⇒ Object
Returns the value of attribute ignored_user_agents.
-
#instrumentation_enabled ⇒ Object
Returns the value of attribute instrumentation_enabled.
-
#language ⇒ Object
Returns the value of attribute language.
-
#language_version ⇒ Object
Returns the value of attribute language_version.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#queue_maximum_depth ⇒ Object
Returns the value of attribute queue_maximum_depth.
-
#queue_maximum_post ⇒ Object
Returns the value of attribute queue_maximum_post.
-
#queue_worker_polling_interval ⇒ Object
Returns the value of attribute queue_worker_polling_interval.
-
#queue_worker_threads ⇒ Object
Returns the value of attribute queue_worker_threads.
-
#reraise_global_exceptions ⇒ Object
Returns the value of attribute reraise_global_exceptions.
Instance Method Summary collapse
- #add_custom_exception_data(black_box) ⇒ Object
- #debug? ⇒ Boolean
- #define_custom_exception_data(&block) ⇒ Object
- #ignore_current_environment? ⇒ Boolean
- #ignore_user_agent?(incoming_user_agent) ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #instrumentation_enabled? ⇒ Boolean
- #reraise_global_exceptions? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/errplane/configuration.rb', line 65 def initialize @api_host = DEFAULTS[:api_host] @api_host_port = DEFAULTS[:api_host_port] @app_host = DEFAULTS[:app_host] @ignored_exceptions = DEFAULTS[:ignored_exceptions].dup = DEFAULTS[:ignored_exception_messages].dup @ignored_reports = DEFAULTS[:ignored_reports].dup @ignored_environments = DEFAULTS[:ignored_environments].dup @ignored_user_agents = DEFAULTS[:ignored_user_agents].dup @backtrace_filters = DEFAULTS[:backtrace_filters].dup @environment_variable_filters = DEFAULTS[:environment_variable_filters] @aggregated_exception_classes = [] @debug = false @rescue_global_exceptions = false @instrumentation_enabled = true @queue_worker_threads = 3 @queue_worker_polling_interval = 5 @queue_maximum_depth = 10_000 @queue_maximum_post = 500 end |
Instance Attribute Details
#aggregated_exception_classes ⇒ Object
Returns the value of attribute aggregated_exception_classes.
23 24 25 |
# File 'lib/errplane/configuration.rb', line 23 def aggregated_exception_classes @aggregated_exception_classes end |
#api_host ⇒ Object
Returns the value of attribute api_host.
4 5 6 |
# File 'lib/errplane/configuration.rb', line 4 def api_host @api_host end |
#api_host_port ⇒ Object
Returns the value of attribute api_host_port.
5 6 7 |
# File 'lib/errplane/configuration.rb', line 5 def api_host_port @api_host_port end |
#api_key ⇒ Object
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/errplane/configuration.rb', line 3 def api_key @api_key end |
#app_host ⇒ Object
Returns the value of attribute app_host.
6 7 8 |
# File 'lib/errplane/configuration.rb', line 6 def app_host @app_host end |
#application_id ⇒ Object
Returns the value of attribute application_id.
7 8 9 |
# File 'lib/errplane/configuration.rb', line 7 def application_id @application_id end |
#application_name ⇒ Object
Returns the value of attribute application_name.
8 9 10 |
# File 'lib/errplane/configuration.rb', line 8 def application_name @application_name end |
#application_root ⇒ Object
Returns the value of attribute application_root.
9 10 11 |
# File 'lib/errplane/configuration.rb', line 9 def application_root @application_root end |
#backtrace_filters ⇒ Object
Returns the value of attribute backtrace_filters.
22 23 24 |
# File 'lib/errplane/configuration.rb', line 22 def backtrace_filters @backtrace_filters end |
#debug ⇒ Object
Returns the value of attribute debug.
28 29 30 |
# File 'lib/errplane/configuration.rb', line 28 def debug @debug end |
#environment ⇒ Object
Returns the value of attribute environment.
12 13 14 |
# File 'lib/errplane/configuration.rb', line 12 def environment @environment end |
#environment_variable_filters ⇒ Object
Returns the value of attribute environment_variable_filters.
25 26 27 |
# File 'lib/errplane/configuration.rb', line 25 def environment_variable_filters @environment_variable_filters end |
#environment_variables ⇒ Object
Returns the value of attribute environment_variables.
24 25 26 |
# File 'lib/errplane/configuration.rb', line 24 def environment_variables @environment_variables end |
#framework ⇒ Object
Returns the value of attribute framework.
13 14 15 |
# File 'lib/errplane/configuration.rb', line 13 def framework @framework end |
#framework_version ⇒ Object
Returns the value of attribute framework_version.
14 15 16 |
# File 'lib/errplane/configuration.rb', line 14 def framework_version @framework_version end |
#ignored_environments ⇒ Object
Returns the value of attribute ignored_environments.
20 21 22 |
# File 'lib/errplane/configuration.rb', line 20 def ignored_environments @ignored_environments end |
#ignored_exception_messages ⇒ Object
Returns the value of attribute ignored_exception_messages.
18 19 20 |
# File 'lib/errplane/configuration.rb', line 18 def end |
#ignored_exceptions ⇒ Object
Returns the value of attribute ignored_exceptions.
17 18 19 |
# File 'lib/errplane/configuration.rb', line 17 def ignored_exceptions @ignored_exceptions end |
#ignored_reports ⇒ Object
Returns the value of attribute ignored_reports.
19 20 21 |
# File 'lib/errplane/configuration.rb', line 19 def ignored_reports @ignored_reports end |
#ignored_user_agents ⇒ Object
Returns the value of attribute ignored_user_agents.
21 22 23 |
# File 'lib/errplane/configuration.rb', line 21 def ignored_user_agents @ignored_user_agents end |
#instrumentation_enabled ⇒ Object
Returns the value of attribute instrumentation_enabled.
27 28 29 |
# File 'lib/errplane/configuration.rb', line 27 def instrumentation_enabled @instrumentation_enabled end |
#language ⇒ Object
Returns the value of attribute language.
15 16 17 |
# File 'lib/errplane/configuration.rb', line 15 def language @language end |
#language_version ⇒ Object
Returns the value of attribute language_version.
16 17 18 |
# File 'lib/errplane/configuration.rb', line 16 def language_version @language_version end |
#logger ⇒ Object
Returns the value of attribute logger.
11 12 13 |
# File 'lib/errplane/configuration.rb', line 11 def logger @logger end |
#queue_maximum_depth ⇒ Object
Returns the value of attribute queue_maximum_depth.
33 34 35 |
# File 'lib/errplane/configuration.rb', line 33 def queue_maximum_depth @queue_maximum_depth end |
#queue_maximum_post ⇒ Object
Returns the value of attribute queue_maximum_post.
34 35 36 |
# File 'lib/errplane/configuration.rb', line 34 def queue_maximum_post @queue_maximum_post end |
#queue_worker_polling_interval ⇒ Object
Returns the value of attribute queue_worker_polling_interval.
32 33 34 |
# File 'lib/errplane/configuration.rb', line 32 def queue_worker_polling_interval @queue_worker_polling_interval end |
#queue_worker_threads ⇒ Object
Returns the value of attribute queue_worker_threads.
31 32 33 |
# File 'lib/errplane/configuration.rb', line 31 def queue_worker_threads @queue_worker_threads end |
#reraise_global_exceptions ⇒ Object
Returns the value of attribute reraise_global_exceptions.
29 30 31 |
# File 'lib/errplane/configuration.rb', line 29 def reraise_global_exceptions @reraise_global_exceptions end |
Instance Method Details
#add_custom_exception_data(black_box) ⇒ Object
111 112 113 |
# File 'lib/errplane/configuration.rb', line 111 def add_custom_exception_data(black_box) @custom_exception_data_handler.call(black_box) if @custom_exception_data_handler end |
#debug? ⇒ Boolean
86 87 88 |
# File 'lib/errplane/configuration.rb', line 86 def debug? !!@debug end |
#define_custom_exception_data(&block) ⇒ Object
107 108 109 |
# File 'lib/errplane/configuration.rb', line 107 def define_custom_exception_data(&block) @custom_exception_data_handler = block end |
#ignore_current_environment? ⇒ Boolean
103 104 105 |
# File 'lib/errplane/configuration.rb', line 103 def ignore_current_environment? self.ignored_environments.include?(self.environment) end |
#ignore_user_agent?(incoming_user_agent) ⇒ Boolean
98 99 100 101 |
# File 'lib/errplane/configuration.rb', line 98 def ignore_user_agent?(incoming_user_agent) return false if self.ignored_user_agents.nil? self.ignored_user_agents.any? {|agent| incoming_user_agent =~ /#{agent}/} end |
#instrumentation_enabled? ⇒ Boolean
90 91 92 |
# File 'lib/errplane/configuration.rb', line 90 def instrumentation_enabled? !!@instrumentation_enabled end |
#reraise_global_exceptions? ⇒ Boolean
94 95 96 |
# File 'lib/errplane/configuration.rb', line 94 def reraise_global_exceptions? !!@reraise_global_exceptions end |