Class: Appsignal::Config
Defined Under Namespace
Constant Summary collapse
- DEFAULT_CONFIG =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
{ :activejob_report_errors => "all", :ca_file_path => File.(File.join("../../../resources/cacert.pem"), __FILE__), :dns_servers => [], :enable_allocation_tracking => true, :enable_at_exit_reporter => true, :enable_host_metrics => true, :enable_minutely_probes => true, :enable_statsd => true, :enable_nginx_metrics => false, :enable_gvl_global_timer => true, :enable_gvl_waiting_threads => true, :enable_rails_error_reporter => true, :enable_rake_performance_instrumentation => false, :endpoint => "https://push.appsignal.com", :files_world_accessible => true, :filter_metadata => [], :filter_parameters => [], :filter_session_data => [], :ignore_actions => [], :ignore_errors => [], :ignore_logs => [], :ignore_namespaces => [], :instrument_http_rb => true, :instrument_net_http => true, :instrument_redis => true, :instrument_sequel => true, :log => "file", :logging_endpoint => "https://appsignal-endpoint.net", :request_headers => %w[ HTTP_ACCEPT HTTP_ACCEPT_CHARSET HTTP_ACCEPT_ENCODING HTTP_ACCEPT_LANGUAGE HTTP_CACHE_CONTROL HTTP_CONNECTION CONTENT_LENGTH PATH_INFO HTTP_RANGE REQUEST_METHOD REQUEST_PATH SERVER_NAME SERVER_PORT SERVER_PROTOCOL ], :send_environment_metadata => true, :send_params => true, :send_session_data => true, :sidekiq_report_errors => "all" }.freeze
- DEFAULT_LOG_LEVEL =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
::Logger::INFO
- LOG_LEVEL_MAP =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Map from the ‘log_level` config option to Ruby’s Logger level value.
The trace level doesn’t exist in the Ruby logger so it’s mapped to debug.
{ "error" => ::Logger::ERROR, "warn" => ::Logger::WARN, "warning" => ::Logger::WARN, "info" => ::Logger::INFO, "debug" => ::Logger::DEBUG, "trace" => ::Logger::DEBUG }.freeze
- STRING_OPTIONS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
{ :activejob_report_errors => "APPSIGNAL_ACTIVEJOB_REPORT_ERRORS", :name => "APPSIGNAL_APP_NAME", :bind_address => "APPSIGNAL_BIND_ADDRESS", :ca_file_path => "APPSIGNAL_CA_FILE_PATH", :hostname => "APPSIGNAL_HOSTNAME", :host_role => "APPSIGNAL_HOST_ROLE", :http_proxy => "APPSIGNAL_HTTP_PROXY", :log => "APPSIGNAL_LOG", :log_level => "APPSIGNAL_LOG_LEVEL", :log_path => "APPSIGNAL_LOG_PATH", :logging_endpoint => "APPSIGNAL_LOGGING_ENDPOINT", :endpoint => "APPSIGNAL_PUSH_API_ENDPOINT", :push_api_key => "APPSIGNAL_PUSH_API_KEY", :sidekiq_report_errors => "APPSIGNAL_SIDEKIQ_REPORT_ERRORS", :statsd_port => "APPSIGNAL_STATSD_PORT", :working_directory_path => "APPSIGNAL_WORKING_DIRECTORY_PATH", :revision => "APP_REVISION" }.freeze
- BOOLEAN_OPTIONS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
{ :active => "APPSIGNAL_ACTIVE", :enable_allocation_tracking => "APPSIGNAL_ENABLE_ALLOCATION_TRACKING", :enable_at_exit_reporter => "APPSIGNAL_ENABLE_AT_EXIT_REPORTER", :enable_host_metrics => "APPSIGNAL_ENABLE_HOST_METRICS", :enable_minutely_probes => "APPSIGNAL_ENABLE_MINUTELY_PROBES", :enable_statsd => "APPSIGNAL_ENABLE_STATSD", :enable_nginx_metrics => "APPSIGNAL_ENABLE_NGINX_METRICS", :enable_gvl_global_timer => "APPSIGNAL_ENABLE_GVL_GLOBAL_TIMER", :enable_gvl_waiting_threads => "APPSIGNAL_ENABLE_GVL_WAITING_THREADS", :enable_rails_error_reporter => "APPSIGNAL_ENABLE_RAILS_ERROR_REPORTER", :enable_rake_performance_instrumentation => "APPSIGNAL_ENABLE_RAKE_PERFORMANCE_INSTRUMENTATION", :files_world_accessible => "APPSIGNAL_FILES_WORLD_ACCESSIBLE", :instrument_http_rb => "APPSIGNAL_INSTRUMENT_HTTP_RB", :instrument_net_http => "APPSIGNAL_INSTRUMENT_NET_HTTP", :instrument_redis => "APPSIGNAL_INSTRUMENT_REDIS", :instrument_sequel => "APPSIGNAL_INSTRUMENT_SEQUEL", :running_in_container => "APPSIGNAL_RUNNING_IN_CONTAINER", :send_environment_metadata => "APPSIGNAL_SEND_ENVIRONMENT_METADATA", :send_params => "APPSIGNAL_SEND_PARAMS", :send_session_data => "APPSIGNAL_SEND_SESSION_DATA" }.freeze
- ARRAY_OPTIONS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
{ :dns_servers => "APPSIGNAL_DNS_SERVERS", :filter_metadata => "APPSIGNAL_FILTER_METADATA", :filter_parameters => "APPSIGNAL_FILTER_PARAMETERS", :filter_session_data => "APPSIGNAL_FILTER_SESSION_DATA", :ignore_actions => "APPSIGNAL_IGNORE_ACTIONS", :ignore_errors => "APPSIGNAL_IGNORE_ERRORS", :ignore_logs => "APPSIGNAL_IGNORE_LOGS", :ignore_namespaces => "APPSIGNAL_IGNORE_NAMESPACES", :request_headers => "APPSIGNAL_REQUEST_HEADERS" }.freeze
- FLOAT_OPTIONS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
{ :cpu_count => "APPSIGNAL_CPU_COUNT" }.freeze
Instance Attribute Summary collapse
- #config_hash ⇒ Object readonly private
-
#dsl_config ⇒ Object
readonly
private
List of config option sources.
- #env ⇒ Object readonly private
-
#env_config ⇒ Object
readonly
private
List of config option sources.
-
#file_config ⇒ Object
readonly
private
List of config option sources.
-
#initial_config ⇒ Object
readonly
private
List of config option sources.
-
#loaders_config ⇒ Object
readonly
private
List of config option sources.
-
#override_config ⇒ Object
readonly
private
List of config option sources.
- #root_path ⇒ Object readonly private
-
#system_config ⇒ Object
readonly
private
List of config option sources.
Class Method Summary collapse
- .add_loader_defaults(name, env: nil, root_path: nil, **options) ⇒ Object private
-
.determine_env(initial_env = nil) ⇒ Object
private
Determine which env AppSignal should initialize with.
-
.determine_root_path ⇒ Object
private
Determine which root path AppSignal should initialize with.
- .loader_defaults ⇒ Object private
-
.system_tmp_dir ⇒ String
private
System’s tmp directory.
Instance Method Summary collapse
- #[](key) ⇒ Object private
-
#[]=(key, value) ⇒ Object
private
Update the internal config hash.
- #active? ⇒ Boolean
-
#freeze ⇒ Object
private
Deep freeze the config object so it cannot be modified during the runtime of the Ruby app.
-
#initialize(root_path, env, load_yaml_file: true) ⇒ Config
constructor
private
Initialize a new configuration object for AppSignal.
- #load_config ⇒ Object private
- #log_file_path ⇒ Object private
- #log_level ⇒ Object private
- #merge_dsl_options(options) ⇒ Object private
- #valid? ⇒ Boolean
- #validate ⇒ Object private
- #write_to_environment ⇒ Object private
- #yml_config_file? ⇒ Boolean private
Constructor Details
#initialize(root_path, env, load_yaml_file: true) ⇒ Config
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize a new configuration object for AppSignal.
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/appsignal/config.rb', line 238 def initialize( root_path, env, load_yaml_file: true ) @load_yaml_file = load_yaml_file @root_path = root_path.to_s @config_file_error = false @config_file = config_file @valid = false @env = env.to_s @config_hash = {} @system_config = {} @loaders_config = {} @initial_config = {} @file_config = {} @env_config = {} @override_config = {} @dsl_config = {} # Can be set using `Appsignal.configure` load_config end |
Instance Attribute Details
#config_hash ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
211 212 213 |
# File 'lib/appsignal/config.rb', line 211 def config_hash @config_hash end |
#dsl_config ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
List of config option sources. If a config option was set by a source, it’s listed in that source’s config options hash.
These options are merged as the config is initialized. Their values cannot be changed after the config is initialized.
Used by the diagnose report to list which value was read from which source.
221 222 223 |
# File 'lib/appsignal/config.rb', line 221 def dsl_config @dsl_config end |
#env ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
211 212 213 |
# File 'lib/appsignal/config.rb', line 211 def env @env end |
#env_config ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
List of config option sources. If a config option was set by a source, it’s listed in that source’s config options hash.
These options are merged as the config is initialized. Their values cannot be changed after the config is initialized.
Used by the diagnose report to list which value was read from which source.
221 222 223 |
# File 'lib/appsignal/config.rb', line 221 def env_config @env_config end |
#file_config ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
List of config option sources. If a config option was set by a source, it’s listed in that source’s config options hash.
These options are merged as the config is initialized. Their values cannot be changed after the config is initialized.
Used by the diagnose report to list which value was read from which source.
221 222 223 |
# File 'lib/appsignal/config.rb', line 221 def file_config @file_config end |
#initial_config ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
List of config option sources. If a config option was set by a source, it’s listed in that source’s config options hash.
These options are merged as the config is initialized. Their values cannot be changed after the config is initialized.
Used by the diagnose report to list which value was read from which source.
221 222 223 |
# File 'lib/appsignal/config.rb', line 221 def initial_config @initial_config end |
#loaders_config ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
List of config option sources. If a config option was set by a source, it’s listed in that source’s config options hash.
These options are merged as the config is initialized. Their values cannot be changed after the config is initialized.
Used by the diagnose report to list which value was read from which source.
221 222 223 |
# File 'lib/appsignal/config.rb', line 221 def loaders_config @loaders_config end |
#override_config ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
List of config option sources. If a config option was set by a source, it’s listed in that source’s config options hash.
These options are merged as the config is initialized. Their values cannot be changed after the config is initialized.
Used by the diagnose report to list which value was read from which source.
221 222 223 |
# File 'lib/appsignal/config.rb', line 221 def override_config @override_config end |
#root_path ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
211 212 213 |
# File 'lib/appsignal/config.rb', line 211 def root_path @root_path end |
#system_config ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
List of config option sources. If a config option was set by a source, it’s listed in that source’s config options hash.
These options are merged as the config is initialized. Their values cannot be changed after the config is initialized.
Used by the diagnose report to list which value was read from which source.
221 222 223 |
# File 'lib/appsignal/config.rb', line 221 def system_config @system_config end |
Class Method Details
.add_loader_defaults(name, env: nil, root_path: nil, **options) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/appsignal/config.rb', line 17 def self.add_loader_defaults(name, env: nil, root_path: nil, **) if Appsignal.config Appsignal.internal_logger.warn( "The config defaults from the '#{name}' loader are ignored since " \ "the AppSignal config has already been initialized." ) end loader_defaults << { :name => name, :env => env, :root_path => root_path, :options => .compact } end |
.determine_env(initial_env = nil) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Determine which env AppSignal should initialize with.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/appsignal/config.rb', line 35 def self.determine_env(initial_env = nil) [ initial_env, ENV.fetch("_APPSIGNAL_CONFIG_FILE_ENV", nil), # PRIVATE ENV var used by the diagnose CLI ENV.fetch("APPSIGNAL_APP_ENV", nil), ENV.fetch("RAILS_ENV", nil), ENV.fetch("RACK_ENV", nil) ].compact.each do |env| return env if env end loader_defaults.reverse.each do |loader_defaults| env = loader_defaults[:env] return env if env end nil end |
.determine_root_path ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Determine which root path AppSignal should initialize with.
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/appsignal/config.rb', line 56 def self.determine_root_path app_path_env_var = ENV.fetch("APPSIGNAL_APP_PATH", nil) return app_path_env_var if app_path_env_var loader_defaults.reverse.each do |loader_defaults| root_path = loader_defaults[:root_path] return root_path if root_path end Dir.pwd end |
.loader_defaults ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 |
# File 'lib/appsignal/config.rb', line 12 def self.loader_defaults @loader_defaults ||= [] end |
.system_tmp_dir ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns System’s tmp directory.
323 324 325 326 327 328 329 |
# File 'lib/appsignal/config.rb', line 323 def self.system_tmp_dir if Gem.win_platform? Dir.tmpdir else File.realpath("/tmp") end end |
Instance Method Details
#[](key) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
332 333 334 |
# File 'lib/appsignal/config.rb', line 332 def [](key) config_hash[key] end |
#[]=(key, value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Update the internal config hash.
This method does not update the config in the extension and agent. It should not be used to update the config after AppSignal has started.
342 343 344 |
# File 'lib/appsignal/config.rb', line 342 def []=(key, value) config_hash[key] = value end |
#active? ⇒ Boolean
388 389 390 |
# File 'lib/appsignal/config.rb', line 388 def active? @valid && config_hash[:active] end |
#freeze ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Deep freeze the config object so it cannot be modified during the runtime of the Ruby app.
470 471 472 473 474 |
# File 'lib/appsignal/config.rb', line 470 def freeze super config_hash.freeze config_hash.transform_values(&:freeze) end |
#load_config ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
# File 'lib/appsignal/config.rb', line 263 def load_config # Set defaults # Deep duplicate each frozen default value merge(DEFAULT_CONFIG.transform_values(&:dup)) # Set config based on the system @system_config = detect_from_system merge(system_config) # Set defaults from loaders in reverse order so the first registered # loader's defaults overwrite all others self.class.loader_defaults.reverse.each do |loader_defaults| = config_hash new_loader_defaults = {} defaults = loader_defaults[:options] defaults.each do |option, value| new_loader_defaults[option] = if ARRAY_OPTIONS.key?(option) # Merge arrays: new value first value + [option] else value end end @loaders_config.merge!(new_loader_defaults.merge( :root_path => loader_defaults[:root_path], :env => loader_defaults[:env] )) merge(new_loader_defaults) end # Track origin of env @initial_config[:env] = @env # Load the config file if it exists if @load_yaml_file @file_config = load_from_disk || {} merge(file_config) elsif yml_config_file? # When in a `config/appsignal.rb` file and it detects a # `config/appsignal.yml` file. # Only logged and printed on `Appsignal.start`. = "Both a Ruby and YAML configuration file are found. " \ "The `config/appsignal.yml` file is ignored when the " \ "config is loaded from `config/appsignal.rb`. Move all config to " \ "the `config/appsignal.rb` file and remove the " \ "`config/appsignal.yml` file." Appsignal::Utils::StdoutAndLoggerMessage.warning() end # Load config from environment variables @env_config = load_from_environment merge(env_config) # Track origin of env env_loaded_from_env = ENV.fetch("APPSIGNAL_APP_ENV", nil) @env_config[:env] = env_loaded_from_env if env_loaded_from_env end |
#log_file_path ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
# File 'lib/appsignal/config.rb', line 358 def log_file_path return @log_file_path if defined? @log_file_path path = config_hash[:log_path] || (root_path && File.join(root_path, "log")) if path && File.writable?(path) @log_file_path = File.join(File.realpath(path), "appsignal.log") return @log_file_path end system_tmp_dir = self.class.system_tmp_dir if File.writable? system_tmp_dir $stdout.puts "appsignal: Unable to log to '#{path}'. Logging to " \ "'#{system_tmp_dir}' instead. " \ "Please check the permissions for the application's (log) " \ "directory." @log_file_path = File.join(system_tmp_dir, "appsignal.log") else $stdout.puts "appsignal: Unable to log to '#{path}' or the " \ "'#{system_tmp_dir}' fallback. Please check the permissions " \ "for the application's (log) directory." @log_file_path = nil end @log_file_path end |
#log_level ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
347 348 349 350 351 352 353 354 355 |
# File 'lib/appsignal/config.rb', line 347 def log_level option = config_hash[:log_level] level = if option log_level_option = LOG_LEVEL_MAP[option] log_level_option end level.nil? ? Appsignal::Config::DEFAULT_LOG_LEVEL : level end |
#merge_dsl_options(options) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
434 435 436 437 |
# File 'lib/appsignal/config.rb', line 434 def () @dsl_config.merge!() merge() end |
#valid? ⇒ Boolean
384 385 386 |
# File 'lib/appsignal/config.rb', line 384 def valid? @valid end |
#validate ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 |
# File 'lib/appsignal/config.rb', line 440 def validate # Apply any overrides for invalid settings. @override_config = determine_overrides merge(override_config) # Strip path from endpoint so we're backwards compatible with # earlier versions of the gem. # TODO: Move to its own method, maybe in `#[]=`? endpoint_uri = URI(config_hash[:endpoint]) config_hash[:endpoint] = if endpoint_uri.port == 443 "#{endpoint_uri.scheme}://#{endpoint_uri.host}" else "#{endpoint_uri.scheme}://#{endpoint_uri.host}:#{endpoint_uri.port}" end push_api_key = config_hash[:push_api_key] || "" if push_api_key.strip.empty? @valid = false logger.error "Push API key not set after loading config" else @valid = true end end |
#write_to_environment ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 |
# File 'lib/appsignal/config.rb', line 393 def write_to_environment # rubocop:disable Metrics/AbcSize ENV["_APPSIGNAL_ACTIVE"] = active?.to_s ENV["_APPSIGNAL_AGENT_PATH"] = File.("../../ext", __dir__).to_s ENV["_APPSIGNAL_APP_NAME"] = config_hash[:name] ENV["_APPSIGNAL_APP_PATH"] = root_path.to_s ENV["_APPSIGNAL_BIND_ADDRESS"] = config_hash[:bind_address].to_s ENV["_APPSIGNAL_CA_FILE_PATH"] = config_hash[:ca_file_path].to_s ENV["_APPSIGNAL_CPU_COUNT"] = config_hash[:cpu_count].to_s ENV["_APPSIGNAL_DNS_SERVERS"] = config_hash[:dns_servers].join(",") ENV["_APPSIGNAL_ENABLE_HOST_METRICS"] = config_hash[:enable_host_metrics].to_s ENV["_APPSIGNAL_ENABLE_STATSD"] = config_hash[:enable_statsd].to_s ENV["_APPSIGNAL_ENABLE_NGINX_METRICS"] = config_hash[:enable_nginx_metrics].to_s ENV["_APPSIGNAL_APP_ENV"] = env ENV["_APPSIGNAL_FILES_WORLD_ACCESSIBLE"] = config_hash[:files_world_accessible].to_s ENV["_APPSIGNAL_FILTER_PARAMETERS"] = config_hash[:filter_parameters].join(",") ENV["_APPSIGNAL_FILTER_SESSION_DATA"] = config_hash[:filter_session_data].join(",") ENV["_APPSIGNAL_HOSTNAME"] = config_hash[:hostname].to_s ENV["_APPSIGNAL_HOST_ROLE"] = config_hash[:host_role].to_s ENV["_APPSIGNAL_HTTP_PROXY"] = config_hash[:http_proxy] ENV["_APPSIGNAL_IGNORE_ACTIONS"] = config_hash[:ignore_actions].join(",") ENV["_APPSIGNAL_IGNORE_ERRORS"] = config_hash[:ignore_errors].join(",") ENV["_APPSIGNAL_IGNORE_LOGS"] = config_hash[:ignore_logs].join(",") ENV["_APPSIGNAL_IGNORE_NAMESPACES"] = config_hash[:ignore_namespaces].join(",") ENV["_APPSIGNAL_LANGUAGE_INTEGRATION_VERSION"] = "ruby-#{Appsignal::VERSION}" ENV["_APPSIGNAL_LOG"] = config_hash[:log] ENV["_APPSIGNAL_LOG_LEVEL"] = config_hash[:log_level] ENV["_APPSIGNAL_LOG_FILE_PATH"] = log_file_path.to_s if log_file_path ENV["_APPSIGNAL_LOGGING_ENDPOINT"] = config_hash[:logging_endpoint] ENV["_APPSIGNAL_PROCESS_NAME"] = $PROGRAM_NAME ENV["_APPSIGNAL_PUSH_API_ENDPOINT"] = config_hash[:endpoint] ENV["_APPSIGNAL_PUSH_API_KEY"] = config_hash[:push_api_key] ENV["_APPSIGNAL_RUNNING_IN_CONTAINER"] = config_hash[:running_in_container].to_s ENV["_APPSIGNAL_SEND_ENVIRONMENT_METADATA"] = config_hash[:send_environment_metadata].to_s ENV["_APPSIGNAL_STATSD_PORT"] = config_hash[:statsd_port].to_s if config_hash[:working_directory_path] ENV["_APPSIGNAL_WORKING_DIRECTORY_PATH"] = config_hash[:working_directory_path] end ENV["_APP_REVISION"] = config_hash[:revision].to_s end |
#yml_config_file? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
477 478 479 480 481 |
# File 'lib/appsignal/config.rb', line 477 def yml_config_file? return false unless config_file File.exist?(config_file) end |