Datadog 未从 Kubernetes 集群中的文件收集日志

Datadog 未从 Kubernetes 集群中的文件收集日志

我正在尝试在 AKS 集群上配置 Datadog 代理并从每个服务舱中的 /var/log/datadog/messages.log 文件位置读取日志。

它正在流式传输除文件日志之外的所有指标,在检查来自 Datadog 代理的日志后,它显示以下消息

2023-11-07 19:41:30 UTC | 核心 | 调试 |(getSource 中的 pkg/logs/internal/launchers/kubernetes/launcher.go:200)| 找到注释:[{“type”:“file”、“path”:“/var/log/datadog/messages.log”、“source”:“camp-api”、“service”:“camp-api”}],适用于 pod camp-api-b6758948f-wjfn8、容器 camp-api,但没有可用于容器日志收集的配置

不确定这里我缺少什么配置。

这是我的 --datadog 代理 pod 的 env 输出

Defaulted container "agent" out of: agent, trace-agent, process-agent, init-volume (init), init-config (init)
PATH=/opt/datadog-agent/bin/agent/:/opt/datadog-agent/embedded/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=datadog-6dg6l
DEBIAN_FRONTEND=noninteractive
DOCKER_DD_AGENT=true
DD_PYTHON_VERSION=3
CURL_CA_BUNDLE=/opt/datadog-agent/embedded/ssl/certs/cacert.pem
S6_KEEP_ENV=1
S6_LOGGING=0
S6_BEHAVIOUR_IF_STAGE2_FAILS=2
S6_READ_ONLY_ROOT=1
DD_SECRET_BACKEND_COMMAND_ALLOW_GROUP_EXEC_PERM=true
LD_PRELOAD=/lib/x86_64-linux-gnu/nosys.so
DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true
DD_LOGS_CONFIG_K8S_CONTAINER_USE_FILE=true
GODEBUG=x509ignoreCN=0
DD_CLUSTER_NAME=aks-test
DD_DOGSTATSD_PORT=8125
DD_LOGS_ENABLED=true
DD_ENV=aks-test
DD_LOG_LEVEL=DEBUG
DD_APM_ENABLED=false
DD_EXTRA_CONFIG_PROVIDERS=clusterchecks endpointschecks
KUBERNETES=yes
DD_KUBELET_CLIENT_CA=/etc/kubernetes/certs/kubeletserver.crt
DD_CLUSTER_AGENT_KUBERNETES_SERVICE_NAME=datadog-cluster-agent
DD_HEALTH_PORT=5555
DD_AUTH_TOKEN_FILE_PATH=/etc/datadog-agent/auth/token
DD_CONTAINER_EXCLUDE_LOGS=name:citadel name:galley name:cc-spring-boot-admin-server name:liveness-probe
DD_APM_IGNORE_RESOURCES=POST /instances,POST /api/v2/spans,GET /actuator,GET /.*/.*/actuator/.*
DD_PROCFS_PATH=/proc
DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true
DD_CLUSTER_AGENT_ENABLED=true
DD_API_KEY=744657120b4aea61984f3870f1ee51eb
DD_KUBERNETES_KUBELET_HOST=xxx.xxx.0.10
DD_CLUSTER_AGENT_AUTH_TOKEN=5EEi5uT4wv00LcXVjq8MIvD5JLECUVwu
DD_IGNORE_AUTOCONF=kubernetes_state
DD_KUBELET_TLS_VERIFY=false
DD_LOGS_CONFIG_AUTO_MULTI_LINE_DETECTION=false
DD_DOGSTATSD_SOCKET=/var/run/datadog/dsd.socket
DD_EXPVAR_PORT=6000
DATADOG_SERVICE_PORT_DOGSTATSDPORT=8125
DATADOG_CLUSTER_AGENT_ADMISSION_CONTROLLER_SERVICE_PORT=443
DATADOG_CLUSTER_AGENT_ADMISSION_CONTROLLER_SERVICE_HOST=xxx.xxx.xxx.191
DATADOG_CLUSTER_AGENT_ADMISSION_CONTROLLER_PORT_443_TCP_PORT=443
KUBERNETES_PORT_443_TCP=tcp://xxx.xxx.0.1:443
KUBERNETES_PORT_443_TCP_PORT=443
KUBERNETES_PORT_443_TCP_ADDR=xxx.xxx.0.1
DATADOG_CLUSTER_AGENT_PORT_5005_TCP_PORT=5005
DATADOG_SERVICE_PORT_TRACEPORT=8126
DATADOG_CLUSTER_AGENT_ADMISSION_CONTROLLER_PORT_443_TCP=tcp://xxx.xxx.xxx.191:443
DATADOG_SERVICE_HOST=xxx.xxx.228.81
DATADOG_PORT_8125_UDP_PORT=8125
DATADOG_PORT_8125_UDP_ADDR=xxx.xxx.228.81
DATADOG_PORT_8126_TCP_PORT=8126
DATADOG_CLUSTER_AGENT_ADMISSION_CONTROLLER_PORT=tcp://xxx.xxx.xxx.191:443
DATADOG_CLUSTER_AGENT_PORT=tcp://xxx.xxx.60.205:5005
DATADOG_CLUSTER_AGENT_PORT_5005_TCP_PROTO=tcp
DATADOG_CLUSTER_AGENT_PORT_5005_TCP_ADDR=xxx.xxx.60.205
DATADOG_CLUSTER_AGENT_SERVICE_HOST=xxx.xxx.60.205
DATADOG_PORT_8125_UDP=udp://xxx.xxx.228.81:8125
DATADOG_PORT_8126_TCP=tcp://xxx.xxx.228.81:8126
DATADOG_CLUSTER_AGENT_ADMISSION_CONTROLLER_PORT_443_TCP_PROTO=tcp
KUBERNETES_SERVICE_HOST=xxx.xxx.0.1
KUBERNETES_SERVICE_PORT=443
KUBERNETES_PORT=tcp://xxx.xxx.0.1:443
DATADOG_PORT_8126_TCP_ADDR=xxx.xxx.228.81
DATADOG_CLUSTER_AGENT_ADMISSION_CONTROLLER_PORT_443_TCP_ADDR=xxx.xxx.xxx.191
KUBERNETES_SERVICE_PORT_HTTPS=443
KUBERNETES_PORT_443_TCP_PROTO=tcp
DATADOG_PORT_8125_UDP_PROTO=udp
DATADOG_SERVICE_PORT=8125
DATADOG_PORT=udp://xxx.xxx.228.81:8125
DATADOG_PORT_8126_TCP_PROTO=tcp
DATADOG_CLUSTER_AGENT_SERVICE_PORT=5005
DATADOG_CLUSTER_AGENT_SERVICE_PORT_AGENTPORT=5005
DATADOG_CLUSTER_AGENT_PORT_5005_TCP=tcp://xxx.xxx.60.205:5005
HOME=/root

任何帮助将非常感激!

相关内容