Module: Datadog::Core::Environment::Socket

Extended by:
Utils::Forking
Defined in:
lib/datadog/core/environment/socket.rb

Overview

For runtime identity

Class Method Summary collapse

Methods included from Utils::Forking

after_fork!, extended, fork_pid, forked?, included, update_fork_pid!

Class Method Details

.hostnameObject



15
16
17
18
19
20
# File 'lib/datadog/core/environment/socket.rb', line 15

def hostname
  # Check if runtime has changed, e.g. forked.
  after_fork! { @hostname = ::Socket.gethostname.freeze }

  @hostname ||= ::Socket.gethostname.freeze
end