首页 > 解决方案 > 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我是否需要做任何其他事情来启用发送日志?

标签: pythondatadog

解决方案


回答我自己的问题,这可能对其他人有帮助

我必须设置

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

您可以在仪表板日志面板中查看您的日志


推荐阅读