Skip to main content

Configuration

eBPF Network Module Master Switch

Linux Host Installation

  1. Set network_enabled=true in /opt/tingyun-oneagent/conf/oneagent.conf.
  2. Restart UniAgent:
sudo systemctl restart tingyun-oneagent

Kubernetes Installation

Set network_enabled=true in oneagent.conf under tingyun-sys-config (default: false):

apiVersion: v1
kind: ConfigMap
metadata:
name: tingyun-sys-config
namespace: tingyun
data:
oneagent.conf: |
# APM master switch. This value is generated by the platform and cannot be modified.
apm_enabled=true
# Infrastructure Monitoring master switch. This value is generated by the platform and cannot be modified.
infra_enabled=true
#
# Process log collection switch for Infrastructure Monitoring. This value is generated by the platform and cannot be modified.
infra_log_enabled=false
#
# Master switch for eBPF network data collection.
# If you enable this switch, you also need to set the DaemonSet `tingyun-linux-agent` resource requests to CPU=0.5 and memory>=1Gi,
# and then restart the DaemonSet `tingyun-linux-agent`.
network_enabled=false # Set to true to enable

You also need to set the DaemonSet tingyun-linux-agent resource requests to CPU=0.5 and memory>=1Gi, and then restart the DaemonSet tingyun-linux-agent.

eBPF Network Module Circuit Breaker

How the Circuit Breaker Works

The circuit breaker strategy determines whether to trigger based on node CPU usage and available memory.

  • The default CPU threshold is 70% to 80%. When a node’s CPU usage exceeds 80%, the circuit breaker is triggered.
  • The default available memory threshold is 1 GB to 2 GB. When a node’s available memory is below 1 GB, the circuit breaker is triggered.
  • After a circuit breaker event, the network module will resume when CPU usage is below 70% and available memory is above 2 GB.

Note: When the circuit breaker is triggered, the eBPF network module process will exit. After recovery, the process will restart automatically.

Modifying Circuit Breaker Settings

Linux Host Installation

Edit /opt/tingyun-oneagent/conf/ebpf-network.conf:

# Switch to circuit breaker state when CPU usage is above the disable threshold or available memory is below the disable threshold.
# When in circuit breaker state, switch back to working state when CPU usage is below the enable threshold and available memory is above the enable threshold.
#
# CPU usage disable threshold (%)
cpu_usage.high=80
#
# CPU usage enable threshold (%)
cpu_usage.low=70
#
# Available memory disable threshold (B)
memory_available.low=1073741824
#
# Available memory enable threshold (B)
memory_available.high=2147483648

Then restart UniAgent:

sudo systemctl restart tingyun-oneagent

View circuit breaker logs:

cat /opt/tingyun-oneagent/logs/oneagent/watchdog.log

Sample output:

Disabling ebpf-network, cpu_usage 90%, memory_available 1073741824
Restarting ebpf-network, cpu_usage 60%, memory_available 4434245400

Kubernetes Installation

In tingyun-sys-config, edit ebpf-network.conf:

  ebpf-network.conf: |
# Switch to circuit breaker state when CPU usage is above the disable threshold or available memory is below the disable threshold.
# When in circuit breaker state, switch back to working state when CPU usage is below the enable threshold and available memory is above the enable threshold.
#
# CPU usage disable threshold (%)
cpu_usage.high=80
#
# CPU usage enable threshold (%)
cpu_usage.low=70
#
# Available memory disable threshold (B)
memory_available.low=1073741824
#
# Available memory enable threshold (B)
memory_available.high=2147483648

Then apply the YAML file:

kubectl apply -f tingyunagent.yaml    

If the tingyunagent.yaml installation file is lost, you can use kubectl edit configmap to modify the configuration:

kubectl edit configmap tingyun-sys-config -n tingyun

View circuit breaker logs:

kubectl -n tingyun exec -ti tingyun-linux-agent-vrtwk -- cat /opt/agent/logs/oneagent/watchdog.log

Sample output:

Disabling ebpf-network, cpu_usage 90%, memory_available 2434335434
Restarting ebpf-network, cpu_usage 60%, memory_available 4434245400

Log Level and Audit Mode

Configure log.level and log.audit in ebpf-network.conf:

#
# Option: log.filecount
# Description: Number of log files to retain
# Default: 10
# A restart is required after modification.
log.filecount=3
#
# Option: log.filesize
# Description: Maximum size of a single log file
# Default: 100
# Unit: MB
# A restart is required after modification.
log.filesize=100
#
# Option: log.level
# Description: Log level filter
# Supported values: debug, info, warning, error
# Default: info
# A restart is required after modification.
log.level=info
#
# Option: log.audit
# Description: Enable audit-mode logs
# Supported values: true, false
# Default: false
# A restart is required after modification.
log.audit=false

Viewing logs:

  • Linux host installation:
/opt/tingyun-oneagent/logs/agent/ebpf-network.log
  • Kubernetes installation:
/opt/agent/logs/agent/ebpf-network.log