Module: GovukStatsd

Extended by:
SingleForwardable
Defined in:
lib/govuk_app_config/govuk_statsd.rb

Class Method Summary collapse

Class Method Details

.clientObject



9
10
11
12
13
14
15
# File 'lib/govuk_app_config/govuk_statsd.rb', line 9

def self.client
  @client ||= begin
    statsd_client = ::Statsd.new(ENV["GOVUK_STATSD_HOST"] || "localhost", 8125, ENV["GOVUK_STATSD_PROTOCOL"]&.to_sym || :udp)
    statsd_client.namespace = ENV["GOVUK_STATSD_PREFIX"].to_s
    statsd_client
  end
end