1. Datadog
1.1. Datadog 安装与卸载
1.1.1. 卸载
https://github.com/DataDog/documentation/blob/master/content/en/agent/faq/how-do-i-uninstall-the-agent.md
1.2. 编译 datadog-agent
参考自: https://github.com/DataDog/datadog-agent
1.2.1. 环境准备
1.2.1.1. /etc/profile.d/preload.sh
#!/bin/bash
vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other -o uid=0 -o gid=0 -o umask=0022
export GOPATH=/mnt/hgfs/share/gopath
export GOBIN=/mnt/hgfs/share/gopath/bin
export PATH=$PATH:/mnt/hgfs/share/go/go/bin:$GOPATH:$GOBIN
Jetbrains全家桶1年46,售后保障稳定
1.2.1.2. 安装 pip
apt-get install python3-pip
# 或者
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py # 下载安装脚本
python3 get-pip.py
pip3 --version
1.2.2. 常见问题
1.2.2.1. go get 报错: dial tcp 142.251.43.17:443: i/o timeout
注: go 版本需要支持 mod
自动下载: go env -w GO111MODULE=on
设置环境为国内代理: go env -w GOPROXY=https://goproxy.cn,direct
1.3. Datadog 新特性
https://www.datadoghq.com/blog/dash-2021-new-feature-roundup/#infrastructure-and-network-monitoring
1.4. Datadog 源码
1.4.1. RtLoader
RtLoader is a C++ wrapper around the CPython API with a C89-compatible public API that can be used by foreing languages like Go. In order to provide support for multiple Python versions, RtLoader fully abstracts Python in order to decouple client applications and CPython. Which Python version to use can be decided at runtime, RtLoader will dlopen
the proper backend libraries accordingly.
More: https://github.com/DataDog/datadog-agent/tree/main/rtloader
1.5. Datadog 的路径
- 日志:
/var/log/datadog
- 配置文件:
/etc/datadog-agent
- 程序文件:
/opt/datadog-agent
1.6. Datadog Troubleshooting
1.6.1. status
可以查看当前运行状态: datadog-agent status
。
1.6.2. check
可以检查指定配置状态。如: datadog-agent check python
1.6.3. Unable to load a check from instance of config ‘process_agent’: JMX Check Loader: check is not a jmx check, or unable to determine if it’s so; Python Check Loader: python is not initialized;
这是由于找不到 “.so” 文件造成的。
例如 “python is not initialized” 这个错误,可以用 datadog-agent check python
命令知道是 libdatadog-agent-three.so
文件找不到(我编译的时候指定的是 Python3)。