The tracer-node
module provides the main container-tracer functionality for container tracing.
It has the following main components:
- A REST API, used to interact with the tracer on that node. Look at REST API for the API description.
- Logic for auto-discovery of all pods running on the node. Two different approaches are used
for this auto-discovery:
- Using the CRI API. This is the preferred approach, when container-tracer runs in a Kubernetes context.
- Using the information from the
/proc
file system on the host. If the CRI API is not available, this logic is used.
- An in-memory database with all pods and containers running on the node. For each container, a list of PIDs is stored into the database, as seen in the host PID namespace.
- A list of trace-hooks, available in the
tracer-node
. - An in-memory database with configured trace sessions. A trace session is a set of containers, trace hook and trace parameters that has a state - running or stopped. When running, the trace hook is attached to the specified containers.
- Open Telemetry trace exporters, used to export the output of running trace sessions to an external database.
On startup, tracer-node
checks for specific environment variables and accepts these input arguments:
--address
orTRACER_API_ADDRESS
: IP address and port in format IP:port, used to listen for incoming REST API requests. By default:8080
is used.--node-name
orTRACER_NODE_NAME
: The name of the node, that runs thistracer-node
instance. Used for logging purposes and is included in the traces collected on this node. There is no default value.--pod-name
orTRACER_POD_NAME
: The name of thistracer-node
pod, used to verify the correct CRI endpoint.--cri-endpoint
orTRACER_CRI_ENDPOINT
: A specific CRI endpoint that must be used for CRI API. There is no default value, if it is not set - an auto discovery logic is used.--run-path
orTRACER_RUN_PATHS
: The path to the run directories of the host, to search for cri endpoints. By default/run
and/var/run
are used, but usually when running in a container, the host run paths are mounted on custom locations. These are used to auto discover the endpoint of the CRI API, if no specific CRI endpoint is specified.--procfs-path
orTRACER_PROCFS_PATH
: The path to the host/proc
file system mount point. By default it is/proc
, but usually when running in a container the host/proc
is mounted on a custom location.--sysfs-path
orTRACER_SYSFS_PATH
: The path to the host/sys
file system mount point. By default it is/sys
, but usually when running in a container, the host/sys
is mounted on a custom location.--use-procfs
orTRACER_FORCE_PROCFS
: Force the use of/proc
of the host for auto-discovery of the containers, running on the local node. Not set by default. The default logic is using the CRI API if it is available. If the CRI API is not accessible, fail back to the logic that gets this information from the/proc
file system.--jaeger-endpoint
orTRACER_JEAGER_ENDPOINT
: The URL of the jaeger endpoint service, used to send the collected traces. Can be set toauto
, which triggers the default logic - search forjaeger-collector
service that exposes port14268
and usehttp://jaeger-collector:14268/api/traces
as an endpoint to jaeger.--verbose
orTRACE_KUBE_VERBOSE
: Dump more detailed logs, disabled by default.
If both input argument and environment variable for a same setting exist, only the input argument is taken.