Sha256: 38c33d2da711103249b08985960056c1e2f8c45acd56965a3eb9cd892be9b3b2
Contents?: true
Size: 658 Bytes
Versions: 20
Compression:
Stored size: 658 Bytes
Contents
require 'datadog/statsd' require 'singleton' module RooOnRails class Statsd include Singleton attr_reader :client def initialize @client = defined?(::STATSD) ? ::STATSD : ::Datadog::Statsd.new(host, port, tags: tags) end private def host ENV.fetch('STATSD_HOST', 'localhost') end def port ENV.fetch('STATSD_PORT', 8125) end def tags [ "env:#{ENV.fetch('STATSD_ENV', 'unknown')}", "source:#{ENV.fetch('DYNO', 'unknown')}", "app:#{ENV.fetch('HEROKU_APP_NAME', 'unknown')}" ] end end def self.statsd RooOnRails::Statsd.instance.client end end
Version data entries
20 entries across 20 versions & 1 rubygems