Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoCloudHostTypeNotAvailable = fmt.Errorf("unable to retrieve host type, cloud harvester not available")
)
Functions ¶
This section is empty.
Types ¶
type AlibabaCloudData ¶
type AlibabaCloudData struct {
RegionAlibaba string `json:"region_id,omitempty"`
}
type AwsCloudData ¶
type AzureCloudData ¶
type CloudData ¶
type CloudData struct {
AwsCloudData `mapstructure:",squash"`
AzureCloudData `mapstructure:",squash"`
GoogleCloudData `mapstructure:",squash"`
AlibabaCloudData `mapstructure:",squash"`
}
type GoogleCloudData ¶
type GoogleCloudData struct {
RegionGCP string `json:"zone,omitempty"`
}
type HostInfo ¶
type HostInfo interface {
GetHostInfo() (HostInfoData, error)
GetCloudHostType() (string, error)
}
type HostInfoCommon ¶
func NewHostInfoCommon ¶
func NewHostInfoCommon(agentVersion string, enableCloudMonitoring bool, cloudHarvester cloud.Harvester) *HostInfoCommon
NewHostInfoCommon return a new HostInfoCommon structure that implements HostInfo.
func (*HostInfoCommon) GetCloudHostType ¶
func (h *HostInfoCommon) GetCloudHostType() (string, error)
GetCloudHostType returns the cloud host type if available, "unknown" if not.
func (*HostInfoCommon) GetHostInfo ¶
func (h *HostInfoCommon) GetHostInfo() (HostInfoData, error)
GetHostInfo returns the common host information data agnostic to the OS.
type HostInfoData ¶
type HostInfoData struct {
System string `json:"id"`
HostType string `json:"host_type"`
CpuName string `json:"cpu_name"`
// Number of cores within a single CPU ('cpu cores' field in /proc/cpuinfo)
// It is shown as 'coreCount' in New Relic UI
CpuNum string `json:"cpu_num"`
// Total number of cores in all the CPUs
// It is shown as 'processorCount' in New Relic UI
TotalCpu string `json:"total_cpu"`
Ram string `json:"ram"`
UpSince string `json:"boot_timestamp"`
AgentVersion string `json:"agent_version"`
AgentName string `json:"agent_name"`
OperatingSystem string `json:"operating_system"`
// cloud metadata
CloudData `mapstructure:",squash"`
}
Click to show internal directories.
Click to hide internal directories.