Repository navigation
[core] Adding host tags via the -e flag does not work #263
Copy link
Copy link
Open
Description
**Output of the info page **
====================
Collector (v 5.17.2)
====================
Status date: 2017-11-30 19:46:20 (12s ago)
Pid: 27
Platform: Linux-4.4.0-1030-aws-x86_64-with-debian-8.9
Python Version: 2.7.13, 64bit
Logs: <stderr>, /var/log/datadog/collector.log
Clocks
======
NTP offset: 0.0032 s
System UTC time: 2017-11-30 19:46:32.949955
Paths
=====
conf.d: /etc/dd-agent/conf.d
checks.d: /opt/datadog-agent/agent/checks.d
Hostnames
=========
ec2-hostname: ip-10-0-114-178.ec2.internal
local-ipv4: 10.0.114.178
local-hostname: ip-10-0-114-178.ec2.internal
hostname: web-ops-art-hut-rap
socket-fqdn: 1acd0644f1e4
agent-hostname: web-ops-art-hut-rap
instance-id: i-0aa108455fb0da4b4
Checks
======
check_number_docker_containers (custom)
---------------------------------------
- Collected 0 metrics, 0 events & 0 service checks
check_deploy_state (custom)
---------------------------
- Collected 0 metrics, 0 events & 0 service checks
process (5.17.2)
----------------
- instance #0 [OK]
- instance #1 [OK]
- Collected 34 metrics, 0 events & 2 service checks
ntp (5.17.2)
------------
- Collected 0 metrics, 0 events & 0 service checks
disk (5.17.2)
-------------
- instance #0 [OK]
- Collected 32 metrics, 0 events & 0 service checks
docker_daemon (5.17.2)
----------------------
- instance #0 [OK]
- Collected 60 metrics, 0 events & 1 service check
Emitters
========
- http_emitter [OK]
2017-11-30 19:46:33,316 | WARNING | dd.dogstatsd | utils.service_discovery.config(config.py:31) | No configuration backend provided for service discovery. Only auto config templates will be used.
====================
Dogstatsd (v 5.17.2)
====================
Status date: 2017-11-30 19:46:31 (2s ago)
Pid: 21
Platform: Linux-4.4.0-1030-aws-x86_64-with-debian-8.9
Python Version: 2.7.13, 64bit
Logs: <stderr>, /var/log/datadog/dogstatsd.log
Flush count: 354
Packet Count: 4605
Packets per second: 2.0
Metric count: 12
Event count: 0
Service check count: 0
====================
Forwarder (v 5.17.2)
====================
Status date: 2017-11-30 19:46:31 (2s ago)
Pid: 20
Platform: Linux-4.4.0-1030-aws-x86_64-with-debian-8.9
Python Version: 2.7.13, 64bit
Logs: <stderr>, /var/log/datadog/forwarder.log
Queue Size: 417 bytes
Queue Length: 1
Flush Count: 1194
Transactions received: 896
Transactions flushed: 895
Transactions rejected: 0
API Key Status: API Key is valid
======================
Trace Agent (v 5.17.2)
======================
Pid: 19
Uptime: 3548 seconds
Mem alloc: 753584 bytes
Hostname: web-ops-art-hut-rap
Receiver: 0.0.0.0:8126
API Endpoint: https://trace.agent.datadoghq.com
Bytes sent (1 min): 0
Traces sent (1 min): 0
Stats sent (1 min): 0
Additional environment details (Operating System, Cloud provider, etc):
$ cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"
NAME="Ubuntu"
VERSION="16.04.3 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.3 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
Steps to reproduce the issue:
- run the docker container with
-e TAGS=env:staging.
According to the docs:
TAGS set host tags. Add -e TAGS=simple-tag-0,tag-key-1:tag-value-1 to use [simple-tag-0, tag-key-1:tag-value-1] as host tags.
https://github.com/DataDog/docker-dd-agent#environment-variables
- Check UI, and see that no additional tags have been set (definitely not
env:staging).
It does show up in the container env vars though.
root@1acd0644f1e4:/# env | grep TAGS
TAGS=env:ops
- Add the tag in the
datadog.confinstead. Everything works as expected.
Describe the results you received:
Do not see env:staging in the host tags.
Describe the results you expected:
Should see env:staging in the host tags.
Additional information you deem important (e.g. issue happens only occasionally):
https://github.com/DataDog/docker-dd-agent/blob/12.3.5172/config_builder.py#L61-L63
Metadata
Metadata
Assignees
Labels
No labels
Activity
hkaj commentedon Dec 4, 2017
Hi @agamdua, thanks for reaching out.
Could you try with a more recent version of the agent? I can't reproduce with 5.20.1.
I'd also be interested in seeing the command you used to run the agent. Do you have a custom entrypoint? If you pass the env var, the default entrypoint should update datadog.conf.
dmitrym0 commentedon Sep 13, 2018
Howdy, I have a very similar issue with agent v 5.26.0.
The interesting thing is that some metrics do include my tags, and some don't.
Any tips?