Help us shape the future of Go! Take the 2026 Go Developer Survey

telemetry

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 17 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// NPMTelemetryFile Path.
	NPMTelemetryFile = platform.NPMRuntimePath + "AzureNPMTelemetry.json"
	// CNITelemetryFile Path.
	CNITelemetryFile = platform.CNIRuntimePath + "AzureCNITelemetry.json"

	ContentType = "application/json"
)
View Source
const (
	MB = 1048576
	KB = 1024
)

Variables

This section is empty.

Functions

func ReadFileByLines added in v1.0.0

func ReadFileByLines(filename string) ([]string, error)

ReadFileByLines reads file line by line and return array of lines.

Types

type BridgeInfo

type BridgeInfo struct {
	NetworkMode  string
	BridgeName   string
	ErrorMessage string
}

CNI Bridge Details structure.

type CNIReport

type CNIReport struct {
	IsNewInstance       bool
	CniSucceeded        bool
	Name                string
	OSVersion           string
	ErrorMessage        string
	Context             string
	SubContext          string
	VnetAddressSpace    []string
	OrchestratorDetails *OrchestratorInfo
	OSDetails           *OSInfo
	SystemDetails       *SystemInfo
	InterfaceDetails    *InterfaceInfo
	BridgeDetails       *BridgeInfo
	Metadata            Metadata `json:"compute"`
}

Azure CNI Telemetry Report structure.

func (*CNIReport) GetInterfaceDetails added in v1.0.9

func (report *CNIReport) GetInterfaceDetails(queryUrl string)

GetInterfaceDetails creates a report with interface details(ip, mac, name, secondaryca count).

func (*CNIReport) GetOSDetails

func (report *CNIReport) GetOSDetails()

This function creates a report with os details(ostype, version).

func (*CNIReport) GetOrchestratorDetails added in v1.0.9

func (report *CNIReport) GetOrchestratorDetails()

GetOrchestratorDetails creates a report with orchestrator details(name, version).

func (*CNIReport) GetReport

func (report *CNIReport) GetReport(name string, version string, ipamQueryURL string)

GetReport retrieves orchestrator, system, OS and Interface details and create a report structure.

func (*CNIReport) GetSystemDetails

func (report *CNIReport) GetSystemDetails()

This function creates a report with system details(memory, disk, cpu).

type ClusterState added in v1.0.9

type ClusterState struct {
	PodCount      int
	NsCount       int
	NwPolicyCount int
}

ClusterState contains the current kubernetes cluster state.

type DiskInfo

type DiskInfo struct {
	DiskTotal uint64
	DiskFree  uint64
}

Disk Info structure.

type InterfaceInfo

type InterfaceInfo struct {
	InterfaceType         string
	Subnet                string
	PrimaryCA             string
	MAC                   string
	Name                  string
	SecondaryCATotalCount int
	SecondaryCAUsedCount  int
	ErrorMessage          string
}

Interface Details structure.

type MemInfo

type MemInfo struct {
	MemTotal uint64
	MemFree  uint64
}

Memory Info structure.

type Metadata added in v1.0.12

type Metadata struct {
	Location             string `json:"location"`
	VMName               string `json:"name"`
	Offer                string `json:"offer"`
	OsType               string `json:"osType"`
	PlacementGroupID     string `json:"placementGroupId"`
	PlatformFaultDomain  string `json:"platformFaultDomain"`
	PlatformUpdateDomain string `json:"platformUpdateDomain"`
	Publisher            string `json:"publisher"`
	ResourceGroupName    string `json:"resourceGroupName"`
	Sku                  string `json:"sku"`
	SubscriptionID       string `json:"subscriptionId"`
	Tags                 string `json:"tags"`
	OSVersion            string `json:"version"`
	VMID                 string `json:"vmId"`
	VMSize               string `json:"vmSize"`
	KernelVersion        string
}

Metadata retrieved from wireserver

type NPMReport added in v1.0.9

type NPMReport struct {
	IsNewInstance     bool
	ClusterID         string
	NodeName          string
	InstanceName      string
	NpmVersion        string
	KubernetesVersion string
	ErrorMessage      string
	EventMessage      string
	UpTime            string
	ClusterState      ClusterState
	Metadata          Metadata `json:"compute"`
}

NPMReport structure.

func (*NPMReport) GetReport added in v1.0.12

func (report *NPMReport) GetReport(clusterID, nodeName, npmVersion, kubernetesVersion string, clusterState ClusterState)

GetReport retrives npm and kubernetes cluster related info and create a report structure.

type OSInfo

type OSInfo struct {
	OSType         string
	OSVersion      string
	KernelVersion  string
	OSDistribution string
	ErrorMessage   string
}

OS Details structure.

type OrchestratorInfo added in v1.0.1

type OrchestratorInfo struct {
	OrchestratorName    string
	OrchestratorVersion string
	ErrorMessage        string
}

Orchestrator Details structure.

type ReportManager

type ReportManager struct {
	HostNetAgentURL string
	ContentType     string
	Report          interface{}
}

ReportManager structure.

func (*ReportManager) GetHostMetadata added in v1.0.12

func (reportMgr *ReportManager) GetHostMetadata() error

GetHostMetadata - retrieve metadata from host

func (*ReportManager) GetKernelVersion added in v1.0.12

func (reportMgr *ReportManager) GetKernelVersion()

Get kernel version

func (*ReportManager) GetReportState added in v1.0.12

func (reportMgr *ReportManager) GetReportState(telemetryFile string) bool

GetReportState will check if report is sent at least once by checking telemetry file.

func (*ReportManager) SendReport

func (reportMgr *ReportManager) SendReport() error

SendReport will send telemetry report to HostNetAgent.

func (*ReportManager) SetReportState added in v1.0.12

func (reportMgr *ReportManager) SetReportState(telemetryFile string) error

SetReportState will save the state in file if telemetry report sent successfully.

type SystemInfo

type SystemInfo struct {
	MemVMTotal       uint64
	MemVMFree        uint64
	MemUsedByProcess uint64
	DiskVMTotal      uint64
	DiskVMFree       uint64
	CPUCount         int
	ErrorMessage     string
}

System Details structure.

Jump to

Keyboard shortcuts

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