Sha256: eab83b4a0b231a243eb2f87096ef52804866820bdfa3ed1d04504e1e10747882
Contents?: true
Size: 855 Bytes
Versions: 13
Compression:
Stored size: 855 Bytes
Contents
# encoding: utf-8 # This file is distributed under New Relic's license terms. # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details. module NewRelic module Agent module Hostname def self.get dyno_name = ENV['DYNO'] if dyno_name && ::NewRelic::Agent.config[:'heroku.use_dyno_names'] matching_prefix = heroku_dyno_name_prefix(dyno_name) dyno_name = "#{matching_prefix}.*" if matching_prefix dyno_name else Socket.gethostname end end def self.heroku_dyno_name_prefix(dyno_name) get_dyno_prefixes.find do |dyno_prefix| dyno_name.start_with?(dyno_prefix + ".") end end def self.get_dyno_prefixes ::NewRelic::Agent.config[:'heroku.dyno_name_prefixes_to_shorten'] end end end end
Version data entries
13 entries across 13 versions & 1 rubygems