Documentation ¶
Overview ¶
Package hostid contains methods that can be called upon agent start up to determine host-specific values that uniquely identify a particular host, particularly ids that can be used to correlate metrics coming from this host to other metrics generated elsewhere, such as AWS CloudWatch metrics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AWSUniqueID ¶
func AWSUniqueID() string
AWSUniqueID constructs the unique EC2 instance of the underlying host. If not running on EC2, returns the empty string.
func AzureUniqueID ¶
func AzureUniqueID() string
AzureUniqueID constructs the unique ID of the underlying Azure VM. If not running on Azure VM, returns the empty string.
func Dimensions ¶
Dimensions returns a map of host-specific dimensions that are derived from the environment.
func GoogleComputeID ¶
func GoogleComputeID() string
GoogleComputeID generates a unique id for the compute instance that the agent is running on. It returns a blank string if we are not running on GCP or there was an error getting the metadata.
func KubernetesNodeName ¶
func KubernetesNodeName() string
KubernetesNodeName returns the name of the current K8s node name, if running on K8s and if the appropriate envvar (MY_NODE_NAME) has been injected in the agent pod by the downward API mechanism.
func MachineID ¶
func MachineID() string
MachineID returns the Linux machine-id, which is present on most newer Linux distros. It is more useful than hostname as a unique identifier. See http://man7.org/linux/man-pages/man5/machine-id.5.html
Types ¶
This section is empty.