]> cat aescling's git repositories - mastodon.git/commitdiff
Allow specifying STATSD_NAMESPACE (#5700)
authorEugen Rochko <eugen@zeonfederated.com>
Tue, 14 Nov 2017 22:22:43 +0000 (23:22 +0100)
committerYamagishi Kazutoshi <ykzts@desire.sh>
Tue, 14 Nov 2017 22:22:43 +0000 (07:22 +0900)
config/initializers/statsd.rb

index 17a17617424973adfda757e78bcb87a69ebe89ae..45702ac94de671b14563ce1de24ee2646832a66f 100644 (file)
@@ -4,7 +4,7 @@ if ENV['STATSD_ADDR'].present?
   host, port = ENV['STATSD_ADDR'].split(':')
 
   statsd = ::Statsd.new(host, port)
-  statsd.namespace = ['Mastodon', Rails.env].join('.')
+  statsd.namespace = ENV.fetch('STATSD_NAMESPACE') { ['Mastodon', Rails.env].join('.') }
 
   ::NSA.inform_statsd(statsd) do |informant|
     informant.collect(:action_controller, :web)