Method: Sentry::Configuration#initialize

Defined in:
lib/sentry/configuration.rb

#initialize {|_self| ... } ⇒ Configuration

Returns a new instance of Configuration.

Yields:

  • (_self)

Yield Parameters:



456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
# File 'lib/sentry/configuration.rb', line 456

def initialize
  run_callbacks(:before, :initialize)

  self.app_dirs_pattern = APP_DIRS_PATTERN
  self.debug = Sentry::Utils::EnvHelper.env_to_bool(ENV["SENTRY_DEBUG"])
  self.background_worker_threads = (processor_count / 2.0).ceil
  self.background_worker_max_queue = BackgroundWorker::DEFAULT_MAX_QUEUE
  self.backtrace_cleanup_callback = nil
  self.strip_backtrace_load_path = true
  self.max_breadcrumbs = BreadcrumbBuffer::DEFAULT_SIZE
  self.breadcrumbs_logger = []
  self.context_lines = 3
  self.include_local_variables = false
  self.environment = environment_from_env
  self.enabled_environments = nil
  self.exclude_loggers = []
  self.excluded_exceptions = IGNORE_DEFAULT + PUMA_IGNORE_DEFAULT
  self.inspect_exception_causes_for_exclusion = true
  self.linecache = ::Sentry::LineCache.new
  self.sdk_logger = ::Sentry::Logger.new(STDOUT)
  self.project_root = Dir.pwd
  self.propagate_traces = true

  self.sample_rate = 1.0
  self.send_modules = true
  self.send_default_pii = false
  self.skip_rake_integration = false
  self.send_client_reports = true
  self.auto_session_tracking = true
  self.enable_backpressure_handling = false
  self.trusted_proxies = []
  self.dsn = ENV["SENTRY_DSN"]

  spotlight_env = ENV["SENTRY_SPOTLIGHT"]
  spotlight_bool = Sentry::Utils::EnvHelper.env_to_bool(spotlight_env, strict: true)
  self.spotlight = spotlight_bool.nil? ? (spotlight_env || false) : spotlight_bool
  self.server_name = server_name_from_env
  self.instrumenter = :sentry
  self.trace_propagation_targets = [PROPAGATION_TARGETS_MATCH_ALL]
  self.trace_ignore_status_codes = TRACE_IGNORE_STATUS_CODES_DEFAULT
  self.enabled_patches = DEFAULT_PATCHES.dup

  self.before_send = nil
  self.before_send_transaction = nil
  self.before_send_check_in = nil
  self.before_send_log = nil
  self.rack_env_whitelist = RACK_ENV_WHITELIST_DEFAULT
  self.traces_sampler = nil
  self.enable_logs = false

  self.profiler_class = Sentry::Profiler
  self.profiles_sample_interval = DEFAULT_PROFILES_SAMPLE_INTERVAL

  @transport = Transport::Configuration.new
  @cron = Cron::Configuration.new
  @structured_logging = StructuredLoggingConfiguration.new
  @gem_specs = Hash[Gem::Specification.map { |spec| [spec.name, spec.version.to_s] }] if Gem::Specification.respond_to?(:map)

  self.max_log_events = LogEventBuffer::DEFAULT_MAX_EVENTS

  run_callbacks(:after, :initialize)

  yield(self) if block_given?

  run_callbacks(:after, :configured)
end