在容器模式下运行时,数据狗代理不会发送任何指标 - CoreOS

时间:2017-09-14 17:20:41

标签: docker coreos datadog

我在我的AWS CoreOS实例中将DataDog代理作为容器运行。这是通过将dd-agent作为容器运行来完成的。为了实现自动化,我编写了一个systemd单元,用于在AWS CoreOS实例中启用和运行数据狗代理。但是没有任何指标被发送到DataDog端。但Docker容器正在运行,没有任何问题。

这是我的Systemd单元文件

[Unit]
Description=Sample Datadog Agent
After=docker.service
Requires=docker.service

[Service]
TimeoutStartSec=0
Restart=on-failure
Environment=API_KEY={my-api-key}
Environment=ENV=sample_env

ExecStartPre=-/usr/bin/docker kill datadog
ExecStartPre=-/usr/bin/docker rm -f datadog
ExecStartPre=-/usr/bin/docker pull datadog/docker-dd-agent:11.2.583
ExecStart=/usr/bin/docker run --name datadog \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  -v /proc/:/host/proc/:ro \
  -v /cgroup/:/host/sys/fs/cgroup:ro \
  -e API_KEY=$API_KEY \
  -e TAGS=$ENV \
  datadog/docker-dd-agent:11.2.583
ExecStop=/usr/bin/docker stop datadog

[Install]
WantedBy=multi-user.target

编辑 - 添加更多信息

最初,当我在单个CoreOS实例上运行此操作时,我能够在DataDog仪表板中看到实例的docker相关度量标准。然后我在多个CoreOS AWS实例上启用了此功能。从那时起,就不会看到与CoreOS实例或Docker容器相关的指标。

编辑 - 添加泊坞日志

2017-09-14 07:48:47,497 CRIT Supervisor running as root (no user in config file)
2017-09-14 07:48:47,528 INFO RPC interface 'supervisor' initialized
2017-09-14 07:48:47,528 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2017-09-14 07:48:47,528 INFO supervisord started with pid 1
2017-09-14 07:48:48,530 INFO spawned: 'dogstatsd' with pid 11
2017-09-14 07:48:48,531 INFO spawned: 'go-metro' with pid 12
2017-09-14 07:48:48,532 INFO spawned: 'forwarder' with pid 13
2017-09-14 07:48:48,533 INFO spawned: 'collector' with pid 14
2017-09-14 07:48:48,539 INFO spawned: 'jmxfetch' with pid 15
2017-09-14 07:48:50,810 INFO success: go-metro entered RUNNING state, process has stayed up for > than 2 seconds (startsecs)
2017-09-14 07:48:51,811 INFO success: jmxfetch entered RUNNING state, process has stayed up for > than 3 seconds (startsecs)
2017-09-14 07:48:53,419 INFO exited: jmxfetch (exit status 0; expected)
2017-09-14 07:48:53,780 INFO success: dogstatsd entered RUNNING state, process has stayed up for > than 5 seconds (startsecs)
2017-09-14 07:48:53,780 INFO success: forwarder entered RUNNING state, process has stayed up for > than 5 seconds (startsecs)
2017-09-14 07:48:53,780 INFO success: collector entered RUNNING state, process has stayed up for > than 5 seconds (startsecs)
2017-09-14 07:48:53,780 INFO exited: go-metro (exit status 0; expected)

0 个答案:

没有答案