gitlab-org--gitlab-foss/config/boot.rb
Pawel Chojnacki ed5c7d11b1 Do not enable prometheus metrics when data folder is not present.
+ Set defaults correctly only for when not in production or staging
+ set ENV['prometheus_multiproc_dir'] in config/boot.rb instead of config.ru

Test prometheus metrics unmemoized
2017-06-19 18:52:23 +02:00

23 lines
753 B
Ruby

require 'rubygems'
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
# set default directory for multiproces metrics gathering
if ENV['RAILS_ENV'] == 'development' || ENV['RAILS_ENV'] == 'test'
ENV['prometheus_multiproc_dir'] ||= 'tmp/prometheus_multiproc_dir'
end
# Default Bootsnap configuration from https://github.com/Shopify/bootsnap#usage
require 'bootsnap'
Bootsnap.setup(
cache_dir: 'tmp/cache',
development_mode: ENV['RAILS_ENV'] == 'development',
load_path_cache: true,
autoload_paths_cache: true,
disable_trace: false,
compile_cache_iseq: true,
compile_cache_yaml: true
)