You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
460 B

  1. # frozen_string_literal: true
  2. if ENV['STATSD_ADDR'].present?
  3. host, port = ENV['STATSD_ADDR'].split(':')
  4. statsd = ::Statsd.new(host, port)
  5. statsd.namespace = ENV.fetch('STATSD_NAMESPACE') { ['Mastodon', Rails.env].join('.') }
  6. ::NSA.inform_statsd(statsd) do |informant|
  7. informant.collect(:action_controller, :web)
  8. informant.collect(:active_record, :db)
  9. informant.collect(:cache, :cache)
  10. informant.collect(:sidekiq, :sidekiq)
  11. end
  12. end