Documentation ¶
Overview ¶
Package host has all the functions to get host metadata needed by traces and metrics. It also maintains an update-to-date global HostID object, which is refreshed periodically.
Index ¶
- Constants
- func ConfiguredHostname() string
- func Distro() string
- func FilteredIfaces() ([]net.Interface, error)
- func GC(stats *debug.GCStats)
- func Hostname() string
- func IPAddresses() []string
- func IsPhysicalInterface(ifname string) bool
- func Mem(m *runtime.MemStats)
- func PID() int
- func Start()
- func Stop()
- type ID
- type IDSetter
Constants ¶
const ( REDHAT = "/etc/redhat-release" AMAZON = "/etc/system-release" UBUNTU = "/etc/lsb-release" DEBIAN = "/etc/debian_version" SUSE = "/etc/os-release" SUSE_OLD = "/etc/SuSE-release" SLACKWARE = "/etc/slackware-version" GENTOO = "/etc/gentoo-release" OTHER = "/etc/issue" )
Variables ¶
This section is empty.
Functions ¶
func ConfiguredHostname ¶
func ConfiguredHostname() string
ConfiguredHostname returns the hostname configured by user
func FilteredIfaces ¶
FilteredIfaces returns a list of Interface which contains only interfaces required. See https://swicloud.atlassian.net/browse/AO-9021
func IsPhysicalInterface ¶
IsPhysicalInterface returns true if the specified interface name is physical
func Mem ¶
Mem returns the current memory statistics. Don't call this function too often as it stops the world while gathering the information.
Types ¶
type ID ¶
type ID struct {
// contains filtered or unexported fields
}
ID defines the minimum set of host metadata that identifies a host
func BestEffortCurrentID ¶
func BestEffortCurrentID() ID
BestEffortCurrentID returns the current host ID with the best effort. It doesn't wait until the ID is ready. This function is used mainly by getSettings where the ID may not be fully initialized immediately after starting up but it's acceptable.
func (ID) AzureAppInstId ¶
AzureAppInstId returns the Azure's web application instance ID
func (ID) ContainerId ¶
ContainerId returns the containerId field of ID