common

package
v1.67.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

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 AwsCloudData struct {
	RegionAWS           string `json:"aws_region,omitempty"`
	AWSAccountID        string `json:"aws_account_id,omitempty"`
	AWSAvailabilityZone string `json:"aws_availability_zone,omitempty"`
	AWSImageID          string `json:"aws_image_id,omitempty"`
}

type AzureCloudData

type AzureCloudData struct {
	RegionAzure           string `json:"region_name,omitempty"`
	AzureSubscriptionID   string `json:"azure_subscription_id,omitempty"`
	AzureAvailabilityZone string `json:"azure_availability_zone,omitempty"`
}

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

type HostInfoCommon struct {
	cloud.Harvester
	// contains filtered or unexported fields
}

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL