Documentation ¶
Index ¶
- func GetJsonFromUrl(url string, bearerToken string, caCert []byte, allowInsecure bool, ...) (string, error)
- func GetK8SApiUrlFromEnv() (string, error)
- func GetK8SLatestVersion(logger golog.MyLogger) (string, error)
- func GetK8sInfo(l golog.MyLogger) (string, string, string)
- func GetOsUptime() (string, error)
- type K8sInfo
- type OsInfo
- type RuntimeInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetJsonFromUrl ¶
func GetK8SApiUrlFromEnv ¶ added in v0.2.1
GetK8SApiUrlFromEnv returns the k8s api url based on the content of standard env var :
KUBERNETES_SERVICE_HOST KUBERNETES_SERVICE_PORT in case the above ENV variables doesn't exist the function returns an empty string and an error
func GetK8SLatestVersion ¶ added in v0.2.1
func GetOsUptime ¶
Types ¶
type K8sInfo ¶
type OsInfo ¶
type RuntimeInfo ¶
type RuntimeInfo struct { Hostname string `json:"hostname"` // host name reported by the kernel. Pid int `json:"pid"` // process id of the caller. PPid int `json:"ppid"` // process id of the caller's parent. Uid int `json:"uid"` // numeric user id of the caller. Appname string `json:"appname"` // name of this application Version string `json:"version"` // version of this application ParamName string `json:"param_name"` // value of the name parameter (_NO_PARAMETER_NAME_ if name was not set) RemoteAddr string `json:"remote_addr"` // remote client ip address RequestId string `json:"request_id"` // globally unique request id GOOS string `json:"goos"` // operating system GOARCH string `json:"goarch"` // architecture Runtime string `json:"runtime"` // go runtime at compilation time NumGoroutine string `json:"num_goroutine"` // number of go routines OsReleaseName string `json:"os_release_name"` // Linux release UserName or _UNKNOWN_ OsReleaseVersion string `json:"os_release_version"` // Linux release Version or _UNKNOWN_ OsReleaseVersionId string `json:"os_release_version_id"` // Linux release VersionId or _UNKNOWN_ NumCPU string `json:"num_cpu"` // number of cpu Uptime string `json:"uptime"` // tells how long this service was started based on an internal variable UptimeOs string `json:"uptime_os"` // tells how long system was started based on /proc/uptime K8sApiUrl string `json:"k8s_api_url"` // url for k8s api based KUBERNETES_SERVICE_HOST K8sVersion string `json:"k8s_version"` // version of k8s cluster K8sLatestVersion string `json:"k8s_latest_version"` // latest version announced in https://kubernetes.io/ K8sCurrentNamespace string `json:"k8s_current_namespace"` // k8s namespace of this container EnvVars []string `json:"env_vars"` // environment variables Headers map[string][]string `json:"headers"` // received headers }
func CollectRuntimeInfo ¶
func CollectRuntimeInfo(appName, version string, l golog.MyLogger) RuntimeInfo
Click to show internal directories.
Click to hide internal directories.