Service Discovery

Service discovery is used to discover all Kubernetes services process in the current node and report them to backend services. After the process upload is completed, the other modules could perform more operations with the process, such as process profiling and collecting process metrics.

Configuration

NameDefaultEnvironment KeyDescription
process_discovery.heartbeat_period20sROVER_PROCESS_DISCOVERY_HEARTBEAT_PERIODThe period of report or keep-alive process to the backend.
process_discovery.properties_report_period10ROVER_PROCESS_DISCOVERY_PROPERTIES_REPORT_PERIODThe agent sends the process properties to the backend every: heartbeart period * properties report period.
process_discovery.kubernetes.activefalseROVER_PROCESS_DISCOVERY_KUBERNETES_ACTIVEIs active the kubernetes process discovery.
process_discovery.kubernetes.node_nameROVER_PROCESS_DISCOVERY_KUBERNETES_NODE_NAMECurrent deployed node name, it could be inject by spec.nodeName.
process_discovery.kubernetes.namespacesROVER_PROCESS_DISCOVERY_KUBERNETES_NAMESPACESIncluding pod by namespaces, if empty means including all namespaces. Multiple namespaces split by “,”.
process_discovery.kubernetes.analyzersDeclare how to build the process. The istio and k8s resources are active by default.
process_discovery.kubernetes.analyzers.activeSet is active analyzer.
process_discovery.kubernetes.analyzers.filtersDefine which process is match to current process builder.
process_discovery.kubernetes.analyzers.service_nameThe Service Name of the process entity.
process_discovery.kubernetes.analyzers.instance_nameThe Service Instance Name of the process entity, by default, the instance name is the host IP v4 address from “en0” net interface.
process_discovery.kubernetes.analyzers.process_nameThe Process Name of the process entity, by default, the process name is the executable name of the process.
process_discovery.kubernetes.analyzers.labelsThe Process Labels, used to aggregate similar process from service entity. Multiple labels split by “,”.

Kubernetes Process Detector

The Kubernetes process detector could detect any process under the Kubernetes container. If active the Kubernetes process detector, the rover must be deployed in the Kubernetes cluster. After finding the process, it would collect the metadata of the process when the report to the backend.

Process Analyze

The process analysis declares which process could be profiled and how to build the process entity. The Istio and Kubernetes resources are active on default.

Filter

The filter provides an expression(go template) mechanism to match the process that can build the entity. Multiple expressions work together to determine whether the process can create the entity. Each expression must return the boolean value. Otherwise, the decision throws an error.

The context is similar to the entity builder. Using context could help the rover understand which process could build the entity.

Pod Context

Provide current pod information and judgments.

NameArgumentExampleDescription
NameNoneeq .Pod.Name "test-pod-name"The name of the current pod. The example shows the pod name is equal to test-pod-name.
NamespaceNoneeq .Pod.Namespace "test-namesapce"The name of the current pod namespace. The example shows the pod namespace name is equal to test-namespace.
NodeNoneeq .Pod.Node "test-node"The name of the node deployed. The example shows the pod node name is equal to test-node.
LabelValueKeyNameseq .Pod.LavelValue "a,b" "v"The label value of the label keys, If provide multiple keys, if any key has value, then don't need to get other values. The example shows the pod has anyone a or b label key, and the value matches to v.
ServiceNameNoneeq .Pod.ServiceName "test-service"The service name of the pod. The example shows current pods matched service name is test-service.
HasContainerContainer name.Pod.HasContainer "istio-proxy"The pod has the appointed container name.
LabelSelectorselector.Pod.LabelSelectorThe pod is matches the label selector. For more details, please read the official documentation.
HasServiceNameNone.Pod.HasServiceNameThe pod has the matched service.
HasOwnerNamekindNames.Pod.HasOwnerName "Service,Deployment"The pod has the matched owner name.
Container Context

Provide current container(under the pod) information.

NameArgumentExampleDescription
NameNoneeq .Container.Name "istio-proxy"The name of the current container under the pod. The examples show the container name is equal to istio-proxy.

Entity

The entity including layer, serviceName, instanceName, processName and labels properties.

The entity also could use expression to build(serviceName, instanceName and processName).

Rover

Rover context provides the context of the rover process instance and VM data.

NameArgumentExampleDescription
InstanceIDNone{{.Rover.InstanceID}}Get the Instance ID of the rover.
HostIPV4The Interface name{{.Rover.HostIPV4 "en0"}}Get the ipv4 address from the appointed network interface name.
HostIPV6The Interface name{{.Rover.HostIPV6 "en0"}}Get the ipv6 address from the appointed network interface name.
HostNameNone{{.Rover.HostName}}Get the host name of current machine.
Process

Process context provides the context relate to which process is matched.

NameArgumentExampleDescription
ExeFilePathNone{{.Process.ExeFilePath}}The execute file path of process.
ExeNameNone{{.Process.ExeName}}The execute file name.
CommandLineNone{{.Process.CommandLine}}The command line of process.
PidNone{{.Process.Pid}}The id of the process.
WorkDirNone{{.Process.WorkDir}}The work directory path of the process.
Pod

The information on the current pod.

NameArgumentExampleDescription
NameNone{{.Pod.Name}}The name of current pod.
NamespaceNone{{.Pod.Namespace}}The name of current pod namespace.
NodeNone{{.Pod.Node}}The name of the node deployed.
LabelValueKeyNames, Default{{.Pod.LabelValue "a,b" "v"}}The label value of the label keys, If provide multiple keys, if any key has value, then don‘t need to get other values. If all keys don’t have value, then return the default value.
ServiceNameNone{{.Pod.ServiceName}}The service name of the pod. If the pod hasn't matched service, then return an empty string.
FindContainerContainerName{{.Pod.FindContainer "test"}}Find the Container context by container name.
OwnerNameKindNames{{.Pod.OwnerName "Service,Deployment"}}Find the Owner name by owner kind name.
Container

The information of the current container under the pod.

NameArgumentExampleDescription
NameNone{{.Container.Name}} The name of the current container under the pod.
IDNone{{.Container.ID}}The id of the current container under the pod.
EnvValueKeyNames{{.Container.EnvValue "a,b"}}The environment value of the first non-value key in the provided candidates(Iterate from left to right).