class InfluxDB::Rails::Configuration
rubocop:disable Metrics/ClassLength
Constants
- DEFAULTS
Http logs attr_accessor :enabled attr_accessor :compact_log attr_accessor :json_log attr_accessor :logger attr_accessor :logger_method attr_accessor :severity attr_accessor :prefix attr_accessor :log_connect attr_accessor :log_request attr_accessor :log_headers attr_accessor :log_data attr_accessor :log_status attr_accessor :log_response attr_accessor :log_benchmark attr_accessor :url_whitelist_pattern attr_accessor :url_blacklist_pattern attr_accessor :color attr_accessor :prefix_data_lines attr_accessor :prefix_response_lines attr_accessor :prefix_line_numbers attr_accessor :filter_parameters
Attributes
Public Class Methods
rubocop:disable Metrics/MethodLength rubocop:disable Metrics/AbcSize
# File lib/influxdb/rails/configuration.rb, line 146 def initialize @influxdb_hosts = DEFAULTS[:influxdb_hosts] @influxdb_port = DEFAULTS[:influxdb_port] @influxdb_username = DEFAULTS[:influxdb_username] @influxdb_password = DEFAULTS[:influxdb_password] @influxdb_database = DEFAULTS[:influxdb_database] @async = DEFAULTS[:async] @use_ssl = DEFAULTS[:use_ssl] @retry = DEFAULTS[:retry] @open_timeout = DEFAULTS[:open_timeout] @read_timeout = DEFAULTS[:read_timeout] @max_delay = DEFAULTS[:max_delay] @time_precision = DEFAULTS[:time_precision] @series_name_for_controller_runtimes = DEFAULTS[:series_name_for_controller_runtimes] @series_name_for_view_runtimes = DEFAULTS[:series_name_for_view_runtimes] @series_name_for_db_runtimes = DEFAULTS[:series_name_for_db_runtimes] @series_name_for_exceptions = DEFAULTS[:series_name_for_exceptions] @series_name_for_instrumentation = DEFAULTS[:series_name_for_instrumentation] @series_name_for_render_template = DEFAULTS[:series_name_for_render_template] @series_name_for_render_partial = DEFAULTS[:series_name_for_render_partial] @series_name_for_render_collection = DEFAULTS[:series_name_for_render_collection] @series_name_for_sql = DEFAULTS[:series_name_for_sql] @series_name_for_http_client_log = DEFAULTS[:series_name_for_http_client_log] @tags_middleware = DEFAULTS[:tags_middleware] @rails_app_name = DEFAULTS[:rails_app_name] @ignored_exceptions = DEFAULTS[:ignored_exceptions].dup @ignored_exception_messages = 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 # Http logs # @enabled = true # @compact_log = false # @json_log = false # @logger = Logger.new($stdout) # @logger_method = :log # @severity = Logger::Severity::DEBUG # @prefix = LOG_PREFIX # @log_connect = true # @log_request = true # @log_headers = false # @log_data = true # @log_status = true # @log_response = true # @log_benchmark = true # @url_whitelist_pattern = nil # @url_blacklist_pattern = nil # @color = false # @prefix_data_lines = false # @prefix_response_lines = false # @prefix_line_numbers = false # @filter_parameters = [] end
Public Instance Methods
# File lib/influxdb/rails/configuration.rb, line 241 def add_custom_exception_data(exception_presenter) @custom_exception_data_handler&.call(exception_presenter) end
rubocop:enable Metrics/MethodLength rubocop:enable Metrics/AbcSize
# File lib/influxdb/rails/configuration.rb, line 214 def debug? !!@debug # rubocop:disable Style/DoubleNegation end
# File lib/influxdb/rails/configuration.rb, line 237 def define_custom_exception_data(&block) @custom_exception_data_handler = block end
# File lib/influxdb/rails/configuration.rb, line 228 def ignore_current_environment? ignored_environments.include?(environment) end
# File lib/influxdb/rails/configuration.rb, line 232 def ignore_exception?(ex) !ignored_exception_messages.find { |msg| /.*#{msg}.*/ =~ ex.message }.nil? || ignored_exceptions.include?(ex.class.to_s) end
# File lib/influxdb/rails/configuration.rb, line 222 def ignore_user_agent?(incoming_user_agent) return false if ignored_user_agents.nil? ignored_user_agents.any? { |agent| incoming_user_agent =~ /#{agent}/ } end
# File lib/influxdb/rails/configuration.rb, line 218 def instrumentation_enabled? !!@instrumentation_enabled # rubocop:disable Style/DoubleNegation end
# File lib/influxdb/rails/configuration.rb, line 245 def load_rails_defaults @logger ||= ::Rails.logger @environment ||= ::Rails.env @application_root ||= ::Rails.root @application_name ||= ::Rails.application.class.parent_name @framework = "Rails" @framework_version = ::Rails.version end
Private Instance Methods
# File lib/influxdb/rails/configuration.rb, line 256 def initialize_http_connection Net::HTTP.new(@app_host, "80") end