diff --git a/Gemfile b/Gemfile index 51357d6..65f5f1a 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,11 @@ gem 'zk', '~> 1.9.3' gem 'unicorn', '~> 4.8.3' gem 'unicorn-worker-killer', '~> 0.4.4' gem 'hash-deep-merge', '~> 0.1.1' -gem 'newrelic_rpm', '~> 3.18.1', group: :newrelic gem 'oj', '~> 3.3.2' gem 'stomp', '~> 1.3.2' gem 'statsd-ruby', '~> 1.2.1' + +group :newrelic do + gem 'newrelic_rpm', '~> 3.18.1' + gem 'newrelic-zookeeper', '~> 1.0.0' +end diff --git a/config.ru b/config.ru index 8669198..59a0281 100644 --- a/config.ru +++ b/config.ru @@ -22,6 +22,13 @@ end require 'statsd-ruby' STATSD = Statsd.new(opts['statsd_host'], opts['statsd_port']) +begin + require 'newrelic_rpm' + require 'newrelic-zookeeper' +rescue LoadError + log.info "Newrelic not found, skipping..." +end + # prepare to exit cleanly $EXIT = false @@ -87,11 +94,5 @@ Optica.set :store, store Optica.set :events, events Optica.set :ip_check, ip_check -begin - require 'newrelic_rpm' -rescue LoadError - log.info "Newrelic not found, skipping..." -end - log.info "Starting sinatra server..." run Optica