python - conf.d/python.d/ 在 datadog-agent 中不可用
问题描述
我试图data-dog
在我的代理中安装代理以Ubuntu 20.04
使用以下命令监视 python 后端
DD_AGENT_MAJOR_VERSION=7 DD_API_KEY=xxxxxxxxx DD_SITE="datadoghq.com" bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script.sh)"
从官方文档中说
Create a file conf.yaml in the Agent’s conf.d/python.d/ directory with the following
python.d
但是里面没有找到/etc/datadog-agent/conf.d
。如果我创建了python.d/con.yaml
我是否需要做任何其他事情来启用发送日志?
解决方案
回答我自己的问题,这可能对其他人有帮助
我必须设置
logs_enabled: true
/etc/datadog-agent/datadog.yaml
然后我在里面创建python.d/conf.yaml
了以下配置
init_config:
instances:
##Log section
logs:
- type: file
path: "<PATH_TO_PYTHON_LOG>.log"
service: "<YOUR_APPLICATION>"
source: python
sourcecategory: sourcecode
# For multiline logs, if they start by the date with the format yyyy-mm-dd uncomment the following processing rule
#log_processing_rules:
# - type: multi_line
# name: new_log_start_with_date
# pattern: \d{4}\-(0?[1-9]|1[012])\-(0?[1-9]|[12][0-9]|3[01])
重启代理
sudo service datadog-agent restart
您可以在仪表板日志面板中查看您的日志
推荐阅读
- python - Pytorch:TypeError:列表不是模块子类
- docker - Docker Compose 正在运行,但浏览器中没有显示任何内容
- model-view-controller - 如何将过滤后的数据从 mvc.grid 导出到 excel 或 pdf
- gradle - gradle 添加依赖,如 npm
- node.js - 我需要有两个基于表列分组的数组响应,以便计数组对应于它的行
- javascript - Javascript - 根据另一个数组对对象数组进行排序
- vue.js - 未触发 Vuejs 指令中 gsap.scrollTrigger 的更新
- regex - 通过正则表达式匹配方法获取第一个子字符串
- c# - WebView2:单击按钮以在 WebView 窗口中显示网站
- reactjs - 电子生成器中的图像问题