Agent
#1. 全局配置
#1.1 资源限制
控制 deepflow-agent 资源用量
#1.1.1 CPU 限制
标签:
hot_update
FQCN:
global.limits.max_millicpus
Upgrade from old version: max_millicpus
默认值:
global:
limits:
max_millicpus: 1000
2
3
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | Logical Milli Cores |
| Range | [1, 100000] |
详细描述:
deepflow-agent 使用 cgroups 来限制自身的 CPU 用量, 1 millicpu = 1 millicore = 0.001 core。
#1.1.2 内存限制
标签:
agent_restart
FQCN:
global.limits.max_memory
Upgrade from old version: max_memory
默认值:
global:
limits:
max_memory: 768
2
3
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | MiB |
| Range | [128, 100000] |
详细描述:
deepflow-agent 使用 cgroups 限制自身的 memory 用量。
注意:
- 专属采集器内存不受限制
- 容器采集器内存限制由容器管理工具来实现
- 同集群的容器采集器内存限制需要一致
#1.1.3 日志每小时回传上限
标签:
hot_update
FQCN:
global.limits.max_log_backhaul_rate
Upgrade from old version: log_threshold
默认值:
global:
limits:
max_log_backhaul_rate: 36000
2
3
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | Lines/Hour |
| Range | [0, 1000000] |
详细描述:
用于 deepflow-agent 控制自身运行日志的每小时回传数量,设置为 0 表示不设限制。
#1.1.4 本地日志文件大小上限
标签:
hot_update
FQCN:
global.limits.max_local_log_file_size
Upgrade from old version: log_file_size
默认值:
global:
limits:
max_local_log_file_size: 1000
2
3
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | MiB |
| Range | [10, 10000] |
详细描述:
用于 deepflow-agent 控制自身运行日志在本地的存储量。
#1.1.5 本地日志留存时间
标签:
hot_update
FQCN:
global.limits.local_log_retention
Upgrade from old version: log_retention
默认值:
global:
limits:
local_log_retention: 300d
2
3
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['10d', '10000d'] |
详细描述:
用于 deepflow-agent 控制自身运行日志在本地的留存时长。
#1.1.6 Socket 数量上限
标签:
hot_update
FQCN:
global.limits.max_sockets
Upgrade from old version: static_config.max-sockets
默认值:
global:
limits:
max_sockets: 1024
2
3
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | count |
| Range | [16, 4096] |
详细描述:
用于控制 deepflow-agent 可以打开的 socket 数量上限。 超过限制时 agent 会重启。
#1.1.7 Socket 数量超限容忍时间
标签:
hot_update
FQCN:
global.limits.max_sockets_tolerate_interval
Upgrade from old version: static_config.max-sockets-tolerate-interval
默认值:
global:
limits:
max_sockets_tolerate_interval: 60s
2
3
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['0s', '3600s'] |
详细描述:
用于控制 deepflow-agent 在 socket 数量超过上限后,重启前的容忍时间。 只有当 socket 数量持续超过上限达到该时间后才会触发重启。 重启由 guard 模块触发,因此该值小于 guard-interval 时会导致立即重启。
#1.2 告警
#1.2.1 线程数限制
标签:
hot_update
FQCN:
global.alerts.thread_threshold
Upgrade from old version: thread_threshold
默认值:
global:
alerts:
thread_threshold: 500
2
3
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [1, 1000] |
详细描述:
用于控制 deepflow-agent 创建的线程数量。
- 当线程数量超过该限制值,会触发采集器异常告警。
- 当线程数量超过该限制值的2倍,会触发采集器重启。
#1.2.2 进程数限制
标签:
hot_update
FQCN:
global.alerts.process_threshold
Upgrade from old version: process_threshold
默认值:
global:
alerts:
process_threshold: 10
2
3
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [1, 100] |
详细描述:
用于控制名称为deepflow-agent的进程数量。
若当前系统中名为deepflow-agent的进程数达到该限制值,则之后名为deepflow-agent的进程将会启动失败。
#1.2.3 Core File 检查
标签:
agent_restart deprecated
FQCN:
global.alerts.check_core_file_disabled
Upgrade from old version: static_config.check-core-file-disabled
默认值:
global:
alerts:
check_core_file_disabled: false
2
3
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
当主机存在无效的 NFS 文件系统,或者 Docker 正在运行时, 检查 core 文件时可能会导致程序挂起。 因此,core 文件检查提供了一个开关,以防止进程挂起。参考链接:
- https://serverfault.com/questions/367438/ls-hangs-for-a-certain-directory (opens new window)
- https://unix.stackexchange.com/questions/495854/processes-hanging-when-trying-to-access-a-file (opens new window)
#1.3 熔断机制
控制 deepflow-agent 在一定的环境条件下停止运行或停止部分功能。
#1.3.1 系统空闲内存百分比
计算公式:(free_memory / total_memory) * 100%
#1.3.1.1 触发阈值
标签:
hot_update
FQCN:
global.circuit_breakers.sys_memory_percentage.trigger_threshold
Upgrade from old version: sys_free_memory_limit
默认值:
global:
circuit_breakers:
sys_memory_percentage:
trigger_threshold: 0
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | % |
| Range | [0, 100] |
详细描述:
设置为 0 表示不检查系统内存比率。
观测内存比率是由 global.circuit_breakers.sys_memory_percentage.metric 决定.
- 当系统
观测内存比率低于trigger_threshold* 70% 时, 采集器将自动重启。 - 当系统
观测内存比率低于trigger_threshold但高于 70% 时, 采集器设置为FREE_MEM_EXCEEDED的异常状态,并上报采集器异常告警。 - 当系统
观测内存比率持续高于trigger_threshold* 110% 时, 采集器将从异常状态恢复。
#1.3.1.2 观测指标
标签:
hot_update
FQCN:
global.circuit_breakers.sys_memory_percentage.metric
Upgrade from old version: sys_free_memory_metric
默认值:
global:
circuit_breakers:
sys_memory_percentage:
metric: free
2
3
4
枚举可选值:
| Value | Note |
|---|---|
| free | |
| available |
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
deepflow-agent 观测该内存指标的百分比
#1.3.2 相对系统负载
计算公式: system_load / total_cpu_cores
#1.3.2.1 触发阈值
标签:
hot_update
FQCN:
global.circuit_breakers.relative_sys_load.trigger_threshold
Upgrade from old version: system_load_circuit_breaker_threshold
默认值:
global:
circuit_breakers:
relative_sys_load:
trigger_threshold: 1.0
2
3
4
模式:
| Key | Value |
|---|---|
| Type | float |
| Range | [0, 10] |
详细描述:
当相对系统负载(load 除以 CPU 核数)高于此阈值时,采集器自动停止运行。
设置该值或 recovery_threshold 为 0 时,该特性不生效。
#1.3.2.2 恢复阈值
标签:
hot_update
FQCN:
global.circuit_breakers.relative_sys_load.recovery_threshold
Upgrade from old version: system_load_circuit_breaker_recover
默认值:
global:
circuit_breakers:
relative_sys_load:
recovery_threshold: 0.9
2
3
4
模式:
| Key | Value |
|---|---|
| Type | float |
| Range | [0, 10] |
详细描述:
在采集器处于停止状态后,当相对系统负载(load 除以 CPU 核数)连续 5 分钟低于此阈值时,
采集器自动从停止状态恢复运行。
设置该值或 trigger_threshold 为 0 时,该特性不生效。
#1.3.2.3 观测指标
标签:
hot_update
FQCN:
global.circuit_breakers.relative_sys_load.metric
Upgrade from old version: system_load_circuit_breaker_metric
默认值:
global:
circuit_breakers:
relative_sys_load:
metric: load15
2
3
4
枚举可选值:
| Value | Note |
|---|---|
| load1 | |
| load5 | |
| load15 |
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
deepflow-agent 默认每 10 秒监控一次所设定的系统负载指标项。
#1.3.3 空闲磁盘
#1.3.3.1 百分比触发阈值
标签:
hot_update
FQCN:
global.circuit_breakers.free_disk.percentage_trigger_threshold
默认值:
global:
circuit_breakers:
free_disk:
percentage_trigger_threshold: 15
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | % |
| Range | [0, 100] |
详细描述:
仅当采集器运行在非容器环境中时该配置有效。配置为 0 表示禁用该阈值。
观测磁盘为global.circuit_breakers.free_disk.directories目录所在磁盘。
- 当系统
空闲磁盘比率低于该阈值时,采集器进入熔断禁用状态, 并设置磁盘空闲空间触发熔断异常状态,同时上报采集器异常告警。 - 当系统
空闲磁盘比率高于该阈值 * 110%时,采集器从异常状态恢复。
#1.3.3.2 绝对值触发阈值
标签:
hot_update
FQCN:
global.circuit_breakers.free_disk.absolute_trigger_threshold
默认值:
global:
circuit_breakers:
free_disk:
absolute_trigger_threshold: 10
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | GB |
| Range | [0, 100000] |
详细描述:
仅当采集器运行在非容器环境中时该配置有效。配置为 0 表示禁用该阈值。
观测磁盘为global.circuit_breakers.free_disk.directories目录所在磁盘。
- 当系统
空闲磁盘大小低于该阈值时,采集器进入熔断禁用状态, 并设置磁盘空闲空间触发熔断异常状态,同时上报采集器异常告警。 - 当系统
空闲磁盘大小高于该阈值 * 110%时,采集器从异常状态恢复。
#1.3.3.3 观测目录
标签:
hot_update
FQCN:
global.circuit_breakers.free_disk.directories
默认值:
global:
circuit_breakers:
free_disk:
directories:
- /
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
观测目录所在磁盘的空间。
对于windows操作系统,默认值则是c:\
#1.4 调优
对 deepflow-agent 的运行进行调优。
#1.4.1 CPU 亲和性
标签:
agent_restart
FQCN:
global.tunning.cpu_affinity
Upgrade from old version: static_config.cpu-affinity
默认值:
global:
tunning:
cpu_affinity: []
2
3
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [0, 65536] |
详细描述:
操作系统尽可能使用指定 ID 的 CPU 核运行 deepflow-agent 进程。无效的 ID 将被忽略。该配置 会作用于已存在的 deepflow-agent 线程,但 self-managed 的 kick-kern.* eBPF 线程除外。举例:
global:
tunning:
cpu_affinity: [1, 3, 5, 7, 9]
2
3
#1.4.2 进程调度优先级
标签:
hot_update
FQCN:
global.tunning.process_scheduling_priority
Upgrade from old version: static_config.process-scheduling-priority
默认值:
global:
tunning:
process_scheduling_priority: 0
2
3
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [-20, 19] |
详细描述:
控制 deepflow-agent 进程的调度优先级。数值越小,调度优先级越高;数值越大,调度优先级越低。
#1.4.3 闲置内存修剪
标签:
hot_update
FQCN:
global.tunning.idle_memory_trimming
Upgrade from old version: static_config.memory-trim-disabled
默认值:
global:
tunning:
idle_memory_trimming: true
2
3
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
开启闲置内存修剪特性,将降低 agent 内存使用量,但可能会损失 agent 处理性能。
#1.4.4 禁用 swap 内存
标签:
agent_restart
FQCN:
global.tunning.swap_disabled
默认值:
global:
tunning:
swap_disabled: false
2
3
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
注意禁用 swap 内存需要 root 和 CAP_IPC_LOCK 权限,禁用 swap 内存后性能也许会提升并且CPU使用率会降低, 但是内存会升高。
#1.4.5 Page Cache 回收百分比
标签:
hot_update
FQCN:
global.tunning.page_cache_reclaim_percentage
Upgrade from old version: static_config.page-cache-reclaim-percentage
默认值:
global:
tunning:
page_cache_reclaim_percentage: 100
2
3
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [0, 100] |
详细描述:
当文件页缓存和 cgroup 内存限制的百分比超过此阈值时,agent 将清空文件页缓存。 Cgroup 的内存使用量包括匿名内存和文件页缓存。在某些情况下,仅仅是文件页缓存就可能导致 cgroup 因为内存不足杀死 agent 进程。为了避免这种情况,agent 将定期强制清空文件页缓存, 且由于 agent 的文件 I/O 量不大,这不太可能对 agent 的性能造成影响,但同一 cgroup 下的其他 进程可能会受到影响。不建议设置很小的值。 注意:
- 该特性仅支持 cgroups v1。
- 如果 agent 的 memory cgroup 路径是 “/”,该特性不生效。
- 回收的最小间隔是 1 分钟。
#1.4.6 资源监控间隔
标签:
hot_update
FQCN:
global.tunning.resource_monitoring_interval
Upgrade from old version: static_config.guard-interval
默认值:
global:
tunning:
resource_monitoring_interval: 10s
2
3
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['1s', '3600s'] |
详细描述:
deepflow-agent 将以配置的时间周期监控如下资源:
- 系统空闲内存
- 系统负载
- agent 的线程数量(通过读取 /proc 目录下的文件信息获取)
- agent 的日志数量和日志大小
- agent 的内存用量
#1.5 NTP 时钟同步
此同步机制获取的时间仅供 deepflow-agent 进程内部使用,不影响主机时间。
#1.5.1 Enabled
标签:
hot_update
FQCN:
global.ntp.enabled
Upgrade from old version: ntp_enabled
默认值:
global:
ntp:
enabled: false
2
3
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
deepflow-agent 是否向 deepflow-server 做 NTP 同步的开关。
注意:开启 NTP 前控制器需要先开启 NTP 服务,直到完成同步时间后采集器才会继续运行。
#1.5.2 最大时钟偏差
标签:
agent_restart
FQCN:
global.ntp.max_drift
Upgrade from old version: static_config.ntp-max-interval
默认值:
global:
ntp:
max_drift: 300s
2
3
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['0ns', '365d'] |
详细描述:
当 deepflow-agent 与 deepflow-server 之间的时间偏移大于此设置值时,agent 会自动重启。
#1.5.3 最小时钟偏差
标签:
agent_restart
FQCN:
global.ntp.min_drift
Upgrade from old version: static_config.ntp-min-interval
默认值:
global:
ntp:
min_drift: 10s
2
3
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['0ns', '365d'] |
详细描述:
当 deepflow-agent 与 deepflow-server 之间的时间偏移大于此设置值时,对 agent 的 时间戳进行纠正。
#1.6 通信
配置 deepflow-agent 的通信参数。
#1.6.1 主动请求间隔
标签:
hot_update
FQCN:
global.communication.proactive_request_interval
Upgrade from old version: sync_interval
默认值:
global:
communication:
proactive_request_interval: 60s
2
3
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['10s', '3600s'] |
详细描述:
deepflow-agent 以设置的时间间隔周期性向 deepflow-server 请求配置数据和标签信息。
#1.6.2 最大逃逸时长
标签:
hot_update
FQCN:
global.communication.max_escape_duration
Upgrade from old version: max_escape_seconds
默认值:
global:
communication:
max_escape_duration: 3600s
2
3
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['600s', '30d'] |
详细描述:
最大逃逸时长是指 deepflow-agent 与 deepflow-server 失联后,自主运行的最长
时间;超过该时长后,仍未与 server 恢复联系,agent 自动进入 disabled 状态。
#1.6.3 Controller IP 地址
标签:
hot_update
FQCN:
global.communication.proxy_controller_ip
Upgrade from old version: proxy_controller_ip
默认值:
global:
communication:
proxy_controller_ip: 127.0.0.1
2
3
模式:
| Key | Value |
|---|---|
| Type | ip |
详细描述:
用于设置 deepflow-agent 与 server 通信的控制面通信 IP;如果不设置本 参数,server 下发自己的节点 IP 作为 server 端控制面通信IP。 该参数通常用于 server 端使用负载均衡或虚 IP 对外提供服务的场景。
#1.6.4 Controller 端口号
标签:
hot_update
FQCN:
global.communication.proxy_controller_port
Upgrade from old version: proxy_controller_port
默认值:
global:
communication:
proxy_controller_port: 30035
2
3
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [1, 65535] |
详细描述:
用于设置 deepflow-server 向 deepflow-agent 下发的 server 端控制面通信端口。
#1.6.5 Ingester IP 地址
标签:
hot_update
FQCN:
global.communication.ingester_ip
Upgrade from old version: analyzer_ip
默认值:
global:
communication:
ingester_ip: ''
2
3
模式:
| Key | Value |
|---|---|
| Type | ip |
详细描述:
用于设置 deepflow-server 向 deepflow-agent 下发的 server 端数据面通信 IP。
#1.6.6 Ingester 端口号
标签:
hot_update
FQCN:
global.communication.ingester_port
Upgrade from old version: analyzer_port
默认值:
global:
communication:
ingester_port: 30033
2
3
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [1, 65535] |
详细描述:
用于设置 deepflow-server 向 deepflow-agent 下发的 server 端数据面通信端口。
#1.6.7 gRPC Socket 缓冲区大小
标签:
hot_update deprecated
FQCN:
global.communication.grpc_buffer_size
Upgrade from old version: static_config.grpc-buffer-size
默认值:
global:
communication:
grpc_buffer_size: 5
2
3
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | MiB |
| Range | [5, 1024] |
详细描述:
设置 deepflow-agent 的 gRPC socket 缓冲区大小。
#1.6.8 发送到 Ingester 的最大流量
标签:
hot_update
FQCN:
global.communication.max_throughput_to_ingester
默认值:
global:
communication:
max_throughput_to_ingester: 100
2
3
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | Mbps |
| Range | [0, 10000] |
详细描述:
向 Server 端 Ingester 模块发送可观测性数据的最大允许流量,
超限行为参考 ingester_traffic_overflow_action 配置描述。
配置为 0 表示不限速。
#1.6.9 Ingester 流量超限的动作
标签:
hot_update
FQCN:
global.communication.ingester_traffic_overflow_action
默认值:
global:
communication:
ingester_traffic_overflow_action: WAIT
2
3
枚举可选值:
| Value | Note |
|---|---|
| WAIT | |
| DROP |
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
Ingester 流量超限的动作
- WAIT:暂停发送,数据缓存到队列,等待下次发送。
- DROP:直接丢弃数据,并触发 Agent
数据流量达到限速异常。
#1.6.10 请求 NAT IP 地址
标签:
hot_update
FQCN:
global.communication.request_via_nat_ip
Upgrade from old version: nat_ip_enabled
默认值:
global:
communication:
request_via_nat_ip: false
2
3
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
当 deepflow-agent 使用外部 IP 地址访问 deepflow-server 时,
例如,当 deepflow-server 位于 NAT 网关后,或 deepflow-server 所在的主机有多个
节点 IP 地址,不同的 deepflow-agent 需要访问不同的节点 IP 地址时,可以为每个
deepflow-server 地址设置一个额外的 NAT IP,并将本参数设置为 true。
#1.7 自监控
配置 deepflow-agent 自身诊断相关的参数。
#1.7.1 日志
deepflow-agent 自身日志的相关配置参数。
#1.7.1.1 日志等级
标签:
hot_update
FQCN:
global.self_monitoring.log.log_level
Upgrade from old version: log_level
默认值:
global:
self_monitoring:
log:
log_level: INFO
2
3
4
枚举可选值:
| Value | Note |
|---|---|
| DEBUG | |
| INFO | |
| WARN | |
| ERROR |
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
deepflow-agent 运行日志输出等级。
也可以通过高级配置指定特定模块的日志等级,格式如下:
<log_level_spec> ::= single_log_level_spec[{,single_log_level_spec}][/<text_filter>]
<single_log_level_spec> ::= <path_to_module>|<log_level>|<path_to_module>=<log_level>
<text_filter> ::= <regex>
2
3
例如:
log_level: info,deepflow_agent::rpc::session=debug
将设置所有模块的日志等级为 INFO,并将 rpc::session 模块的日志等级设置为 DEBUG。
#1.7.1.2 日志文件
标签:
hot_update
FQCN:
global.self_monitoring.log.log_file
Upgrade from old version: static_config.log-file
默认值:
global:
self_monitoring:
log:
log_file: /var/log/deepflow-agent/deepflow-agent.log
2
3
4
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
deepflow-agent 运行日志的写入位置。
#1.7.1.3 启用日志回传
标签:
hot_update
FQCN:
global.self_monitoring.log.log_backhaul_enabled
Upgrade from old version: rsyslog_enabled
默认值:
global:
self_monitoring:
log:
log_backhaul_enabled: true
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
开启后,deepflow-agent 将向 deepflow-server 回传运行日志。
#1.7.2 持续剖析
deepflow-agent 自身持续剖析数据配置参数
#1.7.2.1 Enabled
标签:
agent_restart deprecated
FQCN:
global.self_monitoring.profile.enabled
Upgrade from old version: static_config.profiler
默认值:
global:
self_monitoring:
profile:
enabled: false
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
该参数仅对 deepflow-trident 有效,对 deepflow-agent 无效。 开启后,支持对 Trident 持续剖析。
#1.7.3 诊断
deepflow-agent 的诊断功能配置参数
#1.7.3.1 Enabled
标签:
hot_update
FQCN:
global.self_monitoring.debug.enabled
Upgrade from old version: debug_enabled
默认值:
global:
self_monitoring:
debug:
enabled: true
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
禁用 / 启用 deepflow-agent 的诊断功能。
#1.7.3.2 本地 UDP 端口号
标签:
agent_restart
FQCN:
global.self_monitoring.debug.local_udp_port
Upgrade from old version: static_config.debug-listen-port
默认值:
global:
self_monitoring:
debug:
local_udp_port: 0
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [0, 65535] |
详细描述:
该参数仅对 deepflow-trident 有效,对 deepflow-agent 无效。用于配置
trident 用于诊断的 UDP 监听端口,默认值为 0 ,表示使用随机的端口。
#1.7.3.3 启用调试指标
标签:
agent_restart deprecated
FQCN:
global.self_monitoring.debug.debug_metrics_enabled
Upgrade from old version: static_config.enable-debug-stats
默认值:
global:
self_monitoring:
debug:
debug_metrics_enabled: false
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
该参数仅对 deepflow-trident 有效,对 deepflow-agent 无效。
#1.7.4 Interval
标签:
hot_update
FQCN:
global.self_monitoring.interval
Upgrade from old version: stats_interval
默认值:
global:
self_monitoring:
interval: 10s
2
3
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['1s', '3600s'] |
详细描述:
statsd 时间间隔。
#1.8 独立运行模式
deepflow-agent 独立运行模式的相关参数
#1.8.1 最大数据文件大小
标签:
agent_restart
FQCN:
global.standalone_mode.max_data_file_size
Upgrade from old version: static_config.standalone-data-file-size
默认值:
global:
standalone_mode:
max_data_file_size: 200
2
3
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | MiB |
| Range | [1, 1000000] |
详细描述:
独立运行模式下,单个数据文件的最大值,当文件大小超过最大值时,数据将滚动覆盖。 deepflow-agent 在独立运行模式下不受 deepflow-server 管理/控制,会将采集数据以文件 形式保存在本地磁盘中。目前支持 2 种数据:l4_flow_log 和 l7_flow_log,每种数据分开写入 不同的数据文件,每种数据最多可产生 2 个数据文件。
#1.8.2 数据文件目录
标签:
agent_restart
FQCN:
global.standalone_mode.data_file_dir
Upgrade from old version: static_config.standalone-data-file-dir
默认值:
global:
standalone_mode:
data_file_dir: /var/log/deepflow-agent/
2
3
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
数据文件的写入位置。
#2. 输入
#2.1 进程
#2.1.1 Enabled
标签:
agent_restart
FQCN:
inputs.proc.enabled
Upgrade from old version: static_config.os-proc-sync-enabled
默认值:
inputs:
proc:
enabled: true
2
3
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
开启此配置后,deepflow-agent 会周期性将 inputs.proc.process_matcher 中指定的进程信息上报给 deepflow-server。
同步进程信息后,所有的 eBPF 观测数据都会自动注入全局进程 ID(gprocess_id)标签。
注意:开启此功能时,需要同时在 inputs.proc.process_matcher 中进一步指定具体的进程列表,
即 inputs.proc.process_matcher.[*].enabled_features 中需要包含 proc.gprocess_info。
该参数仅对云服务器(CHOST_VM、CHOST_BM)和容器(K8S_VM、K8S_BM)类型的 agent 有效,
在命令行下使用 deepflow-ctl agent list 可确定 agent 的具体类型。
#2.1.2 /proc 目录
标签:
hot_update
FQCN:
inputs.proc.proc_dir_path
Upgrade from old version: static_config.os-proc-root
默认值:
inputs:
proc:
proc_dir_path: /proc
2
3
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
进程信息同步所用的目录。
#2.1.3 Socket 信息同步间隔
标签:
hot_update
FQCN:
inputs.proc.socket_info_sync_interval
Upgrade from old version: static_config.os-proc-socket-sync-interval
默认值:
inputs:
proc:
socket_info_sync_interval: 0ns
2
3
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['0ns', '1h'] |
详细描述:
进程 Socket 信息的同步周期。
'0ns' 表示不开启,除 '0ns' 外不要配置小于 1s 的值。
注意:开启此功能时,需要同时在 inputs.proc.process_matcher 中进一步指定具体的进程列表,
即 inputs.proc.process_matcher.[*].enabled_features 中需要包含 proc.socket_list。
另外,也要注意确认 inputs.proc.enabled 已配置为 true。
#2.1.4 最小活跃时间
标签:
hot_update
FQCN:
inputs.proc.min_lifetime
Upgrade from old version: static_config.os-proc-socket-min-lifetime
默认值:
inputs:
proc:
min_lifetime: 3s
2
3
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['1s', '1h'] |
详细描述:
如果接口或进程的活跃时间低于该参数值,deepflow-agent 将不上报该接口或进程的信息。
#2.1.5 Tag 提取
#2.1.5.1 脚本命令
标签:
hot_update
FQCN:
inputs.proc.tag_extraction.script_command
Upgrade from old version: static_config.os-app-tag-exec
默认值:
inputs:
proc:
tag_extraction:
script_command: []
2
3
4
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
deepflow-agent 每次采集进程信息时,会执行配置的脚本命令,并从标准输出的 yaml 格式 中尝试获取进程的标签字段。yaml 格式的样例如下:
- pid: 1
tags:
- key: xxx
value: xxx
- pid: 2
tags:
- key: xxx
value: xxx
2
3
4
5
6
7
8
配置样例:
inputs:
proc:
tag_extraction:
script_command: ["cat", "/tmp/tag.yaml"]
2
3
4
#2.1.5.2 执行用户名
标签:
hot_update
FQCN:
inputs.proc.tag_extraction.exec_username
Upgrade from old version: static_config.os-app-tag-exec-user
默认值:
inputs:
proc:
tag_extraction:
exec_username: deepflow
2
3
4
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
deepflow-agent 执行 script_command 脚本命令的用户名。
#2.1.6 进程黑名单
标签:
hot_update
FQCN:
inputs.proc.process_blacklist
默认值:
inputs:
proc:
process_blacklist:
- sleep
- sh
- bash
- pause
- runc
- grep
- awk
- sed
- curl
2
3
4
5
6
7
8
9
10
11
12
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
进程匹配器忽略的进程列表。
#2.1.7 进程匹配器
标签:
hot_update
FQCN:
inputs.proc.process_matcher
Upgrade from old version: static_config.os-proc-regex
默认值:
inputs:
proc:
process_matcher:
- enabled_features:
- ebpf.profile.on_cpu
- proc.gprocess_info
match_regex: \bjava( +\S+)* +-jar +(\S*/)*([^ /]+\.jar)
match_type: cmdline_with_args
only_in_container: false
rewrite_name: $3
- enabled_features:
- ebpf.profile.on_cpu
- proc.gprocess_info
match_regex: \bjava( +\S+)* +-(?:cp|classpath) +\S+ +(?P<CLASS_NAME>[$_A-Za-z][$_0-9A-Za-z]*(?:\.[$_A-Za-z][$_0-9A-Za-z]*)*)
match_type: cmdline_with_args
only_in_container: false
rewrite_name: ${CLASS_NAME}
- enabled_features:
- ebpf.profile.on_cpu
- proc.gprocess_info
match_regex: \bpython(\S)*( +-\S+)* +(\S*/)*([^ /]+)
match_type: cmdline_with_args
only_in_container: false
rewrite_name: $4
- enabled_features:
- ebpf.profile.on_cpu
- proc.gprocess_info
match_regex: \b(?:lua|luajit)(\S)*( +-\S+)* +(\S*/)*([^ /]+)
match_type: cmdline_with_args
only_in_container: false
rewrite_name: $5
- enabled_features:
- ebpf.profile.on_cpu
- proc.gprocess_info
match_regex: \bphp(\d+)?(-fpm|-cli|-cgi)?( +-\S+)* +(\S*/)*([^ /]+\.php)
match_type: cmdline_with_args
only_in_container: false
rewrite_name: $5
- enabled_features:
- ebpf.profile.on_cpu
- proc.gprocess_info
match_regex: \b(node|nodejs)( +--\S+)* +(\S*/)*([^ /]+\.js)
match_type: cmdline_with_args
only_in_container: false
rewrite_name: $4
- enabled_features:
- ebpf.profile.on_cpu
- proc.gprocess_info
match_regex: ^deepflow-
only_in_container: false
- enabled_features:
- proc.gprocess_info
match_regex: .*
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
模式:
| Key | Value |
|---|---|
| Type | dict |
详细描述:
用于指定为特定进程开启的高级功能列表。
匹配器将自上而下地遍历匹配规则,所以较前的规则将会被优先匹配。
当 match_type 为 parent_process_name 时,匹配器将会递归地查找父进程名且忽略 rewrite_name 选项。
rewrite_name 可定义为正则表达式捕获组索引,或 windows 风格的环境变量。
例如:$1-py-script-%HOSTNAME% 中的 $1 将会替换正则表达式捕获到的第一组内容,并替换 HOSTNAME 环境变量。
配置键:
- match_regex: 用于匹配进程的表达式,缺省值为
""。 - match_type: 被用于正则表达式匹配的对象,缺省值为
process_name,可选项为: [process_name, cmdline, cmdline_with_args, parent_process_name, tag] - ignore: 是否要忽略匹配到的进程,缺省值为
false - rewrite_name: 使用正则替换匹配到的进程名或命令行,缺省值为
""表示不做替换。 - enabled_features: 为匹配到的进程开启的特性列表,可选项如下
- proc.gprocess_info(注意确认
inputs.proc.enabled已配置为 true) - proc.golang_symbol_table(注意确认
inputs.proc.symbol_table.golang_specific.enabled已配置为 true) - proc.socket_list(注意确认
inputs.proc.socket_info_sync_interval已配置为大于 0 的数字) - ebpf.socket.uprobe.golang(注意确认
inputs.ebpf.socket.uprobe.golang.enabled已配置为 true) - ebpf.socket.uprobe.tls(注意确认
inputs.ebpf.socket.uprobe.tls.enabled已配置为 true) - ebpf.profile.on_cpu(注意确认
inputs.ebpf.profile.on_cpu.disabled已配置为 false) - ebpf.profile.off_cpu(注意确认
inputs.ebpf.profile.off_cpu.disabled已配置为 false) - ebpf.profile.memory(注意确认
inputs.ebpf.profile.memory.disabled已配置为 false)
- proc.gprocess_info(注意确认
示例:
inputs:
proc:
process_matcher:
- match_regex: python3 (.*)\.py
match_type: cmdline
match_languages: []
match_usernames: []
only_in_container: true
only_with_tag: false
ignore: false
rewrite_name: $1-py-script
enabled_features: [ebpf.socket.uprobe.golang, ebpf.profile.on_cpu]
- match_regex: (?P<PROC_NAME>nginx)
match_type: process_name
rewrite_name: ${PROC_NAME}-%HOSTNAME%
- match_regex: "nginx"
match_type: parent_process_name
ignore: true
- match_regex: .*sleep.*
match_type: process_name
ignore: true
- match_regex: .+ # 可使用冒号连接需要匹配的 tag key 与 value
# i.e.: `app:.+` 表示匹配所有具有 `app` tag 的进程
match_type: tag
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#2.1.7.1 匹配正则表达式
标签:
hot_update
FQCN:
inputs.proc.process_matcher.match_regex
Upgrade from old version: static_config.os-proc-regex.match-regex
默认值:
inputs:
proc:
process_matcher:
- match_regex: ''
2
3
4
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
匹配正则表达式。
#2.1.7.2 匹配类型
标签:
hot_update
FQCN:
inputs.proc.process_matcher.match_type
Upgrade from old version: static_config.os-proc-regex.match-type
默认值:
inputs:
proc:
process_matcher:
- match_type: process_name
2
3
4
枚举可选值:
| Value | Note |
|---|---|
| process_name | |
| cmdline | |
| cmdline_with_args | |
| parent_process_name | |
| tag |
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
匹配类型。
#2.1.7.3 匹配语言
标签:
hot_update
FQCN:
inputs.proc.process_matcher.match_languages
默认值:
inputs:
proc:
process_matcher:
- match_languages: []
2
3
4
枚举可选值:
| Value | Note |
|---|---|
| java | |
| golang | |
| python | |
| lua | |
| php | |
| nodejs | |
| dotnet |
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
默认值 [] 匹配所有语言。
#2.1.7.4 匹配用户名
标签:
hot_update
FQCN:
inputs.proc.process_matcher.match_usernames
默认值:
inputs:
proc:
process_matcher:
- match_usernames: []
2
3
4
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
默认值 [] 匹配所有语言。
#2.1.7.5 仅匹配容器内的进程
标签:
hot_update
FQCN:
inputs.proc.process_matcher.only_in_container
默认值:
inputs:
proc:
process_matcher:
- only_in_container: true
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
默认值 true 表示仅匹配容器中的进程。
#2.1.7.6 仅匹配有 Tag 的进程
标签:
hot_update
FQCN:
inputs.proc.process_matcher.only_with_tag
Upgrade from old version: static_config.os-proc-sync-tagged-only
默认值:
inputs:
proc:
process_matcher:
- only_with_tag: false
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
默认值 false 表示匹配所有进程。
#2.1.7.7 忽略
标签:
hot_update
FQCN:
inputs.proc.process_matcher.ignore
Upgrade from old version: static_config.os-proc-regex.action
默认值:
inputs:
proc:
process_matcher:
- ignore: false
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
是否忽略匹配的进程。
#2.1.7.8 重命名
标签:
hot_update
FQCN:
inputs.proc.process_matcher.rewrite_name
Upgrade from old version: static_config.os-proc-regex.rewrite-name
默认值:
inputs:
proc:
process_matcher:
- rewrite_name: ''
2
3
4
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
匹配后的新名称。
#2.1.7.9 开启功能列表
标签:
hot_update
FQCN:
inputs.proc.process_matcher.enabled_features
Upgrade from old version: static_config.ebpf.on-cpu-profile.regex, static_config.ebpf.off-cpu-profile.regex
默认值:
inputs:
proc:
process_matcher:
- enabled_features: []
2
3
4
枚举可选值:
| Value | Note |
|---|---|
| proc.gprocess_info | 同步进程资源信息,并为 eBPF 原始观测数据注入所在观测点上的进程标签 |
| proc.golang_symbol_table | 解析 Golang 特有符号表,用于 Golang 进程裁剪了标准符号表时的剖析数据优化 |
| proc.socket_list | 同步进程的活跃 Socket 信息,用于为应用和网络观测数据注入通信双方的进程标签 |
| ebpf.socket.uprobe.golang | 为 Golang 进程开启 eBPF uprobe,用于协程追踪并采集 Golang HTTP2/HTTPS 通信 |
| ebpf.socket.uprobe.tls | 为 TLS 通信开启 eBPF uprobe,用于采集非 Golang 进程的加密通信观测数据 |
| ebpf.profile.on_cpu | 开启 On-CPU 持续剖析功能 |
| ebpf.profile.off_cpu | 开启 Off-CPU 持续剖析功能 |
| ebpf.profile.memory | 开启内存持续剖析功能 |
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
注意也需要同时开启相关特性的总开关:
- proc.gprocess_info(注意确认
inputs.proc.enabled已配置为 true) - proc.golang_symbol_table(注意确认
inputs.proc.symbol_table.golang_specific.enabled已配置为 true) - proc.socket_list(注意确认
inputs.proc.socket_info_sync_interval已配置为大于 0 的数字) - ebpf.socket.uprobe.golang(注意确认
inputs.ebpf.socket.uprobe.golang.enabled已配置为 true) - ebpf.socket.uprobe.tls(注意确认
inputs.ebpf.socket.uprobe.tls.enabled已配置为 true) - ebpf.profile.on_cpu(注意确认
inputs.ebpf.profile.on_cpu.disabled已配置为 false) - ebpf.profile.off_cpu(注意确认
inputs.ebpf.profile.off_cpu.disabled已配置为 false) - ebpf.profile.memory(注意确认
inputs.ebpf.profile.memory.disabled已配置为 false)
#2.1.8 智能体治理
#2.1.8.1 HTTP 端点
标签:
hot_update ee_feature
FQCN:
inputs.proc.ai_agent.http_endpoints
默认值:
inputs:
proc:
ai_agent:
http_endpoints:
- /v1/chat/completions
- /v1/embeddings
- /v1/responses
2
3
4
5
6
7
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
用于识别智能体的 HTTP 端点前缀,命中后会标记进程为 AI Agent。
#2.1.8.2 最大载荷大小
标签:
hot_update ee_feature
FQCN:
inputs.proc.ai_agent.max_payload_size
默认值:
inputs:
proc:
ai_agent:
max_payload_size: 0
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | byte |
| Range | [0, 2147483647] |
详细描述:
AI Agent 流重组最大载荷大小,0 表示不限。
#2.1.8.3 文件 IO 事件
标签:
hot_update ee_feature
FQCN:
inputs.proc.ai_agent.file_io_enabled
默认值:
inputs:
proc:
ai_agent:
file_io_enabled: true
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
是否开启 AI Agent 文件 IO 事件采集。
#2.1.9 符号表
#2.1.9.1 Golang 特有
#2.1.9.1.1 Enabled
标签:
agent_restart
FQCN:
inputs.proc.symbol_table.golang_specific.enabled
Upgrade from old version: static_config.ebpf.uprobe-process-name-regexs.golang-symbol
默认值:
inputs:
proc:
symbol_table:
golang_specific:
enabled: false
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
是否开启 Golang 特有符号表的解析能力。
如果 Golang(版本 >= 1.13 and < 1.18条件下)进程运行时裁切了标准符号 表,开启此开关后 deepflow-agent 将解析生成 Golang-specific 符号表以 完善 eBPF uprobe 数据,实现 Golang 程序的零侵扰调用链追踪。注意:开启 该开关后,eBPF 程序初始化过程可能会持续 10 分钟以上的时间。
配置方法:
- 如果在 deepflow-agent 的运行日志中发现如下 warning:以上日志说明存在一个 PID = 1946 的 Golang 进程。
[eBPF] WARNING: func resolve_bin_file() [user/go_tracer.c:558] Go process pid 1946 [path: /proc/1946/root/usr/local/bin/kube-controller-manager] (version: go1.16). Not find any symbols!1
2 - 确认是否 Golang 进程是否已有符号表:
- 通过 PID 获取程序可执行文件的目录:
# ls -al /proc/1946/exe /proc/1946/exe -> /usr/local/bin/kube-controller-manager1
2 - 检查目录下是否有符号表:
# nm /proc/1946/root/usr/local/bin/kube-controller-manager nm: /proc/1946/root/usr/local/bin/kube-controller-manager: no symbols1
2
- 通过 PID 获取程序可执行文件的目录:
- 如果结果中出现 "no symbols",则说明符号表缺失,需要开启 Golang 程序符号表解析开关.
- deepflow-agent 启动阶段运行日志中出现类似下面的信息,说明 Golang 进程已经被成功 hook。
[eBPF] INFO Uprobe [/proc/1946/root/usr/local/bin/kube-controller-manager] pid:1946 go1.16.0 entry:0x25fca0 size:1952 symname:crypto/tls.(*Conn).Write probe_func:uprobe_go_tls_write_enter rets_count:01
2
注意:开启此功能时,需要同时在 inputs.proc.process_matcher 中进一步指定具体的进程列表,
即 inputs.proc.process_matcher.[*].enabled_features 中需要包含 proc.golang_symbol_table。
#2.1.9.2 Java
#2.1.9.2.1 刷新延迟时长
标签:
agent_restart
FQCN:
inputs.proc.symbol_table.java.refresh_defer_duration
Upgrade from old version: static_config.ebpf.java-symbol-file-refresh-defer-interval
默认值:
inputs:
proc:
symbol_table:
java:
refresh_defer_duration: 60s
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['5s', '3600s'] |
详细描述:
当 deepflow-agent 在 Java 进程的函数调用栈中发现未能解析的函数名时,将触发进程函数符号表的生成和符号缓存 的更新。当前 Java 符号文件是采用持续更新的方式,该 duration 用于控制推迟使用符号文件更新符号缓存的时间。 原因是由于 Java 使用了 JIT 编译机制,编译符号生成有个预热阶段,为了获取更充足的 Java 符号需要推迟一段时间 来更新 Java 符号的缓存,也可避免由于符号缺失而造成的频繁符号缓存刷新引起大量CPU资源消耗。
#2.1.9.2.2 符号表文件最大大小
标签:
agent_restart deprecated
FQCN:
inputs.proc.symbol_table.java.max_symbol_file_size
Upgrade from old version: static_config.ebpf.java-symbol-file-max-space-limit
默认值:
inputs:
proc:
symbol_table:
java:
max_symbol_file_size: 10
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | MiB |
| Range | [2, 100] |
详细描述:
deepflow-agent 将所有的 Java 符号表文件存放在'/tmp'目录下,该参数用于限制每一个 Java 符号表文件的 大小上限,以避免占用过多的节点磁盘空间。
#2.2 cBPF
#2.2.1 通用配置
#2.2.1.1 Packet 采集模式
标签:
hot_update
FQCN:
inputs.cbpf.common.capture_mode
Upgrade from old version: tap_mode
默认值:
inputs:
cbpf:
common:
capture_mode: 0
2
3
4
枚举可选值:
| Value | Note |
|---|---|
| 0 | 本地流量 |
| 1 | 虚拟网络镜像 |
| 2 | 物理网络镜像 |
模式:
| Key | Value |
|---|---|
| Type | int |
详细描述:
虚拟网络镜像模式用于 deepflow-agent 无法直接采集流量的场景,比如:
- k8s 的 macvlan 环境中,从 Node 网口接口采集 POD 流量;
- Hyper-V 环境中,从宿主机的网络接口采集 VM 流量;
- ESXi 环境中,通过 VDS/VSS 的本地 SPAN 采集 VM 流量;
- DPDK 环境中,通过 DPDK ring buffer 采集 VM 流量。
物理网络镜像模式(仅企业版支持)用于 deepflow-agent 从物理设备镜像采集流量的场景。
#2.2.2 使用 AF_PACKET 采集
#2.2.2.1 网卡名正则表达式
标签:
hot_update
FQCN:
inputs.cbpf.af_packet.interface_regex
Upgrade from old version: tap_interface_regex
默认值:
inputs:
cbpf:
af_packet:
interface_regex: ^(tap.*|cali.*|veth.*|eth.*|en[osipx].*|lxc.*|lo|[0-9a-f]+_h)$
2
3
4
模式:
| Key | Value |
|---|---|
| Type | string |
| Range | [0, 65535] |
详细描述:
需要采集流量的网络接口的正则表达式。
默认配置说明:
Localhost: lo
Common NIC: eth.*|en[osipx].*
QEMU VM NIC: tap.*
Flannel: veth.*
Calico: cali.*
Cilium lxc.*
Kube-OVN [0-9a-f]+_h$
2
3
4
5
6
7
未配置时,表示未采集网卡流量
#2.2.2.2 内网络命名空间采集开关
标签:
agent_restart
FQCN:
inputs.cbpf.af_packet.inner_interface_capture_enabled
默认值:
inputs:
cbpf:
af_packet:
inner_interface_capture_enabled: false
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
是否采集内网络命名空间流量。
设置为启用会使采集器为每个内网络命名空间创建一个独立的接收引擎线程,
这会导致额外的内存消耗。
默认配置 inputs.cbpf.af_packet.tunning.ring_blocks 为 128,
这意味着每个网络命名空间将消耗 128 * 1MB 的内存。
一个有 20 个 POD 的节点将需要 20 * 128 * 1MB = 2.56GB 的内存。
请在启用此功能之前估计内存消耗,启用 inputs.cbpf.af_packet.tunning.ring_blocks_enabled
并调整 inputs.cbpf.af_packet.tunning.ring_blocks 以减少内存消耗。
#2.2.2.3 内网络命名空间网卡名正则表达式
标签:
hot_update
FQCN:
inputs.cbpf.af_packet.inner_interface_regex
默认值:
inputs:
cbpf:
af_packet:
inner_interface_regex: ^eth\d+$
2
3
4
模式:
| Key | Value |
|---|---|
| Type | string |
| Range | [0, 65535] |
详细描述:
需要采集流量的内网络命名空间网卡的正则表达式。
#2.2.2.4 Bond 网卡列表
标签:
agent_restart
FQCN:
inputs.cbpf.af_packet.bond_interfaces
Upgrade from old version: static_config.tap-interface-bond-groups
默认值:
inputs:
cbpf:
af_packet:
bond_interfaces: []
2
3
4
模式:
| Key | Value |
|---|---|
| Type | dict |
详细描述:
同一组内接口的数据包可以聚合在一起,
仅当 inputs.cbpf.common.capture_mode 为0时有效。
例子:
inputs:
cbpf:
af_packet:
bond_interfaces:
- slave_interfaces: [eth0, eth1]
- slave_interfaces: [eth2, eth3]
2
3
4
5
6
#2.2.2.4.1 Slave 网卡列表
标签:
agent_restart
FQCN:
inputs.cbpf.af_packet.bond_interfaces.slave_interfaces
Upgrade from old version: static_config.tap-interface-bond-groups.tap-interfaces
默认值:
inputs:
cbpf:
af_packet:
bond_interfaces:
- slave_interfaces: []
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
Bond 网卡的从网卡列表。
#2.2.2.5 额外的 BPF 过滤器
标签:
hot_update
FQCN:
inputs.cbpf.af_packet.extra_bpf_filter
Upgrade from old version: capture_bpf
默认值:
inputs:
cbpf:
af_packet:
extra_bpf_filter: ''
2
3
4
模式:
| Key | Value |
|---|---|
| Type | string |
| Range | [0, 512] |
详细描述:
如果不配置该参数,则采集全部流量。BPF 语法详见:https://biot.com/capstats/bpf.html (opens new window)
#2.2.2.6 TAP Interfaces
标签:
deprecated
FQCN:
inputs.cbpf.af_packet.src_interfaces
Upgrade from old version: static_config.src-interfaces
默认值:
inputs:
cbpf:
af_packet:
src_interfaces: []
2
3
4
模式:
| Key | Value |
|---|---|
| Type | string |
#2.2.2.7 禁用 BPF 过滤
标签:
agent_restart
FQCN:
inputs.cbpf.af_packet.bpf_filter_disabled
Upgrade from old version: static_config.bpf-disabled
默认值:
inputs:
cbpf:
af_packet:
bpf_filter_disabled: false
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
此开关用于对特定 Linux 内核版本 BPF 功能诊断,打开此开关后 deepflow-agent 将不启用 Linux 内核的 BPF 包过滤能力,而是获取全流量的数据包之后由采集器程序进行过滤。注意,打开此开关将明显 增加 deepflow-agent 的资源消耗。
#2.2.2.8 跳过 NPB BPF
标签:
agent_restart
FQCN:
inputs.cbpf.af_packet.skip_npb_bpf
Upgrade from old version: static_config.skip-npb-bpf
默认值:
inputs:
cbpf:
af_packet:
skip_npb_bpf: false
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
如果采集网卡中有 ERSPAN 流量但是没有分发流量,开启这个开关来采集 ERSPAN 流量。
#2.2.2.9 调优
#2.2.2.9.1 Socket 版本
标签:
hot_update
FQCN:
inputs.cbpf.af_packet.tunning.socket_version
Upgrade from old version: capture_socket_type
默认值:
inputs:
cbpf:
af_packet:
tunning:
socket_version: 0
2
3
4
5
枚举可选值:
| Value | Note |
|---|---|
| 0 | 自适应 |
| 2 | AF_PACKET V2 |
| 3 | AF_PACKET V3 |
模式:
| Key | Value |
|---|---|
| Type | int |
详细描述:
deepflow-agent 所在的 Linux 操作系统的 AF_PACKET socket 版本号。
#2.2.2.9.2 使能 Ring Blocks 配置
标签:
agent_restart
FQCN:
inputs.cbpf.af_packet.tunning.ring_blocks_enabled
Upgrade from old version: static_config.afpacket-blocks-enabled
默认值:
inputs:
cbpf:
af_packet:
tunning:
ring_blocks_enabled: false
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
当 inputs.cbpf.common.capture_mode 为 本地流量或虚拟网络镜像模式,需开启此开关,
并配置 inputs.cbpf.af_packet.tunning.ring_blocks 参数。
#2.2.2.9.3 Ring Blocks
标签:
agent_restart
FQCN:
inputs.cbpf.af_packet.tunning.ring_blocks
Upgrade from old version: static_config.afpacket-blocks
默认值:
inputs:
cbpf:
af_packet:
tunning:
ring_blocks: 128
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [8, 1000000] |
详细描述:
配置此参数后,deepflow-agent 将分配指定数量的 block 用于 AF_PACKET,每个 block 的 大小固定为 1 MByte。
#2.2.2.9.4 Packet Fanout 路数
标签:
agent_restart
FQCN:
inputs.cbpf.af_packet.tunning.packet_fanout_count
Upgrade from old version: static_config.local-dispatcher-count
默认值:
inputs:
cbpf:
af_packet:
tunning:
packet_fanout_count: 1
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [1, 64] |
详细描述:
当此配置值大于 1 时,deepflow-agent 将开启多个 dispatcher 线程,并把数据包分散到多个处理 线程并行处理,弹性扩展 dispatcher 以优化网络应用的处理性能。增大此配置可以降低 多核服务器的操作系统软中断数量,但会消耗更多的 CPU 和内存。
注意:
- 参数仅在
inputs.cbpf.common.capture_mode为本地流量,且inputs.cbpf.af_packet.extra_netns_regex为空时有效。 - 当
self.inputs.cbpf.special_network.dpdk.source为eBPF时,这个配置值会被强制置为self.inputs.ebpf.tunning.userspace_worker_threads
#2.2.2.9.5 Packet Fanout 模式
标签:
agent_restart
FQCN:
inputs.cbpf.af_packet.tunning.packet_fanout_mode
Upgrade from old version: static_config.packet-fanout-mode
默认值:
inputs:
cbpf:
af_packet:
tunning:
packet_fanout_mode: 0
2
3
4
5
枚举可选值:
| Value | Note |
|---|---|
| 0 | PACKET_FANOUT_HASH |
| 1 | PACKET_FANOUT_LB |
| 2 | PACKET_FANOUT_CPU |
| 3 | PACKET_FANOUT_ROLLOVER |
| 4 | PACKET_FANOUT_RND |
| 5 | PACKET_FANOUT_QM |
| 6 | PACKET_FANOUT_CBPF |
| 7 | PACKET_FANOUT_EBPF |
模式:
| Key | Value |
|---|---|
| Type | int |
详细描述:
数据包 Fanout 的算法/模式。参考:
- https://github.com/torvalds/linux/blob/afcd48134c58d6af45fb3fdb648f1260b20f2326/include/uapi/linux/if_packet.h#L71 (opens new window)
- https://www.stackpath.com/blog/bpf-hook-points-part-1/ (opens new window)
#2.2.2.9.6 开启网卡混杂模式
标签:
agent_restart
FQCN:
inputs.cbpf.af_packet.tunning.interface_promisc_enabled
默认值:
inputs:
cbpf:
af_packet:
tunning:
interface_promisc_enabled: false
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
如下场景需要开启混杂模式:
inputs.cbpf.common.capture_mode等于虚拟网络镜像或物理网络镜像inputs.cbpf.common.capture_mode等于本地流量并且无法采集到虚拟机的流量 注意:网卡开启混杂模式后会采集更多的流量导致性能降低。
#2.2.3 特殊网络
#2.2.3.1 DPDK
#2.2.3.1.1 乱序重排缓存时间窗口大小
标签:
agent_restart
FQCN:
inputs.cbpf.special_network.dpdk.reorder_cache_window_size
默认值:
inputs:
cbpf:
special_network:
dpdk:
reorder_cache_window_size: 60ms
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['60ms', '100ms'] |
详细描述:
当 inputs.cbpf.special_network.dpdk.source 为 eBPF 时该配置生效,时间窗口变大会导致 agent 占用更多的内存。
#2.2.4 调优
#2.2.4.1 启用 Dispatcher 队列
标签:
agent_restart
FQCN:
inputs.cbpf.tunning.dispatcher_queue_enabled
Upgrade from old version: static_config.dispatcher-queue
默认值:
inputs:
cbpf:
tunning:
dispatcher_queue_enabled: false
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
当 inputs.cbpf.common.capture_mode 为本地流量或虚拟网络镜像时该配置生效。
对所有流量采集方式都可用。
#2.2.4.2 最大采集包长
标签:
hot_update
FQCN:
inputs.cbpf.tunning.max_capture_packet_size
Upgrade from old version: capture_packet_size
默认值:
inputs:
cbpf:
tunning:
max_capture_packet_size: 65535
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | byte |
| Range | [128, 65535] |
详细描述:
该参数配置对 DPDK 环境无效。
#2.2.4.3 最大采集 PPS
标签:
hot_update
FQCN:
inputs.cbpf.tunning.max_capture_pps
Upgrade from old version: max_collect_pps
默认值:
inputs:
cbpf:
tunning:
max_capture_pps: 1048576
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | pps |
| Range | [1, 10000000] |
详细描述:
deepflow-agent 采集数据包的速率上限。
#2.2.5 预处理
#2.2.5.1 隧道解封装协议
标签:
hot_update
FQCN:
inputs.cbpf.preprocess.tunnel_decap_protocols
Upgrade from old version: decap_type
默认值:
inputs:
cbpf:
preprocess:
tunnel_decap_protocols:
- 1
- 2
2
3
4
5
6
枚举可选值:
| Value | Note |
|---|---|
| 1 | VXLAN |
| 2 | IPIP |
| 3 | GRE |
| 4 | Geneve |
| 5 | VXLAN-NSH |
模式:
| Key | Value |
|---|---|
| Type | int |
详细描述:
deepflow-agent 需要对数据包解封装的隧道协议,仅企业版本支持解析 GRE 和 VXLAN-NSH。
#2.2.5.2 隧道头剥离协议
标签:
agent_restart
FQCN:
inputs.cbpf.preprocess.tunnel_trim_protocols
Upgrade from old version: static_config.trim-tunnel-types
默认值:
inputs:
cbpf:
preprocess:
tunnel_trim_protocols: []
2
3
4
枚举可选值:
| Value | Note |
|---|---|
| ERSPAN | |
| VXLAN | |
| TEB |
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
流量镜像(虚拟或物理)模式下,deepflow-agent 需要剥离的隧道头协议类型。 仅企业版支持解析 ERSPAN 和 TEB。
#2.3 eBPF
#2.3.1 Disabled
标签:
agent_restart
FQCN:
inputs.ebpf.disabled
Upgrade from old version: static_config.ebpf.disabled
默认值:
inputs:
ebpf:
disabled: false
2
3
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
eBPF 特性的总开关。
#2.3.2 Socket
#2.3.2.1 Uprobe
#2.3.2.1.1 Golang
#2.3.2.1.1.1 Enabled
标签:
agent_restart
FQCN:
inputs.ebpf.socket.uprobe.golang.enabled
Upgrade from old version: static_config.ebpf.uprobe-golang-trace-enabled, static_config.ebpf.uprobe-process-name-regexs.golang
默认值:
inputs:
ebpf:
socket:
uprobe:
golang:
enabled: false
2
3
4
5
6
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
Golang 程序 HTTP2/HTTPS 协议数据采集及零侵扰追踪特性的开启开关。
注意:开启此功能时,需要同时在 inputs.proc.process_matcher 中进一步指定具体的进程列表,
即 inputs.proc.process_matcher.[*].enabled_features 中需要包含 ebpf.socket.uprobe.golang。
#2.3.2.1.1.2 追踪超时时间
标签:
agent_restart
FQCN:
inputs.ebpf.socket.uprobe.golang.tracing_timeout
Upgrade from old version: static_config.ebpf.go-tracing-timeout
默认值:
inputs:
ebpf:
socket:
uprobe:
golang:
tracing_timeout: 120s
2
3
4
5
6
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['0ns', '1d'] |
详细描述:
Golang 程序追踪时请求与响应之间的最大时间间隔,设置为 '0ns' 时,Golang 程序的零侵扰追踪特性自动关闭。
#2.3.2.1.2 TLS
#2.3.2.1.2.1 Enabled
标签:
agent_restart
FQCN:
inputs.ebpf.socket.uprobe.tls.enabled
Upgrade from old version: static_config.ebpf.uprobe-openssl-trace-enabled, static_config.ebpf.uprobe-process-name-regexs.openssl
默认值:
inputs:
ebpf:
socket:
uprobe:
tls:
enabled: false
2
3
4
5
6
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
是否启用使用 openssl 库的进程以支持 HTTPS 协议数据采集。
可通过以下方式判断应用进程是否能够使用 Uprobe hook openssl 库来采集加密数据:
- 执行命令
sudo cat /proc/<PID>/maps | grep "libssl.so",若包含 openssl 相关信息 则说明该进程正在使用 openssl 库。 - 如果上面没有搜到 "libssl.so" 也可能是静态编译了,这时候我们可以通过下面方式确认:
执行命令
sudo nm /proc/<PID>/exe | grep SSL_write若包含SSL_write相关信息如:0000000000502ac0 T SSL_write则说明该进程正在使用静态编译的 openssl 库。
启用后,deepflow-agent 将获取符合正则表达式匹配的进程信息,并 Hook openssl 库的相应加解密接口。 在日志中您会看到类似如下信息:
[eBPF] INFO openssl uprobe, pid:1005, path:/proc/1005/root/usr/lib64/libssl.so.1.0.2k
或者
[eBPF] INFO openssl uprobe, pid:28890, path:/proc/28890/root/usr/sbin/nginx
2
3
注意:开启此功能后,Envoy mTLS 流量可自动完成追踪;
若为非 Envoy 流量,则需要同时在 inputs.proc.process_matcher 中进一步指定具体的进程列表,
即 inputs.proc.process_matcher.[*].enabled_features 中需要包含 ebpf.socket.uprobe.tls。
#2.3.2.2 Kprobe
#2.3.2.2.1 禁用 kprobe
标签:
agent_restart
FQCN:
inputs.ebpf.socket.kprobe.disabled
默认值:
inputs:
ebpf:
socket:
kprobe:
disabled: false
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
当设置为 true 时,kprobe 功能将被禁用。
#2.3.2.2.2 启用 Unix Socket 追踪
标签:
agent_restart
FQCN:
inputs.ebpf.socket.kprobe.enable_unix_socket
默认值:
inputs:
ebpf:
socket:
kprobe:
enable_unix_socket: false
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
当设置为 true 时,启用 Unix Socket 追踪。
#2.3.2.2.3 黑名单
#2.3.2.2.3.1 端口号
标签:
agent_restart
FQCN:
inputs.ebpf.socket.kprobe.blacklist.ports
Upgrade from old version: static_config.ebpf.kprobe-blacklist.port-list
默认值:
inputs:
ebpf:
socket:
kprobe:
blacklist:
ports: ''
2
3
4
5
6
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
TCP 和 UDP 的端口黑名单列表。端口号列入黑名单的 socket 将被 Kprobe 采集忽略。黑名单 生效优先级高于 kprobe 白名单。
配置样例: ports: 80,1000-2000
#2.3.2.2.4 白名单
#2.3.2.2.4.1 白名单
标签:
agent_restart
FQCN:
inputs.ebpf.socket.kprobe.whitelist.ports
Upgrade from old version: static_config.ebpf.kprobe-whitelist.port-list
默认值:
inputs:
ebpf:
socket:
kprobe:
whitelist:
ports: ''
2
3
4
5
6
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
TCP 和 UDP 的端口白名单列表,白名单生效优先级低于 kprobe 黑名单。 未列入黑名单、白名单的端口用 kprobe 做采集。
配置样例: ports: 80,1000-2000
#2.3.2.3 SockOps
#2.3.2.3.1 TCP Option Trace
#2.3.2.3.1.1 TCP Option 注入
标签:
hot_update
FQCN:
inputs.ebpf.socket.sock_ops.tcp_option_trace.enabled
默认值:
inputs:
ebpf:
socket:
sock_ops:
tcp_option_trace:
enabled: false
2
3
4
5
6
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
是否开启 TCP Option Tracing SockOps 程序,用于在满足条件的 TCP 连接上注入 DeepFlow 元数据(如进程 PID)。 注意:该功能依赖 cgroup v2(统一层级)和内核版本 > 5.10。在 cgroup v1 主机上 SockOps 绑定会失败. 兼容性:已在 x86 上验证内核 > 5.10;arm 目前仅在 6.8 内核上测试。 限制:PID 跟踪依赖per-CPU syscall map。CPU 拥堵、软中断可能在不同 CPU 运行时,注入的元数据可能缺失或过期。
#2.3.2.3.1.2 PID 注入窗口
标签:
hot_update
FQCN:
inputs.ebpf.socket.sock_ops.tcp_option_trace.sampling_window_bytes
默认值:
inputs:
ebpf:
socket:
sock_ops:
tcp_option_trace:
sampling_window_bytes: 16384
2
3
4
5
6
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | Bytes |
| Range | [0, 1048576] |
详细描述:
控制 PID 注入之间的最小 TCP 负载间隔字节数。缺省为 16KB,与历史行为一致;值越小注入越频繁,值越大越稀疏。 设置为0关闭采样窗口功能,对所有数据包注入。
#2.3.2.4 调优
#2.3.2.4.1 最大采集速率
标签:
hot_update
FQCN:
inputs.ebpf.socket.tunning.max_capture_rate
Upgrade from old version: static_config.ebpf.global-ebpf-pps-threshold
默认值:
inputs:
ebpf:
socket:
tunning:
max_capture_rate: 0
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | Per Second |
| Range | [0, 64000000] |
详细描述:
eBPF 数据的最大采集速率,设置为 0 表示不对 deepflow-agent 的 eBPF 数据采集速率做限制。
#2.3.2.4.2 禁用 syscall_trace_id 相关的计算
标签:
agent_restart
FQCN:
inputs.ebpf.socket.tunning.syscall_trace_id_disabled
默认值:
inputs:
ebpf:
socket:
tunning:
syscall_trace_id_disabled: false
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
当 trace_id 注入所有请求时,所有请求的 syscall_trace_id 计算逻辑可以关闭。这将大大减少 eBPF hook 进程的 CPU 消耗。
#2.3.2.4.3 禁用预分配内存
标签:
agent_restart
FQCN:
inputs.ebpf.socket.tunning.map_prealloc_disabled
Upgrade from old version: static_config.ebpf.map-prealloc-disabled
默认值:
inputs:
ebpf:
socket:
tunning:
map_prealloc_disabled: false
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
当完整的map预分配过于昂贵时,将此配置设置为 true 可以防止在定义map时进行内存预分配,
但这可能会导致一些性能下降。此配置仅适用于 BPF_MAP_TYPE_HASH 类型的 bpf map。
目前适用于 socket trace 和 uprobe Golang/OpenSSL trace 功能。禁用内存预分配大约会减少45M的内存占用。
#2.3.2.4.4 Socket Hook Syscall 列表
标签:
agent_restart
FQCN:
inputs.ebpf.socket.tunning.hooked_socket_syscalls
默认值:
inputs:
ebpf:
socket:
tunning:
hooked_socket_syscalls:
- read
- readv
- recvfrom
- recvmsg
- recvmmsg
- sendmsg
- sendmmsg
- sendto
- write
- writev
2
3
4
5
6
7
8
9
10
11
12
13
14
15
枚举可选值:
| Value | Note |
|---|---|
| read | |
| readv | |
| recvfrom | |
| recvmsg | |
| recvmmsg | |
| sendmsg | |
| sendmmsg | |
| sendto | |
| write | |
| writev |
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
控制为哪些受支持的 socket syscall 安装 eBPF hook。
该列表只控制是否 hook 某个 syscall,不控制具体使用哪种 backend。每个启用的
syscall 仍然遵循当前运行模式下既有的 backend 选择逻辑。例如 mixed 模式继续保留
现有的 hybrid 与 tracepoint-only 分工,pure-kprobe 模式继续保留既有的 kprobe
行为,kfunc 模式继续保留既有的 kfunc 行为,以及 recvfrom 和 recvmmsg
的 tracepoint fallback。
支持的配置值:read、readv、recvfrom、recvmsg、recvmmsg、sendmsg、
sendmmsg、sendto、write、writev。
#2.3.2.4.5 启用fentry/fexit特性
标签:
agent_restart
FQCN:
inputs.ebpf.socket.tunning.fentry_enabled
默认值:
inputs:
ebpf:
socket:
tunning:
fentry_enabled: false
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
使用 fentry/fexit 特性说明
- 相比传统的 kprobes,fentry 和 fexit 程序提供了更高的性能和可用性,可带来约 5%–10% 的性能提升。
- 部分 Linux 内核对该特性支持不够完善,可能导致内核 BUG 和节点崩溃。已知的 BUG 修复包括:
- TencentOS Linux kernel 5.4.119 的修复 https://github.com/torvalds/linux/commit/c3d6324f841bab2403be6419986e2b1d1068d423 (opens new window)
- Alibaba Cloud Linux kernel 5.10.23 的修复 https://github.com/gregkh/linux/commit/e21d2b92354b3cd25dd774ebb0f0e52ff04a7861 (opens new window)
- 内核建议:若要启用 fentry/fexit 特性,推荐使用 Linux kernel 5.10.28 及以上版本,以确保稳定性和性能。
#2.3.3 File
#2.3.3.1 IO 事件
#2.3.3.1.1 采集模式
标签:
agent_restart
FQCN:
inputs.ebpf.file.io_event.collect_mode
Upgrade from old version: static_config.ebpf.io-event-collect-mode
默认值:
inputs:
ebpf:
file:
io_event:
collect_mode: 1
2
3
4
5
枚举可选值:
| Value | Note |
|---|---|
| 0 | 禁用 |
| 1 | 调用生命周期 |
| 2 | 全部 |
模式:
| Key | Value |
|---|---|
| Type | int |
详细描述:
采集模式:
- 禁用:不采集任何文件 IO 事件。
- 调用生命周期:仅采集调用生命周期内的文件 IO 事件。
- 全部:采集所有的文件 IO 事件。
说明:
- 为了获取文件的完整路径,需要结合进程的挂载信息进行路径拼接。然而,一些进程在完成任务后会迅速退出, 此时我们处理其产生的文件读写数据时,可能已无法从 /proc/[pid]/mountinfo 中获取挂载信息,导致路径不 完整(缺少挂载点)。我们对于 50ms 以下生存期的进程,文件路径会缺少挂载点信息。对于长期运行的进程, 则不存在该问题。
#2.3.3.1.2 最小耗时
标签:
agent_restart
FQCN:
inputs.ebpf.file.io_event.minimal_duration
Upgrade from old version: static_config.ebpf.io-event-minimal-duration
默认值:
inputs:
ebpf:
file:
io_event:
minimal_duration: 1ms
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['1ns', '1s'] |
详细描述:
deepflow-agent 所采集的文件 IO 事件的时延下限阈值,操作系统中时延低于此阈值 的文件 IO 事件将被忽略。
#2.3.3.1.3 启用虚拟文件采集
标签:
agent_restart
FQCN:
inputs.ebpf.file.io_event.enable_virtual_file_collect
默认值:
inputs:
ebpf:
file:
io_event:
enable_virtual_file_collect: false
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
当设置为 true 时,deepflow-agent 将采集发生在虚拟文件系统上的文件 I/O 事件(例如 /proc、/sys、/run 等由内核动态生成的伪文件系统)。 当设置为 false 时,将不会采集虚拟文件系统上的文件 I/O 事件。
#2.3.4 Profile
#2.3.4.1 栈回溯
#2.3.4.1.1 禁用 DWARF 栈回溯
标签:
hot_update
FQCN:
inputs.ebpf.profile.unwinding.dwarf_disabled
Upgrade from old version: static_config.ebpf.dwarf-disabled
默认值:
inputs:
ebpf:
profile:
unwinding:
dwarf_disabled: true
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
默认设置为 true,将禁用 DWARF 栈回溯,对所有进程使用基于帧指针的回溯,如果进程不包含帧指针将无法显示正常的栈。
设置为 false 将对所有不包含帧指针的进程启用 DWARF 回溯。采集器使用启发式算法判断待剖析进程是否包含帧指针。
设置 dwarf_regex 后,将强制对匹配的进程使用 DWARF 回溯。
#2.3.4.1.2 DWARF 回溯进程匹配正则表达式
标签:
hot_update
FQCN:
inputs.ebpf.profile.unwinding.dwarf_regex
Upgrade from old version: static_config.ebpf.dwarf-regex
默认值:
inputs:
ebpf:
profile:
unwinding:
dwarf_regex: ''
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
如设置为空,采集器将使用启发式算法判断待剖析进程是否包含帧指针,并对不包含帧指针的进程使用 DWARF 栈回溯。 如设置为合法正则表达式,采集器将不再自行推断进程是否包含帧指针,改用该正则表达式对进程名进行匹配,仅对匹配的进程使用 DWARF 帧回溯。
#2.3.4.1.3 DWARF 回溯进程表容量
标签:
hot_update
FQCN:
inputs.ebpf.profile.unwinding.dwarf_process_map_size
Upgrade from old version: static_config.ebpf.dwarf-process-map-size
默认值:
inputs:
ebpf:
profile:
unwinding:
dwarf_process_map_size: 1024
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [1, 131072] |
详细描述:
每个需要进行 DWARF 回溯的进程在该表中有一条记录,用于关联进程和回溯记录分片。 每条记录大约占 8K 内存,默认配置大约需要分配 8M 内核内存。 由于是哈希表,配置可以比最大进程号低。 该配置只在 DWARF 功能开启时生效。
#2.3.4.1.4 DWARF 回溯分片表容量
标签:
hot_update
FQCN:
inputs.ebpf.profile.unwinding.dwarf_shard_map_size
Upgrade from old version: static_config.ebpf.dwarf-shard-map-size
默认值:
inputs:
ebpf:
profile:
unwinding:
dwarf_shard_map_size: 128
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [1, 4096] |
详细描述:
DWARF 回溯记录分片数量。 每条记录大约占 1M 内存,默认配置大约需要分配 128M 内核内存。 该配置只在 DWARF 功能开启时生效。
#2.3.4.2 On-CPU
#2.3.4.2.1 Disabled
标签:
agent_restart
FQCN:
inputs.ebpf.profile.on_cpu.disabled
Upgrade from old version: static_config.ebpf.on-cpu-profile.disabled
默认值:
inputs:
ebpf:
profile:
on_cpu:
disabled: false
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
eBPF On-CPU profile 数据的采集开关。
注意:开启此功能时,需要同时在 inputs.proc.process_matcher 中进一步指定具体的进程列表,
即 inputs.proc.process_matcher.[*].enabled_features 中需要包含 ebpf.profile.on_cpu。
#2.3.4.2.2 采样频率
标签:
agent_restart
FQCN:
inputs.ebpf.profile.on_cpu.sampling_frequency
Upgrade from old version: static_config.ebpf.on-cpu-profile.frequency
默认值:
inputs:
ebpf:
profile:
on_cpu:
sampling_frequency: 99
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [1, 1000] |
详细描述:
eBPF On-CPU profile 数据的采样周期。
#2.3.4.2.3 按 CPU 聚合
标签:
agent_restart
FQCN:
inputs.ebpf.profile.on_cpu.aggregate_by_cpu
Upgrade from old version: static_config.ebpf.on-cpu-profile.cpu
默认值:
inputs:
ebpf:
profile:
on_cpu:
aggregate_by_cpu: false
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
采集 On-CPU 采样数据时,是否获取 CPUID 的开关。
true: 表示在采集 On-CPU 采样数据时获取 CPUID (On-CPU 剖析时,支持对单个 CPU 的分析)。false: 表示在采集 On-CPU 采样数据时不获取 CPUID (On-CPU 剖析时,不支持单个 CPU 的分析)。
#2.3.4.3 预处理
#2.3.4.3.1 函数栈压缩
标签:
agent_restart
FQCN:
inputs.ebpf.profile.preprocess.stack_compression
Upgrade from old version: static_config.ebpf.preprocess.stack-compression
默认值:
inputs:
ebpf:
profile:
preprocess:
stack_compression: true
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
发送数据之前压缩函数调用栈。压缩能够有效降低 agent 的内存开销、数据传输的带宽消耗、以及
ingester 的 CPU 开销,但是 Agent 也会因此消耗更多的 CPU。测试表明,将deepflow-agent 自身的
on-cpu 函数调用栈压缩,可以将带宽消耗降低 x 倍,但会使得 agent 额外消耗 y% 的 CPU。
#2.3.4.4 语言特定剖析
控制对哪些解释型语言进行剖析。禁用不使用的语言可以节省每个语言约 5-6 MB 内存。 总内存占用:~17-20 MB(全部启用),~6.1 MB(仅 Python),~5.2 MB(仅 PHP),~6.4 MB(仅 Node.js)。
#2.3.4.4.1 禁用 Python 剖析
标签:
agent_restart
FQCN:
inputs.ebpf.profile.languages.python_disabled
默认值:
inputs:
ebpf:
profile:
languages:
python_disabled: false
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
禁用 Python 解释器剖析。禁用后将不采集 Python 进程的函数调用栈, 可节省约 6.1 MB 内核内存(python_tstate_addr_map、python_unwind_info_map、python_offsets_map)。
#2.3.4.4.2 禁用 PHP 剖析
标签:
agent_restart
FQCN:
inputs.ebpf.profile.languages.php_disabled
默认值:
inputs:
ebpf:
profile:
languages:
php_disabled: false
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
禁用 PHP 解释器剖析。禁用后将不采集 PHP 进程的函数调用栈, 可节省约 5.2 MB 内核内存(php_unwind_info_map、php_offsets_map)。
#2.3.4.4.3 禁用 Node.js 剖析
标签:
agent_restart
FQCN:
inputs.ebpf.profile.languages.nodejs_disabled
默认值:
inputs:
ebpf:
profile:
languages:
nodejs_disabled: false
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
禁用 Node.js(V8)解释器剖析。禁用后将不采集 Node.js 进程的函数调用栈, 可节省约 6.4 MB 内核内存(v8_unwind_info_map)。
#2.3.4.4.4 禁用 Lua 剖析
标签:
agent_restart
FQCN:
inputs.ebpf.profile.languages.lua_disabled
默认值:
inputs:
ebpf:
profile:
languages:
lua_disabled: false
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
禁用 Lua 解释器剖析功能。禁用后将不会采集 Lua 进程的函数调用栈,可节省约 13 MB 的内核内存。 此配置项控制以下 eBPF maps 的创建:
- lua_tstate_map:缓存每线程 lua_State 栈(按线程,容量较大,约 7 MB)
- lua_lang_flags_map:记录进程 Lua/LuaJIT 类型标记(约 2.5 MB)
- lua_unwind_info_map:存储进程级 unwinding 元信息(约 3 MB)
- lua_offsets_map、luajit_offsets_map:存储 Lua/LuaJIT 结构偏移表(总计 < 2 KB)
#2.3.5 调优
#2.3.5.1 采集队列大小
标签:
agent_restart
FQCN:
inputs.ebpf.tunning.collector_queue_size
Upgrade from old version: static_config.ebpf-collector-queue-size
默认值:
inputs:
ebpf:
tunning:
collector_queue_size: 65535
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [4096, 64000000] |
详细描述:
以下 deepflow-agent 的 eBPF 数据采集队列大小(分别限制):
- 0-ebpf-to-ebpf-collector
- 1-proc-event-to-sender
- 1-profile-to-sender
#2.3.5.2 用户态工作线程数
标签:
agent_restart
FQCN:
inputs.ebpf.tunning.userspace_worker_threads
Upgrade from old version: static_config.ebpf.thread-num
默认值:
inputs:
ebpf:
tunning:
userspace_worker_threads: 1
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [1, 1024] |
详细描述:
参与用户态数据处理的工作线程数量。实际最大值为主机 CPU 逻辑核心数。
#2.3.5.3 Kick 线程 Nice 值
标签:
agent_restart
FQCN:
inputs.ebpf.tunning.kick_kern_nice
默认值:
inputs:
ebpf:
tunning:
kick_kern_nice: 0
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [-20, 19] |
详细描述:
控制每个 CPU 上 kick 线程使用的 Linux nice 值。
这些线程会在周期性定时器到期后唤醒,并通过轻量级 syscall 触发内核侧超时检查,将批量 eBPF 数据从缓冲区中推送出来。
当“指标中心”中 deepflow_tenant -> deepflow_agent_ebpf_collector
下的 metrics.period_push_max_delay 达到 199ms 时,需要关注这个
配置项。这说明周期性 push 延迟已经触发超限标记,此时可以适当降低
该配置项的取值,以提高 kick 线程的调度倾向。
更小的 nice 值意味着更高的调度倾向,更大的 nice 值意味着更低的 调度倾向。取值范围为 -20 到 19。负值可能需要 CAP_SYS_NICE 或 足够的 RLIMIT_NICE。该配置仍然可能对其他负载产生影响。
#2.3.5.4 Perf Page 数量
标签:
agent_restart
FQCN:
inputs.ebpf.tunning.perf_pages_count
Upgrade from old version: static_config.ebpf.perf-pages-count
默认值:
inputs:
ebpf:
tunning:
perf_pages_count: 128
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [32, 8192] |
详细描述:
内核共享内存占用的页数。值为 2^n (5 <= n <= 13)。用于 perf 数据传输。
如果值在 2^n 和 2^(n+1) 之间,将自动调整到最小值 2^n。
页的大小为4KB。
#2.3.5.5 内核环形队列大小
标签:
agent_restart
FQCN:
inputs.ebpf.tunning.kernel_ring_size
Upgrade from old version: static_config.ebpf.ring-size
默认值:
inputs:
ebpf:
tunning:
kernel_ring_size: 65536
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [8192, 131072] |
详细描述:
内核环形队列的大小。值为 2^n (13 <= n <= 17)。
如果值在 2^n 和 2^(n+1) 之间,将自动调整到最小值 2^n。
#2.3.5.6 最大 Socket 条目数
标签:
agent_restart
FQCN:
inputs.ebpf.tunning.max_socket_entries
Upgrade from old version: static_config.ebpf.max-socket-entries
默认值:
inputs:
ebpf:
tunning:
max_socket_entries: 131072
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [10000, 2000000] |
详细描述:
设置 socket tracking 哈希表的最大条目数,根据实际场景中的并发请求数量而定。
#2.3.5.7 Socket Map 回收阈值
标签:
agent_restart
FQCN:
inputs.ebpf.tunning.socket_map_reclaim_threshold
Upgrade from old version: static_config.ebpf.socket-map-max-reclaim
默认值:
inputs:
ebpf:
tunning:
socket_map_reclaim_threshold: 120000
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [8000, 2000000] |
详细描述:
Socket map 表条目清理阈值。
#2.3.5.8 最大 Trace 条目数
标签:
agent_restart
FQCN:
inputs.ebpf.tunning.max_trace_entries
Upgrade from old version: static_config.ebpf.max-trace-entries
默认值:
inputs:
ebpf:
tunning:
max_trace_entries: 131072
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [10000, 2000000] |
详细描述:
线程和协程追踪的最大哈希表条目数。
#2.4 资源
#2.4.1 推送间隔
标签:
hot_update
FQCN:
inputs.resources.push_interval
Upgrade from old version: platform_sync_interval
默认值:
inputs:
resources:
push_interval: 10s
2
3
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['10s', '3600s'] |
详细描述:
deepflow-agent 主动向 deepflow-server 上报/同步资源信息的时间间隔。
#2.4.2 启用云主机资源同步
标签:
hot_update
FQCN:
inputs.resources.workload_resource_sync_enabled
默认值:
inputs:
resources:
workload_resource_sync_enabled: false
2
3
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
开启开关后,deepflow-server 基于 deepflow-agent 上报的运行环境信息,生成一个云主机资源。 用于无法通过云平台 API 同步云主机资源的场景,也可用于同步非云环境中普通物理服务器的资源信息。
#2.4.3 采集专有云资源
#2.4.3.1 启用云宿主机资源
标签:
hot_update
FQCN:
inputs.resources.private_cloud.hypervisor_resource_enabled
Upgrade from old version: platform_enabled
默认值:
inputs:
resources:
private_cloud:
hypervisor_resource_enabled: false
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
开启开关后,deepflow-agent 将采集 KVM 或 Linux 宿主机中的 VM 信息和网络信息,并上报/同步至 deepflow-server。 采集的信息包括:
- raw_all_vm_xml
- raw_vm_states
- raw_ovs_interfaces
- raw_ovs_ports
- raw_brctl_show
- raw_vlan_config
#2.4.3.2 虚拟机 MAC 源
标签:
hot_update
FQCN:
inputs.resources.private_cloud.vm_mac_source
Upgrade from old version: if_mac_source
默认值:
inputs:
resources:
private_cloud:
vm_mac_source: 0
2
3
4
枚举可选值:
| Value | Note |
|---|---|
| 0 | 网卡 MAC 地址 |
| 1 | 网卡名称 |
| 2 | Qemu XML 文件 |
模式:
| Key | Value |
|---|---|
| Type | int |
详细描述:
配置 deepflow-agent 提取 VM 真实 MAC 地址的方法:
- 网卡 MAC 地址: 从 tap 接口的 MAC 地址中提取 VM 的 MAC 地址
- 网卡名称: 从 tap 接口的名字中提取 MAC 地址
- Qemu XML 文件: 从 VM XML 文件中提取 MAC 地址
#2.4.3.3 虚拟机 XML 文件夹
标签:
hot_update
FQCN:
inputs.resources.private_cloud.vm_xml_directory
Upgrade from old version: vm_xml_path
默认值:
inputs:
resources:
private_cloud:
vm_xml_directory: /etc/libvirt/qemu/
2
3
4
模式:
| Key | Value |
|---|---|
| Type | string |
| Range | [0, 100] |
详细描述:
宿主机中存放 VM XML 文件的目录
#2.4.3.4 虚拟机 MAC 映射脚本
标签:
agent_restart
FQCN:
inputs.resources.private_cloud.vm_mac_mapping_script
Upgrade from old version: static_config.tap-mac-script
默认值:
inputs:
resources:
private_cloud:
vm_mac_mapping_script: ''
2
3
4
模式:
| Key | Value |
|---|---|
| Type | string |
| Range | [0, 100] |
详细描述:
复杂环境中,TAP 网卡的 MAC 地址映射关系可以通过编写脚本实现。使用脚本时需要满足以下条件:
- if_mac_source = 2
- tap_mode = 0
- TAP 网卡的名称与虚拟机 XML 文件中的名称相同
- 脚本输出格式如下:
- tap2d283dfe,11:22:33:44:55:66
- tap2d283223,aa:bb:cc:dd:ee:ff
#2.4.4 采集 K8s 资源
#2.4.4.1 K8s 命名空间
标签:
agent_restart
FQCN:
inputs.resources.kubernetes.kubernetes_namespace
Upgrade from old version: static_config.kubernetes-namespace
默认值:
inputs:
resources:
kubernetes:
kubernetes_namespace: null
2
3
4
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
指定采集器获取 K8s 资源时的命名空间
#2.4.4.2 K8s API 资源
标签:
agent_restart
FQCN:
inputs.resources.kubernetes.api_resources
Upgrade from old version: static_config.kubernetes-resources
默认值:
inputs:
resources:
kubernetes:
api_resources:
- name: namespaces
- name: nodes
- name: pods
- name: replicationcontrollers
- name: services
- name: daemonsets
- name: deployments
- name: replicasets
- name: statefulsets
- name: ingresses
- name: configmaps
2
3
4
5
6
7
8
9
10
11
12
13
14
15
模式:
| Key | Value |
|---|---|
| Type | dict |
详细描述:
指定采集器采集的 K8s 资源。
列表中的条目格式如下: { name: string group: string version: string disabled: bool field_selector: string }
默认采集的资源如下:
- namespaces
- nodes
- pods
- replicationcontrollers
- services
- daemonsets
- deployments
- replicasets
- statefulsets
- ingresses
- configmaps
禁用某个资源,在列表中添加 disabled: true 的条目:
inputs:
resources:
kubernetes:
api_resources:
- name: services
disabled: true
2
3
4
5
6
启用某个资源,在列表中添加该资源的条目。注意该设置会覆盖默认的资源采集。
例如,要启用在 group apps 和 apps.kruise.io 中的 statefulsets,需要添加两个条目:
inputs:
resources:
kubernetes:
api_resources:
- name: statefulsets
group: apps
- name: statefulsets
group: apps.kruise.io
version: v1beta1
2
3
4
5
6
7
8
9
要采集 openshift 中的 routes,可以使用以下设置:
inputs:
resources:
kubernetes:
api_resources:
- name: ingresses
disabled: true
- name: routes
2
3
4
5
6
7
#2.4.4.2.1 名称
标签:
agent_restart
FQCN:
inputs.resources.kubernetes.api_resources.name
Upgrade from old version: static_config.kubernetes-resources.name
默认值:
inputs:
resources:
kubernetes:
api_resources:
- name: ''
2
3
4
5
枚举可选值:
| Value | Note |
|---|---|
| namespaces | |
| nodes | |
| pods | |
| replicationcontrollers | |
| services | |
| daemonsets | |
| deployments | |
| replicasets | |
| statefulsets | |
| ingresses | |
| routes | |
| servicerules | |
| clonesets | |
| ippools | |
| opengaussclusters | |
| configmaps |
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
K8s API 资源名
#2.4.4.2.2 组
标签:
agent_restart
FQCN:
inputs.resources.kubernetes.api_resources.group
Upgrade from old version: static_config.kubernetes-resources.group
默认值:
inputs:
resources:
kubernetes:
api_resources:
- group: ''
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
K8s API 资源组
#2.4.4.2.3 版本
标签:
agent_restart
FQCN:
inputs.resources.kubernetes.api_resources.version
Upgrade from old version: static_config.kubernetes-resources.version
默认值:
inputs:
resources:
kubernetes:
api_resources:
- version: ''
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
K8s API 版本
#2.4.4.2.4 Disabled
标签:
agent_restart
FQCN:
inputs.resources.kubernetes.api_resources.disabled
Upgrade from old version: static_config.kubernetes-resources.disabled
默认值:
inputs:
resources:
kubernetes:
api_resources:
- disabled: false
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
禁用 K8s API 资源
#2.4.4.2.5 Field Selector
标签:
agent_restart
FQCN:
inputs.resources.kubernetes.api_resources.field_selector
Upgrade from old version: static_config.kubernetes-resources.field-selector
默认值:
inputs:
resources:
kubernetes:
api_resources:
- field_selector: ''
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
K8s API 资源字段选择器
#2.4.4.3 K8s API List 页大小
标签:
agent_restart
FQCN:
inputs.resources.kubernetes.api_list_page_size
Upgrade from old version: static_config.kubernetes-api-list-limit
默认值:
inputs:
resources:
kubernetes:
api_list_page_size: 1000
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [10, 4294967295] |
详细描述:
用于指定 K8s 资源获取分页大小。
#2.4.4.4 K8s API List 最大间隔
标签:
agent_restart
FQCN:
inputs.resources.kubernetes.api_list_max_interval
Upgrade from old version: static_config.kubernetes-api-list-interval
默认值:
inputs:
resources:
kubernetes:
api_list_max_interval: 10m
2
3
4
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['10m', '30d'] |
详细描述:
当 watcher 未收到更新时,获取 K8s 资源的间隔时间。
#2.4.4.5 Ingress Flavour
标签:
deprecated
FQCN:
inputs.resources.kubernetes.ingress_flavour
Upgrade from old version: static_config.ingress-flavour
默认值:
inputs:
resources:
kubernetes:
ingress_flavour: kubernetes
2
3
4
模式:
| Key | Value |
|---|---|
| Type | string |
#2.4.4.6 Pod MAC 地址采集方法
标签:
agent_restart
FQCN:
inputs.resources.kubernetes.pod_mac_collection_method
Upgrade from old version: static_config.kubernetes-poller-type
默认值:
inputs:
resources:
kubernetes:
pod_mac_collection_method: adaptive
2
3
4
枚举可选值:
| Value | Note |
|---|---|
| adaptive | |
| active | |
| passive |
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
- passive: deepflow-agent 采集 ARP/ND 数据包 计算其他 POD 的 MAC 和 IP 信息。
- active: deepflow-agent 通过 setns 进入其他 POD 的 netns 查询 MAC 和 IP 信息(部署 时需要 SYS_ADMIN 权限)。
- adaptive: deepflow-agent 优先使用 active 模式获取其他 POD 的 MAC 和 IP 信息。
#2.4.5 从控制器拉取资源
DeepFlow-server 从控制器拉取资源的配置。 DeepFlow-agent 不会读取此部分。
#2.4.5.1 云平台过滤器
标签:
hot_update
FQCN:
inputs.resources.pull_resource_from_controller.domain_filter
Upgrade from old version: domains
默认值:
inputs:
resources:
pull_resource_from_controller:
domain_filter:
- '0'
2
3
4
5
枚举可选值:
| Value | Note |
|---|---|
| DYNAMIC_OPTIONS | DYNAMIC_OPTIONS |
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
在运行过程中 deepflow-agent 周期性从 deepflow-server 获取 IP、MAC 列表,用于
向采集的观测数据注入标签。该参数可以控制向 deepflow-agent 发送的 IP、MAC 数据范围,
以减少下发的数据量。当业务系统中不存在跨云平台的服务访问时,可以配置仅向 deepflow-agent
下发本云平台的数据。参数的默认值为0,表示获取所有云平台的数据;也可以设置 lcuuid 列表,
仅获取部分云平台的数据。
#2.4.5.2 仅下发本集群中的 K8s Pod IP
标签:
hot_update
FQCN:
inputs.resources.pull_resource_from_controller.only_kubernetes_pod_ip_in_local_cluster
Upgrade from old version: pod_cluster_internal_ip
默认值:
inputs:
resources:
pull_resource_from_controller:
only_kubernetes_pod_ip_in_local_cluster: false
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
运行过程中 deepflow-agent 周期性从 deepflow-server 获取 IP、MAC 列表,用于
向采集的观测数据注入标签。该参数可以控制向 deepflow-agent 发送的 IP、MAC 数据范围,
减少下发的数据量。当 Kubernetes 内部的 POD IP 不会直接与外部通信时,可以配置仅向 deepflow-agent
下发本集群的 POD IP、MAC 数据。参数默认值为 false,表示发送全部。
#2.5 集成
#2.5.1 Enabled
标签:
hot_update
FQCN:
inputs.integration.enabled
Upgrade from old version: external_agent_http_proxy_enabled
默认值:
inputs:
integration:
enabled: true
2
3
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
开关开启后,deepflow-agent 将开启外部数据的接收服务接口,以集成来自 Prometheus、 Telegraf、OpenTelemetry 和 Skywalking、Vector 的数据。
#2.5.2 监听端口
标签:
hot_update
FQCN:
inputs.integration.listen_port
Upgrade from old version: external_agent_http_proxy_port
默认值:
inputs:
integration:
listen_port: 38086
2
3
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [1, 65535] |
详细描述:
deepflow-agent 外部数据接收服务的监听端口。
#2.5.3 压缩
#2.5.3.1 Trace
标签:
agent_restart
FQCN:
inputs.integration.compression.trace
Upgrade from old version: static_config.external-agent-http-proxy-compressed
默认值:
inputs:
integration:
compression:
trace: true
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
开启后,deepflow-agent 将对集成的追踪数据进行压缩处理,压缩比例在 5:1~10:1 之间。注意: 开启此特性将增加 deepflow-agent 的 CPU 消耗。
#2.5.3.2 Profile
标签:
agent_restart
FQCN:
inputs.integration.compression.profile
Upgrade from old version: static_config.external-agent-http-proxy-profile-compressed
默认值:
inputs:
integration:
compression:
profile: true
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
开启后,deepflow-agent 将对集成的剖析数据进行压缩处理,压缩比例在 5:1~10:1 之间。注意: 开启此特性将增加 deepflow-agent 的 CPU 消耗。
#2.5.4 Prometheus 额外 Label
deepflow-agent 支持从 Prometheus RemoteWrite 的 http header 中获取额外的 label。
#2.5.4.1 Enabled
标签:
agent_restart
FQCN:
inputs.integration.prometheus_extra_labels.enabled
Upgrade from old version: static_config.prometheus-extra-config.enabled
默认值:
inputs:
integration:
prometheus_extra_labels:
enabled: false
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
Prometheus 额外 lable 的获取开关。
#2.5.4.2 额外 Label
标签:
agent_restart
FQCN:
inputs.integration.prometheus_extra_labels.extra_labels
Upgrade from old version: static_config.prometheus-extra-config.labels
默认值:
inputs:
integration:
prometheus_extra_labels:
extra_labels: []
2
3
4
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
Prometheus 额外 label 的列表。
#2.5.4.3 Label 键总长度限制
标签:
agent_restart
FQCN:
inputs.integration.prometheus_extra_labels.label_length
Upgrade from old version: static_config.prometheus-extra-config.labels-limit
默认值:
inputs:
integration:
prometheus_extra_labels:
label_length: 1024
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | byte |
| Range | [1024, 1048576] |
详细描述:
deepflow-agent 对 Prometheus 额外 label 解析并采集时,key 字段长度总和的上限。
#2.5.4.4 Label 值总长度限制
标签:
agent_restart
FQCN:
inputs.integration.prometheus_extra_labels.value_length
Upgrade from old version: static_config.prometheus-extra-config.values-limit
默认值:
inputs:
integration:
prometheus_extra_labels:
value_length: 4096
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | byte |
| Range | [4096, 4194304] |
详细描述:
deepflow-agent 对 Prometheus 额外 label 解析并采集时,value 字段长度总和的上限。
#2.5.5 特性开关
#2.5.5.1 禁用 Profile 集成
标签:
agent_restart
FQCN:
inputs.integration.feature_control.profile_integration_disabled
Upgrade from old version: static_config.external-profile-integration-disabled
默认值:
inputs:
integration:
feature_control:
profile_integration_disabled: false
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
#2.5.5.2 禁用 Trace 集成
标签:
agent_restart
FQCN:
inputs.integration.feature_control.trace_integration_disabled
Upgrade from old version: static_config.external-trace-integration-disabled
默认值:
inputs:
integration:
feature_control:
trace_integration_disabled: false
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
#2.5.5.3 禁用 Metric 集成
标签:
agent_restart
FQCN:
inputs.integration.feature_control.metric_integration_disabled
Upgrade from old version: static_config.external-metric-integration-disabled
默认值:
inputs:
integration:
feature_control:
metric_integration_disabled: false
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
#2.5.5.4 禁用 Log 集成
标签:
agent_restart
FQCN:
inputs.integration.feature_control.log_integration_disabled
Upgrade from old version: static_config.external-log-integration-disabled
默认值:
inputs:
integration:
feature_control:
log_integration_disabled: false
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
#3. 处理器
#3.1 Packet
#3.1.1 Policy
#3.1.1.1 Fast-path 字典大小
标签:
agent_restart
FQCN:
processors.packet.policy.fast_path_map_size
Upgrade from old version: static_config.fast-path-map-size
默认值:
processors:
packet:
policy:
fast_path_map_size: 0
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [0, 10000000] |
详细描述:
设置为0时,deepflow-agent 根据 global.limits.max_memory 参数自动调整 Fast-path 字典大小。
注意:实践中不应配置小于 8000 的值。
#3.1.1.2 禁用 Fast-path
标签:
agent_restart
FQCN:
processors.packet.policy.fast_path_disabled
Upgrade from old version: static_config.fast-path-disabled
默认值:
processors:
packet:
policy:
fast_path_disabled: false
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
设置为 true 时,deepflow-agent 不启用 fast path。
#3.1.1.3 Forward 表容量
标签:
agent_restart
FQCN:
processors.packet.policy.forward_table_capacity
Upgrade from old version: static_config.forward-capacity
默认值:
processors:
packet:
policy:
forward_table_capacity: 16384
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [16384, 64000000] |
详细描述:
转发表大小,用来存储 MAC-IP 信息,调大该参数,deepflow-agent 将消耗更多的内存。
#3.1.1.4 最大 First-path 层级
标签:
agent_restart
FQCN:
processors.packet.policy.max_first_path_level
Upgrade from old version: static_config.first-path-level
默认值:
processors:
packet:
policy:
max_first_path_level: 8
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [1, 16] |
详细描述:
DDBS 算法等级。
该配置越大内存开销越小,但是性能会降低。
#3.1.2 TOA (TCP Option Address)
#3.1.2.1 Sender 队列大小
标签:
agent_restart
FQCN:
processors.packet.toa.sender_queue_size
Upgrade from old version: static_config.toa-sender-queue-size
默认值:
processors:
packet:
toa:
sender_queue_size: 65536
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [65536, 64000000] |
详细描述:
以下队列的大小:
- 1-socket-sync-toa-info-queue
#3.1.2.2 Cache 大小
标签:
agent_restart
FQCN:
processors.packet.toa.cache_size
Upgrade from old version: static_config.toa-lru-cache-size
默认值:
processors:
packet:
toa:
cache_size: 65536
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [1, 64000000] |
详细描述:
TCP Option Address 信息缓存大小。
#3.2 调用日志
#3.2.1 应用协议推断
#3.2.1.1 推断重试最大次数
标签:
agent_restart
FQCN:
processors.request_log.application_protocol_inference.inference_max_retries
Upgrade from old version: static_config.l7-protocol-inference-max-fail-count
默认值:
processors:
request_log:
application_protocol_inference:
inference_max_retries: 128
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [0, 100000] |
详细描述:
Agent 通过一张哈希表记录每一个服务端的应用协议解析结果,包括协议、持续解析失败次数、最后一次解析时间。
当一条 Flow 的应用协议从未成功解析过时,使用哈希表决定尝试解析哪些协议:
- 若没有在哈希表中查到结果,或者查到的结果不可用(协议未知,或失败次数超限,或时间距当前超过 inference_result_ttl)
- 若失败次数已经超限,则将 Flow 标记为禁止解析,禁止期为 inference_result_ttl
- 否则,遍历所有开启的应用协议,尝试解析
- 解析成功时会将协议、解析时间、失败次数(0)更新到哈希表中,使得成功的解析结果保鲜
- 解析失败时会将解析时间和失败次数(+1)更新到哈希表中,使得失败的尝试能够累计,累计超过阈值后会禁止后续尝试
- 如果在哈希表中查到了具体的、可用的协议,则使用该协议进行尝试
- 解析成功时会将协议、解析时间、失败次数(0)更新到哈希表中,使得成功的解析结果保鲜
- 解析失败时会将解析时间和失败次数(+1)更新到哈希表中,使得失败的尝试能够累计,累计超过阈值后会禁止后续尝试
当 Flow 一旦成功解析过一次,后续都仅使用该协议类型尝试解析,且无需再查询哈希表。 每次解析成功时,将会更新哈希表中的协议(针对 HTTP2/gRPC 需进行更新)、解析时间、失败次数。
#3.2.1.2 推断结果 TTL
标签:
agent_restart
FQCN:
processors.request_log.application_protocol_inference.inference_result_ttl
Upgrade from old version: static_config.l7-protocol-inference-ttl
默认值:
processors:
request_log:
application_protocol_inference:
inference_result_ttl: 60s
2
3
4
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['0ns', '1d'] |
详细描述:
deepflow-agent 会周期性标记每一个<vpc, ip, protocol, port>四元组承载的应用协议类型,以加速 后续数据的应用协议采集过程。为避免误判,应用协议类型的标记结果会周期性更新。该参数控制应用协议的更 新周期。
#3.2.1.3 推理白名单
标签:
hot_update
FQCN:
processors.request_log.application_protocol_inference.inference_whitelist
默认值:
processors:
request_log:
application_protocol_inference:
inference_whitelist:
- port_list:
- 15001
- 15006
process_name: envoy
2
3
4
5
6
7
8
模式:
| Key | Value |
|---|---|
| Type | dict |
详细描述:
应用协议端口白名单列表,目前仅支持 eBPF 流量。当 eBPF 数据在白名单列表中时,不会再使用应用表查询应用协议, 对应的应用协议通过轮训目前所有支持的协议来获取,白名单数据过多会降低 eBPF 数据的处理性能。
配置键:
- process_name: 进程名称,不支持正则表达式
- port_list: 端口白名单列表
#3.2.1.3.1 进程名称
标签:
agent_restart
FQCN:
processors.request_log.application_protocol_inference.inference_whitelist.process_name
默认值:
processors:
request_log:
application_protocol_inference:
inference_whitelist:
- process_name: ''
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
进程名称
#3.2.1.3.2 端口列表
标签:
agent_restart
FQCN:
processors.request_log.application_protocol_inference.inference_whitelist.port_list
默认值:
processors:
request_log:
application_protocol_inference:
inference_whitelist:
- port_list: []
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | int |
详细描述:
端口列表
#3.2.1.4 启用协议列表
标签:
agent_restart
FQCN:
processors.request_log.application_protocol_inference.enabled_protocols
Upgrade from old version: static_config.l7-protocol-enabled
默认值:
processors:
request_log:
application_protocol_inference:
enabled_protocols:
- HTTP
- HTTP2
- MySQL
- Redis
- Kafka
- DNS
- TLS
2
3
4
5
6
7
8
9
10
11
枚举可选值:
| Value | Note |
|---|---|
| DYNAMIC_OPTIONS |
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
deepflow-agent 仅对列表内的应用协议进行数据采集。通过该参数可以控制 agent 的数据采集范围以 降低资源消耗。
#3.2.1.5 协议特殊配置
#3.2.1.5.1 Oracle
#3.2.1.5.1.1 Integer 字节序
标签:
agent_restart
FQCN:
processors.request_log.application_protocol_inference.protocol_special_config.oracle.is_be
Upgrade from old version: static_config.oracle-parse-config.is-be
默认值:
processors:
request_log:
application_protocol_inference:
protocol_special_config:
oracle:
is_be: true
2
3
4
5
6
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
如果环境中 Oracle 整数编码采用大端字节序,则开启此开关。
#3.2.1.5.1.2 Integer 压缩
标签:
agent_restart
FQCN:
processors.request_log.application_protocol_inference.protocol_special_config.oracle.int_compressed
Upgrade from old version: static_config.oracle-parse-config.int-compress
默认值:
processors:
request_log:
application_protocol_inference:
protocol_special_config:
oracle:
int_compressed: true
2
3
4
5
6
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
如果环境中 Oracle 整数编码采用压缩,则开启此开关。
#3.2.1.5.1.3 0x04 响应携带额外字节
标签:
agent_restart
FQCN:
processors.request_log.application_protocol_inference.protocol_special_config.oracle.resp_0x04_extra_byte
Upgrade from old version: static_config.oracle-parse-config.resp-0x04-extra-byte
默认值:
processors:
request_log:
application_protocol_inference:
protocol_special_config:
oracle:
resp_0x04_extra_byte: false
2
3
4
5
6
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
在不同的 Oracle 版本中,ID 为 0x04 的响应会有不同的数据结构,如果环境中该响应数据的
影响行数前有 1byte 的额外数据,请开启此开关。
#3.2.1.5.2 MySQL
#3.2.1.5.2.1 解压 MySQL 数据包
标签:
agent_restart
FQCN:
processors.request_log.application_protocol_inference.protocol_special_config.mysql.decompress_payload
默认值:
processors:
request_log:
application_protocol_inference:
protocol_special_config:
mysql:
decompress_payload: true
2
3
4
5
6
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
部分 MySQL 数据包采用 LZ77 压缩,开启此选项后,agent 在解析时会对数据包进行解压。 设置为 false 以关闭解压,提升性能。 参考:MySQL Source Code Documentation (opens new window)
#3.2.1.5.2.2 提取 Endpoint 开关
标签:
agent_restart
FQCN:
processors.request_log.application_protocol_inference.protocol_special_config.mysql.endpoint_disabled
默认值:
processors:
request_log:
application_protocol_inference:
protocol_special_config:
mysql:
endpoint_disabled: false
2
3
4
5
6
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
关闭后不会提取 SQL 语句中的动作和表名放入 endpoint 中,目前支持从如下 SQL 语句中提取:
- SELECT * FROM users;
- INSERT INTO users VALUES (DEFAULT, '张三', 'zhang@example.com', 25);
- UPDATE users SET age = 18;
- DELETE FROM users WHERE id = 5;
- CREATE TABLE users ( id INT PRIMARY KEY AUTO_INCREMENT, age INT,);
- DROP TABLE users;
- ALTER TABLE users ADD COLUMN phone VARCHAR(20);
- MySQL 登陆用户名
#3.2.1.5.3 Grpc
#3.2.1.5.3.1 开启解析 gRPC stream 数据
标签:
agent_restart
FQCN:
processors.request_log.application_protocol_inference.protocol_special_config.grpc.streaming_data_enabled
默认值:
processors:
request_log:
application_protocol_inference:
protocol_special_config:
grpc:
streaming_data_enabled: false
2
3
4
5
6
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
开启后所有 gRPC 数据包都认为是 stream 类型,并且会将 data 类型数据包上报,同时延迟计算的响应使用带有 grpc-status 字段的。
#3.2.1.6 自定义协议解析
标签:
FQCN:
processors.request_log.application_protocol_inference.custom_protocols
默认值:
processors:
request_log:
application_protocol_inference:
custom_protocols: []
2
3
4
模式:
| Key | Value |
|---|---|
| Type | dict |
详细描述:
deprecated
#3.2.2 过滤器
#3.2.2.1 端口号预过滤器
标签:
agent_restart
FQCN:
processors.request_log.filters.port_number_prefilters
Upgrade from old version: static_config.l7-protocol-ports
默认值:
processors:
request_log:
filters:
port_number_prefilters:
AMQP: 1-65535
Custom: 1-65535
DNS: 53,5353
Dubbo: 1-65535
FastCGI: 1-65535
HTTP: 1-65535
HTTP2: 1-65535
ISO8583: 1-65535
Kafka: 1-65535
MQTT: 1-65535
Memcached: 11211
MongoDB: 1-65535
MySQL: 1-65535
NATS: 1-65535
NetSign: 1-65535
OpenWire: 1-65535
Oracle: 1521
PING: 1-65535
PostgreSQL: 1-65535
Pulsar: 1-65535
Redis: 1-65535
RocketMQ: 1-65535
SofaRPC: 1-65535
SomeIP: 1-65535
TLS: 443,6443
Tars: 1-65535
WebSphereMQ: 1-65535
ZMTP: 1-65535
bRPC: 1-65535
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
枚举可选值:
| Value | Note |
|---|---|
| DYNAMIC_OPTIONS |
模式:
| Key | Value |
|---|---|
| Type | dict |
详细描述:
配置样例:
HTTP: 80,1000-2000
HTTP2: 1-65535
2
注意:
- 该参数中,HTTP2 和 TLS 协议的配置仅对 Kprobe 有效,对 Uprobe 无效;
- 支持协议:https://www.deepflow.io/docs/zh/features/l7-protocols/overview/ (opens new window)
- Oracle 和 TLS 仅在企业版中支持。
- 如需控制
gRPC协议,请使用HTTP2配置。
#3.2.2.2 Tag 过滤器
标签:
agent_restart
FQCN:
processors.request_log.filters.tag_filters
Upgrade from old version: static_config.l7-log-blacklist
默认值:
processors:
request_log:
filters:
tag_filters:
AMQP: []
Custom: []
DNS: []
Dubbo: []
FastCGI: []
HTTP: []
HTTP2: []
ISO8583: []
Kafka: []
MQTT: []
Memcached: []
MongoDB: []
MySQL: []
NATS: []
NetSign: []
OpenWire: []
Oracle: []
PING: []
PostgreSQL: []
Pulsar: []
Redis: []
RocketMQ: []
SOFARPC: []
SomeIP: []
TLS: []
Tars: []
WebSphereMQ: []
ZMTP: []
bRPC: []
gRPC: []
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
枚举可选值:
| Value | Note |
|---|---|
| DYNAMIC_OPTIONS |
模式:
| Key | Value |
|---|---|
| Type | dict |
详细描述:
控制不同应用协议数据采集时的 Tag。协议名不区分大小写。 Tag filter 配置例子:
processors:
request_log:
filters:
tag_filters:
HTTP:
- field_name: request_resource # endpoint, request_type, request_domain, request_resource
operator: equal # equal, prefix
value: somevalue
HTTP2: []
# 其他协议
2
3
4
5
6
7
8
9
10
#3.2.2.2.1 $HTTP Tag 过滤器
标签:
agent_restart
FQCN:
processors.request_log.filters.tag_filters.HTTP
Upgrade from old version: static_config.l7-log-blacklist.$protocol
默认值:
processors:
request_log:
filters:
tag_filters:
HTTP: []
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | dict |
详细描述:
HTTP Tag filter example:
processors:
request_log:
filters:
tag_filters:
HTTP:
- field_name: request_resource # endpoint, request_type, request_domain, request_resource
operator: equal # equal, prefix
value: somevalue
2
3
4
5
6
7
8
A l7_flow_log tag_filter can be configured for each protocol, preventing request logs matching the blacklist from being collected by the agent or included in application performance metrics. It's recommended to only place non-business request logs like heartbeats or health checks in this blacklist. Including business request logs might lead to breaks in the distributed tracing tree.
Supported protocols: https://www.deepflow.io/docs/features/l7-protocols/overview/
Oracle and TLS is only supported in the Enterprise Edition.
#3.2.2.2.1.1 字段名
标签:
agent_restart
FQCN:
processors.request_log.filters.tag_filters.HTTP.field_name
Upgrade from old version: static_config.l7-log-blacklist.$protocol.field-name
默认值:
processors:
request_log:
filters:
tag_filters:
HTTP:
- field_name: ''
2
3
4
5
6
枚举可选值:
| Value | Note |
|---|---|
| endpoint | |
| request_type | |
| request_domain | |
| request_resource |
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
匹配字段名
#3.2.2.2.1.2 匹配操作符
标签:
agent_restart
FQCN:
processors.request_log.filters.tag_filters.HTTP.operator
Upgrade from old version: static_config.l7-log-blacklist.$protocol.operator
默认值:
processors:
request_log:
filters:
tag_filters:
HTTP:
- operator: ''
2
3
4
5
6
枚举可选值:
| Value | Note |
|---|---|
| equal | |
| prefix |
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
匹配操作符
#3.2.2.2.1.3 字段值
标签:
agent_restart
FQCN:
processors.request_log.filters.tag_filters.HTTP.field_value
Upgrade from old version: static_config.l7-log-blacklist.$protocol.value
默认值:
processors:
request_log:
filters:
tag_filters:
HTTP:
- field_value: ''
2
3
4
5
6
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
匹配字段值。
#3.2.2.3 不关心的 DNS NXDOMAIN 错误
标签:
hot_update
FQCN:
processors.request_log.filters.unconcerned_dns_nxdomain_response_suffixes
Upgrade from old version: static_config.l7-protocol-advanced-features.unconcerned-dns-nxdomain-response-suffixes
默认值:
processors:
request_log:
filters:
unconcerned_dns_nxdomain_response_suffixes: []
2
3
4
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
配置该参数后,当系统中 DNS 响应异常为 Non-Existent Domain,且响应结果中的后缀与参数中的字段
匹配时, deepflow-agent 会将 DNS 响应码置为0,响应状态置为正常。
该特性用于忽略特定的 Non-Existent Domain 类型的 DNS 响应,比如 K8s Pod 解析外部域名时,会将
待解析域名与 cluster 内的域名后缀做拼接并多次尝试解析,因而会产生多次的 Non-Existent Domain
的响应结果,干扰数据分析。
#3.2.2.4 cBPF data disabled
标签:
hot_update
FQCN:
processors.request_log.filters.cbpf_disabled
默认值:
processors:
request_log:
filters:
cbpf_disabled: false
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
关闭后 deepflow-agent 将停止从 packet 数据生成调用日志。
#3.2.3 超时设置
#3.2.3.1 TCP 调用超时时间
标签:
agent_restart
FQCN:
processors.request_log.timeouts.tcp_request_timeout
Upgrade from old version: static_config.rrt-tcp-timeout
默认值:
processors:
request_log:
timeouts:
tcp_request_timeout: 300s
2
3
4
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['10s', '3600s'] |
详细描述:
deepflow-agent 采集 TCP 承载的应用调用时等待响应消息的最大时长,如果响应与请求之间的时间差超过
该参数值,该次调用将被识别为超时。该参数需大于配置 processors.request_log.timeouts.session_aggregate
中 TCP 类型的超时时间(例如 HTTP2 默认值 120s),并小于 3600s。
#3.2.3.2 UDP 调用超时时间
标签:
agent_restart
FQCN:
processors.request_log.timeouts.udp_request_timeout
Upgrade from old version: static_config.rrt-udp-timeout
默认值:
processors:
request_log:
timeouts:
udp_request_timeout: 150s
2
3
4
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['10s', '300s'] |
详细描述:
deepflow-agent 采集 UDP 承载的应用调用时等待响应消息的最大时长,如果响应与请求之间的时间差超过该参数值,该次调用将被识别为超时。
该参数需大于配置 processors.request_log.timeouts.session_aggregate 中 UDP 类型的超时时间(例如 DNS 默认值 15s),并小于 300s。
#3.2.3.3 会话合并窗口时长
标签:
agent_restart deprecated
FQCN:
processors.request_log.timeouts.session_aggregate_window_duration
Upgrade from old version: static_config.l7-log-session-aggr-timeout
默认值:
processors:
request_log:
timeouts:
session_aggregate_window_duration: 120s
2
3
4
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['20s', '300s'] |
详细描述:
应用调用日志请求、响应合并的时间窗口,超出该时间窗口的响应将不与请求合并,而是单独生成一条调用日志。
#3.2.3.4 应用会话合并超时设置
标签:
hot_update
FQCN:
processors.request_log.timeouts.session_aggregate
默认值:
processors:
request_log:
timeouts:
session_aggregate: []
2
3
4
模式:
| Key | Value |
|---|---|
| Type | dict |
详细描述:
设置每个应用的超时时间。 DNS 和 TLS 默认 15s,其他协议默认 120s。
示例:
processors:
request_log:
timeouts:
session_aggregate:
- protocol: DNS
timeout: 15s
- protocol: HTTP2
timeout: 120s
2
3
4
5
6
7
8
#3.2.3.4.1 协议
标签:
hot_update
FQCN:
processors.request_log.timeouts.session_aggregate.protocol
默认值:
processors:
request_log:
timeouts:
session_aggregate:
- protocol: ''
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
用于设置超时时间的协议名称。
#3.2.3.4.2 超时时间
标签:
agent_restart
FQCN:
processors.request_log.timeouts.session_aggregate.timeout
默认值:
processors:
request_log:
timeouts:
session_aggregate:
- timeout: 0
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | duration |
详细描述:
设置应用的超时时间。TCP 类型的应用协议超时时间需要小于 processors.request_log.timeouts.tcp_request_timeout,
UDP 类型的应用协议超时时间需要小于 processors.request_log.timeouts.udp_request_timeout。
#3.2.4 标签提取
#3.2.4.1 Tracing 标签
#3.2.4.1.1 HTTP 真实客户端
标签:
hot_update
FQCN:
processors.request_log.tag_extraction.tracing_tag.http_real_client
Upgrade from old version: http_log_proxy_client
默认值:
processors:
request_log:
tag_extraction:
tracing_tag:
http_real_client:
- X_Forwarded_For
2
3
4
5
6
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
配置该参数后,deepflow-agent 会尝试从 HTTP header 中匹配特征字段,并将匹配到
的结果填充到应用调用日志的http_proxy_client字段中,作为调用链追踪的特征值。
如果指定多个值,优先级从前到后降低。插件重写的字段优先级最高。
#3.2.4.1.2 X-Request-ID
标签:
hot_update
FQCN:
processors.request_log.tag_extraction.tracing_tag.x_request_id
Upgrade from old version: http_log_x_request_id
默认值:
processors:
request_log:
tag_extraction:
tracing_tag:
x_request_id:
- X_Request_ID
2
3
4
5
6
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
配置该参数后,deepflow-agent 会尝试从 HTTP header 中匹配特征字段,并将匹配到
的结果填充到应用调用日志的x_request_id字段中,作为调用链追踪的特征值。
如果指定多个值,优先级从前到后降低。插件重写的字段优先级最高。
#3.2.4.1.3 APM TraceID
标签:
hot_update
FQCN:
processors.request_log.tag_extraction.tracing_tag.apm_trace_id
Upgrade from old version: http_log_trace_id
默认值:
processors:
request_log:
tag_extraction:
tracing_tag:
apm_trace_id:
- traceparent
- sw8
2
3
4
5
6
7
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
配置该参数后,deepflow-agent 会尝试从 HTTP 和 RPC header 中匹配特征字段,并将匹配到
的结果填充到应用调用日志的trace_id字段中,作为调用链追踪的特征值。参数支持填写多个不同的
特征字段,中间用,分隔。
如果指定多个值,优先级从前到后降低。插件重写的字段优先级最高。
支持从如下 Header 中提取 trace id,其格式如下:
- traceparent: 00-TRACEID-SPANID-01
- sw3: SEGMENTID|SPANID|100|100|#IPPORT|#PARENT_ENDPOINT|#ENDPOINT|TRACEID|SAMPLING
- sw6: 1-TRACEID-SEGMENTID-3-5-2-IPPORT-ENTRYURI-PARENTURI
- sw8: 1-TRACEID-SEGMENTID-3-PARENT_SERVICE-PARENT_INSTANCE-PARENT_ENDPOINT-IPPORT
- uber-trace-id: TRACEID:SPANID:PARENTSPANID:FLAGS
- b3: TRACEID-SPANID-1
#3.2.4.1.4 Copy APM TraceID
标签:
hot_update
FQCN:
processors.request_log.tag_extraction.tracing_tag.copy_apm_trace_id
默认值:
processors:
request_log:
tag_extraction:
tracing_tag:
copy_apm_trace_id: false
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
设置为 true 时,将会抄写 APM TraceID 至 attribute.apm_trace_id 字段中。
#3.2.4.1.5 APM SpanID
标签:
hot_update
FQCN:
processors.request_log.tag_extraction.tracing_tag.apm_span_id
Upgrade from old version: http_log_span_id
默认值:
processors:
request_log:
tag_extraction:
tracing_tag:
apm_span_id:
- traceparent
- sw8
2
3
4
5
6
7
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
配置该参数后,deepflow-agent 会尝试从 HTTP 和 RPC header 中匹配特征字段,并将匹配到
的结果填充到应用调用日志的span_id字段中,作为调用链追踪的特征值。参数支持填写多个不同的
特征字段,中间用,分隔。
如果指定多个值,优先级从前到后降低。插件重写的字段优先级最高。
支持从如下 Header 中提取 span id,其格式如下:
- traceparent: 00-TRACEID-SPANID-01
- sw3: SEGMENTID|SPANID|100|100|#IPPORT|#PARENT_ENDPOINT|#ENDPOINT|TRACEID|SAMPLING
- sw6: 1-TRACEID-SEGMENTID-3-5-2-IPPORT-ENTRYURI-PARENTURI
- sw8: 1-TRACEID-SEGMENTID-3-PARENT_SERVICE-PARENT_INSTANCE-PARENT_ENDPOINT-IPPORT
- uber-trace-id: TRACEID:SPANID:PARENTSPANID:FLAGS
- b3: TRACEID-SPANID-1
#3.2.4.2 HTTP 端点
#3.2.4.2.1 禁用提取
标签:
agent_restart
FQCN:
processors.request_log.tag_extraction.http_endpoint.extraction_disabled
Upgrade from old version: static_config.l7-protocol-advanced-features.http-endpoint-extraction.disabled
默认值:
processors:
request_log:
tag_extraction:
http_endpoint:
extraction_disabled: false
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
默认值为false,表示开启 HTTP 协议的 endpoint 提取功能;设置为true时,表示关闭该功能。
#3.2.4.2.2 匹配规则
标签:
agent_restart
FQCN:
processors.request_log.tag_extraction.http_endpoint.match_rules
Upgrade from old version: static_config.l7-protocol-advanced-features.http-endpoint-extraction.match-rules
默认值:
processors:
request_log:
tag_extraction:
http_endpoint:
match_rules:
- keep_segments: 2
url_prefix: ''
2
3
4
5
6
7
模式:
| Key | Value |
|---|---|
| Type | dict |
详细描述:
HTTP 协议的 endpoint 提取遵循如下规则:
- 最长匹配原则:优先匹配最长的前缀;
- 提取 URL 最前的数段(段数由参数确定,默认值为 2)作为 endpoint。
比如,URL 为
/a/b/c?query=xxx,deepflow-agent 默认提取/a/b作为 endpoint。
#3.2.4.2.2.1 URL 前缀
标签:
agent_restart
FQCN:
processors.request_log.tag_extraction.http_endpoint.match_rules.url_prefix
Upgrade from old version: static_config.l7-protocol-advanced-features.http-endpoint-extraction.match-rules.prefix
默认值:
processors:
request_log:
tag_extraction:
http_endpoint:
match_rules:
- url_prefix: ''
2
3
4
5
6
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
HTTP URL 前缀。
#3.2.4.2.2.2 截取 Segment 数
标签:
agent_restart
FQCN:
processors.request_log.tag_extraction.http_endpoint.match_rules.keep_segments
Upgrade from old version: static_config.l7-protocol-advanced-features.http-endpoint-extraction.match-rules.keep-segments
默认值:
processors:
request_log:
tag_extraction:
http_endpoint:
match_rules:
- keep_segments: 0
2
3
4
5
6
模式:
| Key | Value |
|---|---|
| Type | int |
详细描述:
截取 URL 的段数。
#3.2.4.3 自定义字段
标签:
agent_restart
FQCN:
processors.request_log.tag_extraction.custom_fields
Upgrade from old version: static_config.l7-protocol-advanced-features.extra-log-fields
默认值:
processors:
request_log:
tag_extraction:
custom_fields:
HTTP: []
HTTP2: []
2
3
4
5
6
枚举可选值:
| Value | Note |
|---|---|
| HTTP | |
| HTTP2 |
模式:
| Key | Value |
|---|---|
| Type | dict |
详细描述:
配置 HTTP、HTTP2、gRPC 等协议的额外提取字段。
示例:
processors:
request_log:
tag_extraction:
custom_fields:
HTTP:
- field_name: "user-agent"
- field_name: "cookie"
2
3
4
5
6
7
注意:如需配置gRPC协议,使用HTTP2匹配。
#3.2.4.3.1 $HTTP 自定义字段
标签:
agent_restart
FQCN:
processors.request_log.tag_extraction.custom_fields.HTTP
Upgrade from old version: static_config.l7-protocol-advanced-features.extra-log-fields.$protocol
默认值:
processors:
request_log:
tag_extraction:
custom_fields:
HTTP: []
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | dict |
详细描述:
配置 HTTP、HTTP2、gRPC 等协议的额外提取字段。
示例:
processors:
request_log:
tag_extraction:
custom_fields:
HTTP:
- field_name: "user-agent"
- field_name: "cookie"
2
3
4
5
6
7
注意:如需配置gRPC协议,使用HTTP2。
#3.2.4.3.1.1 字段名
标签:
agent_restart
FQCN:
processors.request_log.tag_extraction.custom_fields.HTTP.field_name
Upgrade from old version: static_config.l7-protocol-advanced-features.extra-log-fields.$protocol.field-name
默认值:
processors:
request_log:
tag_extraction:
custom_fields:
HTTP:
- field_name: ''
2
3
4
5
6
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
字段名
#3.2.4.4 自定义协议解析
标签:
FQCN:
processors.request_log.tag_extraction.custom_field_policies
默认值:
processors:
request_log:
tag_extraction:
custom_field_policies: []
2
3
4
模式:
| Key | Value |
|---|---|
| Type | dict |
详细描述:
deprecated
#3.2.4.5 脱敏协议列表
标签:
agent_restart
FQCN:
processors.request_log.tag_extraction.obfuscate_protocols
Upgrade from old version: static_config.l7-protocol-advanced-features.obfuscate-enabled-protocols
默认值:
processors:
request_log:
tag_extraction:
obfuscate_protocols:
- Redis
2
3
4
5
枚举可选值:
| Value | Note |
|---|---|
| MySQL | |
| PostgreSQL | |
| HTTP | |
| HTTP2 | |
| Redis |
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
配置该参数后,deepflow-agent 将在采集时对特定应用协议的关键数据做脱敏处理。 脱敏字段主要包括:
- 授权信息
- 各类语句中的 value 信息
#3.2.4.6 原始数据
Control the extraction of raw data corresponding to the L7 logs
#3.2.4.6.1 提取的请求头长度
标签:
agent_restart
FQCN:
processors.request_log.tag_extraction.raw.error_request_header
默认值:
processors:
request_log:
tag_extraction:
raw:
error_request_header: 0
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [0, 16384] |
详细描述:
当设置为大于 0 的值时,对于状态异常的调用日志,自动采集请求 Header(截断到 $error_request_header 字节)到 attribute.request_header, 因如下原因此功能仅建议临时使用:
- 一方面直接存储 Header 有一定的敏感信息暴露风险,可能导致合规问题
- 另一方面也会导致(目前仅 HTTP 协议)所有 Request Header 被缓存,直到等到解析到 Response 状态才能判断是否发送,消耗采集器资源
#3.2.4.6.2 提取的请求头长度
标签:
agent_restart
FQCN:
processors.request_log.tag_extraction.raw.error_response_header
默认值:
processors:
request_log:
tag_extraction:
raw:
error_response_header: 0
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [0, 16384] |
详细描述:
当设置为大于 0 的值时,对于状态异常的调用日志,自动采集响应 Header(截断到 $error_response_header 字节)到 attribute.response_header。
#3.2.4.6.3 提取的响应头长度
标签:
agent_restart
FQCN:
processors.request_log.tag_extraction.raw.error_request_payload
默认值:
processors:
request_log:
tag_extraction:
raw:
error_request_payload: 0
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [0, 16384] |
详细描述:
当设置为大于 0 的值时,对于状态异常的调用日志,自动采集请求 Payload(截断到 $error_request_payload)到 attribute.request_payload,因以下原因此功能仅建议临时使用:
- 一方面直接存储 Payload 有一定的敏感信息暴露风险,可能导致合规问题
- 另一方面也会导致(目前仅 HTTP 协议)所有 Request Payload 被缓存,直到等到解析到 Response 状态才能判断是否发送, 消耗采集器资源
#3.2.4.6.4 提取的请求头长度
标签:
agent_restart
FQCN:
processors.request_log.tag_extraction.raw.error_response_payload
默认值:
processors:
request_log:
tag_extraction:
raw:
error_response_payload: 256
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [0, 16384] |
详细描述:
默认值为 256,表示采集异常响应 Payload 的前 256 字节,放到 attribute.response_payload 当设置为 0 时,表示不采集 异常响应 Payload
#3.2.5 调优
#3.2.5.1 Payload 截取
标签:
hot_update
FQCN:
processors.request_log.tunning.payload_truncation
Upgrade from old version: l7_log_packet_size
默认值:
processors:
request_log:
tunning:
payload_truncation: 1024
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | byte |
| Range | [256, 65535] |
详细描述:
应用调用日志采集解析的最大 payload 长度。注意实际的值小于 inputs.cbpf.tunning.max_capture_packet_size。
注意:eBPF 数据的 payload 可解析长度上限为 16384 Byte。
#3.2.5.2 会话聚合桶容量
标签:
agent_restart deprecated
FQCN:
processors.request_log.tunning.session_aggregate_slot_capacity
Upgrade from old version: static_config.l7-log-session-slot-capacity
默认值:
processors:
request_log:
tunning:
session_aggregate_slot_capacity: 1024
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [1024, 1000000] |
详细描述:
默认情况下,2 分钟缓存窗口中的单向 l7_flow_log 将被聚合成双向的 request_log(会话)。 聚合时的槽位大小为 5 秒。该配置用于指定每个时间槽中最多可以缓存多少个单向的 l7_flow_log 条目。
如果某个时间槽中的 l7_flow_log 条目数量超过该配置,则该时间槽中 10% 的 l7_flow_log 条目将被 LRU 策略淘汰以减少内存占用。注意,被淘汰的 l7_flow_log 条目不会被丢弃,而是作为单向的 request_log 发送给 deepflow-server。
以下指标可以作为调整该配置的参考数据:
- Metric
deepflow_tenant.deepflow_agent_l7_session_aggr.cached-request-resource用于记录当前时刻所有时间槽中缓存的 request_resource 字段占用的总内存,单位为字节。 - Metric
deepflow_tenant.deepflow_agent_l7_session_aggr.over-limit用于记录达到 LRU 容量限制并触发淘汰的次数。
#3.2.5.3 会话聚合最大条目数
标签:
hot_update
FQCN:
processors.request_log.tunning.session_aggregate_max_entries
默认值:
processors:
request_log:
tunning:
session_aggregate_max_entries: 65536
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [16384, 10000000] |
详细描述:
会话聚合最大条目数。
如果 l7_flow_log 条目总数超过该配置,最老的条目将被丢弃,并设置其 response 状态为 Unknown。
#3.2.5.4 应用指标时间一致性开关
标签:
agent_restart
FQCN:
processors.request_log.tunning.consistent_timestamp_in_l7_metrics
默认值:
processors:
request_log:
tunning:
consistent_timestamp_in_l7_metrics: false
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
当开关打开时对于同一个会话的请求和响应, 它们对应的指标数据会全部统计在请求所在的时间戳里
#3.3 流日志
#3.3.1 时间窗口
#3.3.1.1 最大可容忍的 Packet 延迟
标签:
agent_restart
FQCN:
processors.flow_log.time_window.max_tolerable_packet_delay
Upgrade from old version: static_config.packet-delay
默认值:
processors:
flow_log:
time_window:
max_tolerable_packet_delay: 1s
2
3
4
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['1s', '20s'] |
详细描述:
捕获的包携带的时间戳可能比当前时间晚,尤其是在流量高峰期可能延迟高达 10s。 该配置也会影响 FlowMap 聚合窗口的大小。
#3.3.1.2 额外可容忍的 Flow 延迟
标签:
agent_restart
FQCN:
processors.flow_log.time_window.extra_tolerable_flow_delay
Upgrade from old version: static_config.second-flow-extra-delay-second
默认值:
processors:
flow_log:
time_window:
extra_tolerable_flow_delay: 0s
2
3
4
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['0s', '20s'] |
详细描述:
QuadrupleGenerator 接收 flow 的额外时间延迟。 该配置会影响秒级和分钟级 QuadrupleGenerator 聚合窗口的大小。
#3.3.2 Conntrack(即 Flow Map)
#3.3.2.1 Flow Flush 间隔
标签:
agent_restart
FQCN:
processors.flow_log.conntrack.flow_flush_interval
Upgrade from old version: static_config.flow.flush-interval
默认值:
processors:
flow_log:
conntrack:
flow_flush_interval: 1s
2
3
4
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['1s', '1m'] |
详细描述:
FlowMap 中流产生延迟时间,用于在下游处理单元中增加窗口大小,避免窗口推动过快。
#3.3.2.2 Flow 生成逻辑
#3.3.2.2.1 服务端口号
标签:
agent_restart
FQCN:
processors.flow_log.conntrack.flow_generation.server_ports
Upgrade from old version: static_config.server-ports
默认值:
processors:
flow_log:
conntrack:
flow_generation:
server_ports: []
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [1, 65535] |
详细描述:
deepflow-agent 有可能会错误的判断长流的方向,如果某个端口一定是服务端端口, 可配置在此处避免误判断。
服务端判定优先级从高到低为:
- TCP Flags 中 SYN|ACK、GPID
- L7 层解析
server_ports配置- Packet 计数(发送包数多的为服务端)
#3.3.2.2.2 云流量忽略 MAC
标签:
agent_restart
FQCN:
processors.flow_log.conntrack.flow_generation.cloud_traffic_ignore_mac
Upgrade from old version: static_config.flow.ignore-tor-mac
默认值:
processors:
flow_log:
conntrack:
flow_generation:
cloud_traffic_ignore_mac: false
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
默认情况下,对云流量采集做流聚合时,deepflow-agent 会校验 MAC 地址,如果同一位置、同一条流的 上、下行数据包中的 MAC 地址不一致(非对称),将导致会话的上、下行数据无法聚合为同一条流。开启此 开关后,deepflow-agent 将在流聚合过程中不校验 MAC 地址。
#3.3.2.2.3 忽略 L2End
标签:
agent_restart
FQCN:
processors.flow_log.conntrack.flow_generation.ignore_l2_end
Upgrade from old version: static_config.flow.ignore-l2-end
默认值:
processors:
flow_log:
conntrack:
flow_generation:
ignore_l2_end: false
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
对于虚拟网络流量,流聚合仅匹配 l2end 为 true 的一端的 MAC 地址, 设置为 true
流聚合会使用全部MAC地址。
#3.3.2.3 超时设置
#3.3.2.3.1 Established
标签:
hot_update
FQCN:
processors.flow_log.conntrack.timeouts.established
Upgrade from old version: static_config.flow.established-timeout
默认值:
processors:
flow_log:
conntrack:
timeouts:
established: 300s
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['1s', '1d'] |
详细描述:
TCP 状态机的建连状态超时时长。
#3.3.2.3.2 Closing RST
标签:
hot_update
FQCN:
processors.flow_log.conntrack.timeouts.closing_rst
Upgrade from old version: static_config.flow.closing-rst-timeout
默认值:
processors:
flow_log:
conntrack:
timeouts:
closing_rst: 35s
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['1s', '1d'] |
详细描述:
Closing Reset 类型的 TCP 状态机超时。
#3.3.2.3.3 Opening RST
标签:
hot_update
FQCN:
processors.flow_log.conntrack.timeouts.opening_rst
Upgrade from old version: static_config.flow.opening-rst-timeout
默认值:
processors:
flow_log:
conntrack:
timeouts:
opening_rst: 1s
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['1s', '1d'] |
详细描述:
Opening Reset 类型的 TCP 状态机超时。
#3.3.2.3.4 Others
标签:
hot_update
FQCN:
processors.flow_log.conntrack.timeouts.others
Upgrade from old version: static_config.flow.others-timeout
默认值:
processors:
flow_log:
conntrack:
timeouts:
others: 5s
2
3
4
5
模式:
| Key | Value |
|---|---|
| Type | duration |
| Range | ['1s', '1d'] |
详细描述:
其他类型的 TCP 状态机超时。
#3.3.3 调优
#3.3.3.1 FlowMap 哈希桶
标签:
agent_restart
FQCN:
processors.flow_log.tunning.flow_map_hash_slots
Upgrade from old version: static_config.flow.flow-slots-size
默认值:
processors:
flow_log:
tunning:
flow_map_hash_slots: 131072
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [1024, 64000000] |
详细描述:
由于 FlowAggregator 是所有处理流程的第一步,该值也被广泛用于其他哈希表,如 QuadrupleGenerator、Collector 等。
#3.3.3.2 并发 Flow 数量限制
标签:
agent_restart
FQCN:
processors.flow_log.tunning.concurrent_flow_limit
Upgrade from old version: static_config.flow.flow-count-limit
默认值:
processors:
flow_log:
tunning:
concurrent_flow_limit: 65535
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [1024, 64000000] |
详细描述:
FlowMap 中存储的最大并发 Flow 数量。当 inputs.cbpf.common.capture_mode 为 物理网络镜像 并且该配置值小于等
于 65535 时,将会被强制设置为 u32::MAX。
#3.3.3.3 RRT 缓存容量
标签:
agent_restart
FQCN:
processors.flow_log.tunning.rrt_cache_capacity
默认值:
processors:
flow_log:
tunning:
rrt_cache_capacity: 16000
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [1024, 64000000] |
详细描述:
FlowMap 中 RRT Cache 表的容量。该表用于计算 RRT 延迟指标,过大会导致采集器内存占用高,过小会导致RRT指标缺失。
#3.3.3.4 内存池大小
标签:
agent_restart
FQCN:
processors.flow_log.tunning.memory_pool_size
Upgrade from old version: static_config.flow.memory-pool-size
默认值:
processors:
flow_log:
tunning:
memory_pool_size: 65536
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [1024, 64000000] |
详细描述:
FlowMap 内存池的大小。
#3.3.3.5 Batched Buffer 最大大小
标签:
agent_restart
FQCN:
processors.flow_log.tunning.max_batched_buffer_size
Upgrade from old version: static_config.batched-buffer-size-limit
默认值:
processors:
flow_log:
tunning:
max_batched_buffer_size: 131072
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [1024, 64000000] |
详细描述:
目前只影响 TaggedFlow 批量分配。 为避免大量的 malloc 调用,生命周期短且数量多的结构体用批量分配进行优化。 一次分配的总内存大小不会超过这个限制。 由于默认的 MMAP_THRESHOLD 是 128K,分配的内存块超过 128K 会导致 mmap 调用和页错误增加,反而降低性能,所以不推荐将该配置设置大于 128K。
#3.3.3.6 FlowAggregator 队列大小
标签:
agent_restart
FQCN:
processors.flow_log.tunning.flow_aggregator_queue_size
Upgrade from old version: static_config.flow.flow-aggr-queue-size
默认值:
processors:
flow_log:
tunning:
flow_aggregator_queue_size: 65535
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [65536, 64000000] |
详细描述:
以下队列的大小:
- 2-second-flow-to-minute-aggrer
#3.3.3.7 FlowGenerator 队列大小
标签:
agent_restart
FQCN:
processors.flow_log.tunning.flow_generator_queue_size
Upgrade from old version: static_config.flow-queue-size
默认值:
processors:
flow_log:
tunning:
flow_generator_queue_size: 65536
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [65536, 64000000] |
详细描述:
以下队列的大小:
- 1-tagged-flow-to-quadruple-generator
- 1-tagged-flow-to-app-protocol-logs
- 0-{flow_type}-{port}-packet-to-tagged-flow (flow_type: sflow, netflow)
#3.3.3.8 QuadrupleGenerator 队列大小
标签:
agent_restart
FQCN:
processors.flow_log.tunning.quadruple_generator_queue_size
Upgrade from old version: static_config.quadruple-queue-size
默认值:
processors:
flow_log:
tunning:
quadruple_generator_queue_size: 262144
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [262144, 64000000] |
详细描述:
以下队列的大小:
- 2-flow-with-meter-to-second-collector
- 2-flow-with-meter-to-minute-collector
#4. 输出
#4.1 Socket
#4.1.1 Data Socket 类型
标签:
hot_update
FQCN:
outputs.socket.data_socket_type
Upgrade from old version: collector_socket_type
默认值:
outputs:
socket:
data_socket_type: TCP
2
3
枚举可选值:
| Value | Note |
|---|---|
| TCP | |
| UDP | |
| FILE |
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
配置 deepflow-agent 向 deepflow-server 回传数据所用的 Socket 类型。在独立部署 模式下,需配置为 FILE 类型,agent 将 l4_flow_log 和 l7_flow_log 写入本地文件。
#4.1.2 RAW_UDP QoS Bypass
标签:
agent_restart
FQCN:
outputs.socket.raw_udp_qos_bypass
Upgrade from old version: static_config.enable-qos-bypass
默认值:
outputs:
socket:
raw_udp_qos_bypass: false
2
3
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
当使用 RAW_UDP 发送数据时,可以开启该特性以提升数据发送的性能。注意:(1)该特性需要 Linux Kernel >= 3.14;(2)特性开启后,发送的数据包无法被 tcpdump 捕获。
#4.1.3 使用多个 Ingester Socket
标签:
hot_update
FQCN:
outputs.socket.multiple_sockets_to_ingester
Upgrade from old version: static_config.multiple-sockets-to-ingester
默认值:
outputs:
socket:
multiple_sockets_to_ingester: false
2
3
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
当设置为 true 时,deepflow-agent 将使用多个套接字将数据发送到 Ingester, 其发送性能更高,但会给防火墙带来更大的影响。
#4.2 流日志及调用日志
#4.2.1 过滤器
#4.2.1.1 流日志采集网络类型
标签:
hot_update
FQCN:
outputs.flow_log.filters.l4_capture_network_types
Upgrade from old version: l4_log_tap_types
默认值:
outputs:
flow_log:
filters:
l4_capture_network_types:
- 0
2
3
4
5
枚举可选值:
| Value | Note |
|---|---|
| -1 | 关闭 |
| 0 | 所有网络类型 |
| DYNAMIC_OPTIONS | DYNAMIC_OPTIONS |
模式:
| Key | Value |
|---|---|
| Type | int |
详细描述:
将被存储的流日志采集网络类型列表。
#4.2.1.2 调用日志采集网络类型
标签:
hot_update
FQCN:
outputs.flow_log.filters.l7_capture_network_types
Upgrade from old version: l7_log_store_tap_types
默认值:
outputs:
flow_log:
filters:
l7_capture_network_types:
- 0
2
3
4
5
枚举可选值:
| Value | Note |
|---|---|
| -1 | 关闭 |
| 0 | 所有网络类型 |
| DYNAMIC_OPTIONS | DYNAMIC_OPTIONS |
模式:
| Key | Value |
|---|---|
| Type | int |
详细描述:
将被存储的调用日志采集网络类型列表。
#4.2.1.3 流日志忽略的观测点
标签:
hot_update
FQCN:
outputs.flow_log.filters.l4_ignored_observation_points
Upgrade from old version: l4_log_ignore_tap_sides
默认值:
outputs:
flow_log:
filters:
l4_ignored_observation_points: []
2
3
4
枚举可选值:
| Value | Note |
|---|---|
| 0 | rest,其他网卡 |
| 1 | c,客户端网卡 |
| 2 | s,服务端网卡 |
| 4 | local,本机网卡 |
| 9 | c-nd,客户端容器节点 |
| 10 | s-nd,服务端容器节点 |
| 17 | c-hv,客户端宿主机 |
| 18 | s-hv,服务端宿主机 |
| 25 | c-gw-hv, 客户端到网关宿主机 |
| 26 | s-gw-hv, 网关宿主机到服务端 |
| 33 | c-gw,客户端到网关 |
| 34 | s-gw, 网关到服务端 |
| 41 | c-p,客户端进程 |
| 42 | s-p, 服务端进程 |
模式:
| Key | Value |
|---|---|
| Type | int |
详细描述:
配置该参数后,deepflow-agent将不采集列表中观测点的流日志(同时 TCP 时序数据、Pcap 数据
的采集也将被忽略)。默认值[]表示所有观测点均采集。
#4.2.1.4 调用日志忽略的观测点
标签:
hot_update
FQCN:
outputs.flow_log.filters.l7_ignored_observation_points
Upgrade from old version: l7_log_ignore_tap_sides
默认值:
outputs:
flow_log:
filters:
l7_ignored_observation_points: []
2
3
4
枚举可选值:
| Value | Note |
|---|---|
| 0 | rest,其他网卡 |
| 1 | c,客户端网卡 |
| 2 | s,服务端网卡 |
| 4 | local,本机网卡 |
| 9 | c-nd,客户端容器节点 |
| 10 | s-nd,服务端容器节点 |
| 17 | c-hv,客户端宿主机 |
| 18 | s-hv,服务端宿主机 |
| 25 | c-gw-hv, 客户端到网关宿主机 |
| 26 | s-gw-hv, 网关宿主机到服务端 |
| 33 | c-gw,客户端到网关 |
| 34 | s-gw, 网关到服务端 |
| 41 | c-p,客户端进程 |
| 42 | s-p, 服务端进程 |
模式:
| Key | Value |
|---|---|
| Type | int |
详细描述:
配置该参数后,deepflow-agent将不采集列表中观测点的应用调用日志。默认值[]表示所有观测点均采集。
#4.2.2 聚合器
#4.2.2.1 聚合健康检查流日志
标签:
hot_update
FQCN:
outputs.flow_log.aggregators.aggregate_health_check_l4_flow_log
默认值:
outputs:
flow_log:
aggregators:
aggregate_health_check_l4_flow_log: true
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
Agent 会将如下类型的流标记为 close_type = 正常结束-客户端重置:
- 客户端发送 SYN,服务端回复 SYN-ACK,客户端发送 RST
- 客户端发送 SYN,服务端回复 SYN-ACK,客户端发送 ACK,客户端发送 RST
此类流量是正常的负载均衡器后端主机检查检查流量,不会携带任何有意义的应用层载荷。
本配置项设置为 true 时,Agent 会将流日志的客户端端口号重置为 0 之后再聚合输出,
从而降低带宽和存储开销。
#4.2.3 限速器
#4.2.3.1 流日志限速器
标签:
hot_update
FQCN:
outputs.flow_log.throttles.l4_throttle
Upgrade from old version: l4_log_collect_nps_threshold
默认值:
outputs:
flow_log:
throttles:
l4_throttle: 10000
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | Per Second |
| Range | [100, 1000000] |
详细描述:
deepflow-agent 每秒发送的 l4_flow_log 数量上限,实际产生的日志数量超过阈值时,将 使用水库采样限制实际发送数量不超过阈值。
#4.2.3.2 调用日志限速器
标签:
hot_update
FQCN:
outputs.flow_log.throttles.l7_throttle
Upgrade from old version: l7_log_collect_nps_threshold
默认值:
outputs:
flow_log:
throttles:
l7_throttle: 10000
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Unit | Per Second |
| Range | [100, 1000000] |
详细描述:
deepflow-agent 每秒发送的 l7_flow_log 数量上限,实际发送数量超出参数值后,将开启采样。
#4.2.4 调优
#4.2.4.1 Collector 队列大小
标签:
agent_restart
FQCN:
outputs.flow_log.tunning.collector_queue_size
Upgrade from old version: static_config.flow-sender-queue-size
默认值:
outputs:
flow_log:
tunning:
collector_queue_size: 65536
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [65536, 64000000] |
详细描述:
设置如下队列的长度:
- 3-flow-to-collector-sender
- 3-protolog-to-collector-sender
#4.3 Flow 性能指标
#4.3.1 Enabled
标签:
hot_update
FQCN:
outputs.flow_metrics.enabled
Upgrade from old version: collector_enabled
默认值:
outputs:
flow_metrics:
enabled: true
2
3
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
指标数据采集总开关。关闭后 deepflow-agent 将停止所有应用调用指标、网络指标、应用 调用日志、流日志、TCP 包时序数据、Pcap 数据的采集。
#4.3.2 过滤器
#4.3.2.1 不活跃服务端端口号聚合
标签:
hot_update
FQCN:
outputs.flow_metrics.filters.inactive_server_port_aggregation
Upgrade from old version: inactive_server_port_enabled
默认值:
outputs:
flow_metrics:
filters:
inactive_server_port_aggregation: false
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
开启功能后 deepflow-agent 将对非活跃的端口(仅接收数据,不发送数据)的指标数据采集 做聚合处理,所有非活跃端口的数据聚合生成一条'server_port = 0'的指标,而不再生成每个 server_port 单独的指标。
#4.3.2.2 不活跃 IP 地址聚合
标签:
hot_update
FQCN:
outputs.flow_metrics.filters.inactive_ip_aggregation
Upgrade from old version: inactive_ip_enabled
默认值:
outputs:
flow_metrics:
filters:
inactive_ip_aggregation: false
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
开启功能后 deepflow-agent 将对非活跃 IP(仅接收数据,不发送数据)的指标数据采集做聚合 处理,所有非活跃 IP 的数据聚合生成一条'ip = 0'的指标,而不再生成每个 IP 单独的指标。
#4.3.2.3 NPM 指标
标签:
hot_update
FQCN:
outputs.flow_metrics.filters.npm_metrics
Upgrade from old version: l4_performance_enabled
默认值:
outputs:
flow_metrics:
filters:
npm_metrics: true
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
网络指标的采集开关。关闭后 deepflow-agent 停止采集除基本的吞吐类指标外的其他网络指标。
#4.3.2.4 NPM 活跃连接指标
标签:
hot_update
FQCN:
outputs.flow_metrics.filters.npm_metrics_concurrent
默认值:
outputs:
flow_metrics:
filters:
npm_metrics_concurrent: true
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
当关闭时,deepflow-agent 不计算活跃连接指标。
#4.3.2.5 APM 指标
标签:
hot_update
FQCN:
outputs.flow_metrics.filters.apm_metrics
Upgrade from old version: l7_metrics_enabled
默认值:
outputs:
flow_metrics:
filters:
apm_metrics: true
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
应用调用指标的采集开关。关闭后 deepflow-agent 停止采集全部应用调用指标。
#4.3.2.6 秒粒度指标
标签:
hot_update
FQCN:
outputs.flow_metrics.filters.second_metrics
Upgrade from old version: vtap_flow_1s_enabled
默认值:
outputs:
flow_metrics:
filters:
second_metrics: true
2
3
4
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
秒级指标的采集开关。关闭后 deepflow-agent 将停止采集秒粒度的网络指标和应用调用指标。
#4.3.3 调优
#4.3.3.1 Sender 队列大小
标签:
agent_restart
FQCN:
outputs.flow_metrics.tunning.sender_queue_size
Upgrade from old version: static_config.collector-sender-queue-size
默认值:
outputs:
flow_metrics:
tunning:
sender_queue_size: 65536
2
3
4
模式:
| Key | Value |
|---|---|
| Type | int |
| Range | [65536, 64000000] |
详细描述:
配置如下队列的大小:
- 3-doc-to-collector-sender
#4.4 压缩
#4.4.1 Application_Log
标签:
agent_restart
FQCN:
outputs.compression.application_log
默认值:
outputs:
compression:
application_log: true
2
3
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
开启后,deepflow-agent 将对集成的应用日志数据进行压缩处理,压缩比例在 5:1~20:1 之间。注意: 开启此特性将增加 deepflow-agent 的 CPU 消耗。
#4.4.2 Pcap
标签:
agent_restart
FQCN:
outputs.compression.pcap
默认值:
outputs:
compression:
pcap: true
2
3
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
开启后,deepflow-agent 将对抓取的 Pcap 数据进行压缩处理,压缩比例在 5:1~10:1 之间。注意: 开启此特性将增加 deepflow-agent 的 CPU 消耗。
#4.4.3 调用日志
标签:
agent_restart
FQCN:
outputs.compression.l7_flow_log
默认值:
outputs:
compression:
l7_flow_log: true
2
3
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
开启后,deepflow-agent 将对调用日志进行压缩处理,压缩比例在 8:1 左右。注意: 开启此特性将增加 deepflow-agent 的 CPU 消耗。
#4.4.4 流日志
标签:
agent_restart
FQCN:
outputs.compression.l4_flow_log
默认值:
outputs:
compression:
l4_flow_log: false
2
3
模式:
| Key | Value |
|---|---|
| Type | bool |
详细描述:
开启后,deepflow-agent 将对网络流日志进行压缩处理。注意: 开启此特性将增加 deepflow-agent 的 CPU 消耗。
#5. 插件
插件支持 同时匹配插件和自定义提取策略时,优先级为:
- 插件提取
- 自定义字段提取
- 采集器默认提取
#5.1 Wasm 插件列表
标签:
hot_update
FQCN:
plugins.wasm_plugins
Upgrade from old version: wasm_plugins
默认值:
plugins:
wasm_plugins: []
2
枚举可选值:
| Value | Note |
|---|---|
| DYNAMIC_OPTIONS | DYNAMIC_OPTIONS |
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
需要加载的 Wasm 插件列表。
#5.2 SO 插件列表
标签:
hot_update
FQCN:
plugins.so_plugins
Upgrade from old version: so_plugins
默认值:
plugins:
so_plugins: []
2
枚举可选值:
| Value | Note |
|---|---|
| DYNAMIC_OPTIONS | DYNAMIC_OPTIONS |
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
需要加载的 so 插件列表。
#6. 开发
#6.1 Feature Flags
标签:
agent_restart
FQCN:
dev.feature_flags
Upgrade from old version: static_config.feature-flags
默认值:
dev:
feature_flags: []
2
模式:
| Key | Value |
|---|---|
| Type | string |
详细描述:
未发布的采集器特性可以通过该选项开启。