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.
© 2023 SolarWinds Worldwide, LLC. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
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
func (*ID) InstanceID ¶
InstanceID returns a string of a version 4 UUID, generated on startup