datadog-agent icon indicating copy to clipboard operation
datadog-agent copied to clipboard

[logs-agent] Container discovery via label not working

Open blakeneyops opened this issue 8 years ago • 5 comments

Output of the info page (if this is a bug)

I don't see an info option on the new agent, so here is the output of status.

===================================
Agent (v6.0.0-beta.5+git.1.ae3b024)
===================================

  Status date: 2017-12-13 19:47:08.332946 UTC
  Pid: 7
  Python Version: 2.7.14
  Logs:
  Check Runners: 10
  Log Level: INFO

  Paths
  =====
    Config File: /etc/datadog-agent/datadog.yaml
    conf.d: /etc/datadog-agent/conf.d
    checks.d: /etc/datadog-agent/checks.d

  Clocks
  ======NTP offset: -0.00157207 s
    System UTC time: 2017-12-13 19:47:08.332946 UTC

  Host Info
  =========
    bootTime: 2017-12-11 17:57:37.000000 UTC
    kernelVersion: 4.9.62-21.56.amzn1.x86_64
    os: linux
    platform: debian
    platformFamily: debian
    platformVersion: 9.2
    procs: 60
    uptime: 169274

  Hostnames
  =========
    ec2-hostname: ip-172-26-0-54.customer.internal
    hostname: api-stg-06436c77cfda5b700
    instance-id: i-06436c77cfda5b700
    socket-fqdn: api-stg-06436c77cfda5b700.customer.internal.
    socket-hostname: api-stg-06436c77cfda5b700

=========
Collector
=========

  Running Checks
  ==============
    consul
    ------
      Total Runs: 673
      Metrics: 1, Total Metrics: 672
      Events: 0, Total Events: 0
      Service Checks: 0, Total Service Checks: 0

    cpu
    ---
      Total Runs: 673
      Metrics: 6, Total Metrics: 4026
      Events: 0, Total Events: 0
      Service Checks: 0, Total Service Checks: 0

    disk
    ----
      Total Runs: 673
      Metrics: 168, Total Metrics: over 100K
      Events: 0, Total Events: 0
      Service Checks: 0, Total Service Checks: 0

    docker
    ------
      Total Runs: 673
      Metrics: 60, Total Metrics: 40320
      Events: 1, Total Events: 39
      Service Checks: 1, Total Service Checks: 672

    file_handle
    -----------
      Total Runs: 673
      Metrics: 1, Total Metrics: 672
      Events: 0, Total Events: 0
      Service Checks: 0, Total Service Checks: 0

    io
    --
      Total Runs: 673
      Metrics: 156, Total Metrics: over 100K
      Events: 0, Total Events: 0
      Service Checks: 0, Total Service Checks: 0

    load
    ----
      Total Runs: 673
      Metrics: 6, Total Metrics: 4032
      Events: 0, Total Events: 0
      Service Checks: 0, Total Service Checks: 0

    memory
    ------
      Total Runs: 673
      Metrics: 14, Total Metrics: 9408
      Events: 0, Total Events: 0
      Service Checks: 0, Total Service Checks: 0

    network
    -------
      Total Runs: 673
      Metrics: 32, Total Metrics: 21504
      Events: 0, Total Events: 0
      Service Checks: 0, Total Service Checks: 0

    ntp
    ---
      Total Runs: 673
      Metrics: 1, Total Metrics: 659
      Events: 0, Total Events: 0
      Service Checks: 1, Total Service Checks: 672

    process
    -------
      Total Runs: 673
      Metrics: 1, Total Metrics: 672
      Events: 0, Total Events: 0
      Service Checks: 1, Total Service Checks: 672
      Warning: No matching process 'dockerd' was found


    uptime
    ------
      Total Runs: 673
      Metrics: 1, Total Metrics: 672
      Events: 0, Total Events: 0
      Service Checks: 0, Total Service Checks: 0

========
JMXFetch
========

  Initialized checks
  ==================
    no checks

  Failed checks
  =============
    no checks

=========
Forwarder
=========

  CheckRunsV1: 673
  IntakeV1: 56
  RetryQueueSize: 0
  Success: 1402
  TimeseriesV1: 673

  API Keys status
  ===============
    https://6-0-0-app.agent.datadoghq.com,*************************08e10: API Key valid

=========
DogStatsD
=========

  Checks Metric Sample: 316855
  Event: 39
  Events Flushed: 39
  Number Of Flushes: 673
  Series Flushed: 299351
  Service Check: 10095
  Service Checks Flushed: 10753
  Dogstatsd Metric Sample: 487839

Agent is being run as a container by ECS. See bottom section for Docker inspect output.

Describe what happened:

The documentation at https://app.datadoghq.com/logs/onboarding/container indicates that container discovery can be keyed off of container label, but I have been unable to get that to work.

Describe what you expected:

The following configuration works as expected:

init_config:
logs:
  - type: docker
    image: 000000000000.dkr.ecr.us-west-2.amazonaws.com/hub:0.0.197
    service: hub
    source: nodejs
    sourcecategory: hub

Logs look like the following:

1513136612073703980 [Warn] unable to get the hostname from the config file: host name is empty
1513136612073726278 [Warn] trying to determine a reliable host name automatically...
1513136612073730857 [Debug] GetHostname trying GCE metadata...
1513136612073734158 [Debug] GetHostname trying Docker API...
Starting logs-agent
1513136612091292808 [Debug] initialising tag collector docker
1513136612091905026 [Debug] initialising tag collector ecs
Detected container 000000000000.dkr.ecr.us-west-2.amazonaws.com/hub:0.0.197 - 90c8c760872c
1513136613095708960 [Debug] cache miss for docker, collecting
1513136613102545959 [Debug] cache miss for ecs, collecting
1513136613103430341 [Debug] listener message: [%!s(*collectors.TagInfo=&{ecs docker://d86126209d5a9f0ce3ad4f4e004937268c33b6394f34e3678b210c19f6128601 [] [task_version:16 task_name:datadog-stg] false}) %!s(*collectors.TagInfo=&{ecs docker://83a0aeb3976eda5b4a7db96edf3f8d72f8c35dfcb6df0f4c465f95a1eb1a3c53 [] [task_version:4 task_name:consul-server-api-stg] false}) %!s(*collectors.TagInfo=&{ecs docker://90c8c760872cf661e57d1d5097f1f82cc11c10ad5e44415f0af7c105be53801f [] [task_version:10 task_name:hub-stg] false})]

The following does not:

init_config:
logs:
  - type: docker
    label: service:hub
    service: hub
    source: nodejs
    sourcecategory: hub

Logs look like the following:

1513190067076531677 [Warn] unable to get the hostname from the config file: host name is empty
1513190067076547413 [Warn] trying to determine a reliable host name automatically...
1513190067076550904 [Debug] GetHostname trying GCE metadata...
1513190067076554245 [Debug] GetHostname trying Docker API...
Starting logs-agent
1513190067141910375 [Debug] initialising tag collector ecs
1513190068144374669 [Debug] initialising tag collector docker

I dug into the source a bit and I think the answer might be in /pkg/input/container/scanner.go where it compares container labels to those specified in the config to determine whether to start tailing.

Steps to reproduce the issue:

  • Ensure log_enabled: true is added to /etc/datadog-agent/datadog.yaml
  • Add the YAML above to /etc/datadog-agent/conf.d/hub.yaml
  • Execute /opt/datadog-agent/bin/agent/logs-agent --ddconfig=/etc/datadog-agent/datadog.yaml --ddconfd=/etc/datadog-agent/conf.d

Additional environment details (Operating System, Cloud provider, etc):

  • AWS Linux (4.9.62-21.56.amzn1.x86_64 #1 SMP Thu Nov 16 05:37:08 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux)
  • Docker:
Client:
 Version:      17.06.2-ce
 API version:  1.30
 Go version:   go1.8.4
 Git commit:   3dfb8343b139d6342acfd9975d7f1068b5b1c3d3
 Built:        Fri Nov 10 00:50:37 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.06.2-ce
 API version:  1.30 (minimum version 1.12)
 Go version:   go1.8.4
 Git commit:   402dd4a/17.06.2-ce
 Built:        Fri Nov 10 00:51:08 2017
 OS/Arch:      linux/amd64
 Experimental: false
  • ECS (Amazon ECS Agent - v1.16.0 (1ca656c))
  • Docker Inspect agent container:
[
    {
        "Id": "bd814234d446bd5d6fc0fbc9271a99560120b4ffba97d3412ccf9da6770f2028",
        "Created": "2017-12-13T16:58:48.080620311Z",
        "Path": "/tini",
        "Args": [
            "--",
            "/entrypoint.sh",
            "/opt/datadog-agent/bin/agent/agent",
            "start"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 5567,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2017-12-13T16:58:48.585934807Z",
            "FinishedAt": "0001-01-01T00:00:00Z",
            "Health": {
                "Status": "healthy",
                "FailingStreak": 0,
                "Log": [
                    {
                        "Start": "2017-12-13T19:33:50.017380171Z",
                        "End": "2017-12-13T19:33:50.052732788Z",
                        "ExitCode": 0,
                        "Output": "Getting the status from the agent.\n\n===================================\nAgent (v6.0.0-beta.5+git.1.ae3b024)\n===================================\n\n  Status date: 2017-12-13 19:33:50.046357 UTC\n  Pid: 7\n  Python Version: 2.7.14\n  Logs: \n  Check Runners: 10\n  Log Level: INFO\n\n  Paths\n  =====\n    Config File: /etc/datadog-agent/datadog.yaml\n    conf.d: /etc/datadog-agent/conf.d\n    checks.d: /etc/datadog-agent/checks.d\n\n  Clocks\n  ======NTP offset: 0.000776898 s\n    System UTC time: 2017-12-13 19:33:50.046357 UTC\n\n  Host Info\n  =========\n    bootTime: 2017-12-11 17:57:37.000000 UTC\n    kernelVersion: 4.9.62-21.56.amzn1.x86_64\n    os: linux\n    platform: debian\n    platformFamily: debian\n    platformVersion: 9.2\n    procs: 60\n    uptime: 169274\n\n  Hostnames\n  =========\n    ec2-hostname: ip-172-26-0-54.customer.internal\n    hostname: api-stg-06436c77cfda5b700\n    instance-id: i-06436c77cfda5b700\n    socket-fqdn: api-stg-06436c77cfda5b700.customer.internal.\n    socket-hostname: api-stg-06436c77cfda5b700\n\n=========\nCollector\n=========\n\n  Running Checks\n  ==============\n    consul\n    ------\n      Total Runs: 619\n      Metrics: 1, Total Metrics: 618\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    cpu\n    ---\n      Total Runs: 619\n      Metrics: 6, Total Metrics: 3702\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    disk\n    ----\n      Total Runs: 619\n      Metrics: 168, Total Metrics: over 100K\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    docker\n    ------\n      Total Runs: 619\n      Metrics: 60, Total Metrics: 37080\n      Events: 0, Total Events: 35\n      Service Checks: 1, Total Service Checks: 618\n  \n    file_handle\n    -----------\n      Total Runs: 619\n      Metrics: 1, Total Metrics: 618\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    io\n    --\n      Total Runs: 619\n      Metrics: 156, Total Metrics: 96300\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    load\n    ----\n      Total Runs: 619\n      Metrics: 6, Total Metrics: 3708\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    memory\n    ------\n      Total Runs: 619\n      Metrics: 14, Total Metrics: 8652\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    network\n    -------\n      Total Runs: 619\n      Metrics: 32, Total Metrics: 19776\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    ntp\n    ---\n      Total Runs: 619\n      Metrics: 1, Total Metrics: 606\n      Events: 0, Total Events: 0\n      Service Checks: 1, Total Service Checks: 618\n  \n    process\n    -------\n      Total Runs: 619\n      Metrics: 1, Total Metrics: 618\n      Events: 0, Total Events: 0\n      Service Checks: 1, Total Service Checks: 618\n      Warning: No matching process 'dockerd' was found\n        \n  \n    uptime\n    ------\n      Total Runs: 619\n      Metrics: 1, Total Metrics: 618\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n========\nJMXFetch\n========\n\n  Initialized checks\n  ==================\n    no checks\n    \n  Failed checks\n  =============\n    no checks\n    \n=========\nForwarder\n=========\n\n  CheckRunsV1: 619\n  IntakeV1: 51\n  RetryQueueSize: 0\n  Success: 1289\n  TimeseriesV1: 619\n\n  API Keys status\n  ===============\n    https://6-0-0-app.agent.datadoghq.com,*************************08e10: API Key valid\n\n=========\nDogStatsD\n=========\n\n  Checks Metric Sample: 291422\n  Event: 35\n  Events Flushed: 35\n  Number Of Flushes: 619\n  Series Flushed: 275294\n  Service Check: 9285\n  Service Checks Flushed: 9889\n  Dogstatsd Metric Sample: 449322\n\n"
                    },
                    {
                        "Start": "2017-12-13T19:38:50.052836427Z",
                        "End": "2017-12-13T19:38:50.090511881Z",
                        "ExitCode": 0,
                        "Output": "Getting the status from the agent.\n\n===================================\nAgent (v6.0.0-beta.5+git.1.ae3b024)\n===================================\n\n  Status date: 2017-12-13 19:38:50.084228 UTC\n  Pid: 7\n  Python Version: 2.7.14\n  Logs: \n  Check Runners: 10\n  Log Level: INFO\n\n  Paths\n  =====\n    Config File: /etc/datadog-agent/datadog.yaml\n    conf.d: /etc/datadog-agent/conf.d\n    checks.d: /etc/datadog-agent/checks.d\n\n  Clocks\n  ======NTP offset: 0.000775883 s\n    System UTC time: 2017-12-13 19:38:50.084228 UTC\n\n  Host Info\n  =========\n    bootTime: 2017-12-11 17:57:37.000000 UTC\n    kernelVersion: 4.9.62-21.56.amzn1.x86_64\n    os: linux\n    platform: debian\n    platformFamily: debian\n    platformVersion: 9.2\n    procs: 60\n    uptime: 169274\n\n  Hostnames\n  =========\n    ec2-hostname: ip-172-26-0-54.customer.internal\n    hostname: api-stg-06436c77cfda5b700\n    instance-id: i-06436c77cfda5b700\n    socket-fqdn: api-stg-06436c77cfda5b700.customer.internal.\n    socket-hostname: api-stg-06436c77cfda5b700\n\n=========\nCollector\n=========\n\n  Running Checks\n  ==============\n    consul\n    ------\n      Total Runs: 639\n      Metrics: 1, Total Metrics: 638\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    cpu\n    ---\n      Total Runs: 639\n      Metrics: 6, Total Metrics: 3822\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    disk\n    ----\n      Total Runs: 639\n      Metrics: 168, Total Metrics: over 100K\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    docker\n    ------\n      Total Runs: 639\n      Metrics: 60, Total Metrics: 38280\n      Events: 0, Total Events: 36\n      Service Checks: 1, Total Service Checks: 638\n  \n    file_handle\n    -----------\n      Total Runs: 639\n      Metrics: 1, Total Metrics: 638\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    io\n    --\n      Total Runs: 639\n      Metrics: 156, Total Metrics: 99420\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    load\n    ----\n      Total Runs: 639\n      Metrics: 6, Total Metrics: 3828\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    memory\n    ------\n      Total Runs: 639\n      Metrics: 14, Total Metrics: 8932\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    network\n    -------\n      Total Runs: 639\n      Metrics: 32, Total Metrics: 20416\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    ntp\n    ---\n      Total Runs: 639\n      Metrics: 1, Total Metrics: 626\n      Events: 0, Total Events: 0\n      Service Checks: 1, Total Service Checks: 638\n  \n    process\n    -------\n      Total Runs: 639\n      Metrics: 1, Total Metrics: 638\n      Events: 0, Total Events: 0\n      Service Checks: 1, Total Service Checks: 638\n      Warning: No matching process 'dockerd' was found\n        \n  \n    uptime\n    ------\n      Total Runs: 639\n      Metrics: 1, Total Metrics: 638\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n========\nJMXFetch\n========\n\n  Initialized checks\n  ==================\n    no checks\n    \n  Failed checks\n  =============\n    no checks\n    \n=========\nForwarder\n=========\n\n  CheckRunsV1: 639\n  IntakeV1: 52\n  RetryQueueSize: 0\n  Success: 1330\n  TimeseriesV1: 639\n\n  API Keys status\n  ===============\n    https://6-0-0-app.agent.datadoghq.com,*************************08e10: API Key valid\n\n=========\nDogStatsD\n=========\n\n  Checks Metric Sample: 300842\n  Event: 36\n  Events Flushed: 36\n  Number Of Flushes: 639\n  Series Flushed: 284224\n  Service Check: 9585\n  Service Checks Flushed: 10209\n  Dogstatsd Metric Sample: 463777\n\n"
                    },
                    {
                        "Start": "2017-12-13T19:43:50.09061565Z",
                        "End": "2017-12-13T19:43:50.126267069Z",
                        "ExitCode": 0,
                        "Output": "Getting the status from the agent.\n\n===================================\nAgent (v6.0.0-beta.5+git.1.ae3b024)\n===================================\n\n  Status date: 2017-12-13 19:43:50.119862 UTC\n  Pid: 7\n  Python Version: 2.7.14\n  Logs: \n  Check Runners: 10\n  Log Level: INFO\n\n  Paths\n  =====\n    Config File: /etc/datadog-agent/datadog.yaml\n    conf.d: /etc/datadog-agent/conf.d\n    checks.d: /etc/datadog-agent/checks.d\n\n  Clocks\n  ======NTP offset: -0.001124672 s\n    System UTC time: 2017-12-13 19:43:50.119862 UTC\n\n  Host Info\n  =========\n    bootTime: 2017-12-11 17:57:37.000000 UTC\n    kernelVersion: 4.9.62-21.56.amzn1.x86_64\n    os: linux\n    platform: debian\n    platformFamily: debian\n    platformVersion: 9.2\n    procs: 60\n    uptime: 169274\n\n  Hostnames\n  =========\n    ec2-hostname: ip-172-26-0-54.customer.internal\n    hostname: api-stg-06436c77cfda5b700\n    instance-id: i-06436c77cfda5b700\n    socket-fqdn: api-stg-06436c77cfda5b700.customer.internal.\n    socket-hostname: api-stg-06436c77cfda5b700\n\n=========\nCollector\n=========\n\n  Running Checks\n  ==============\n    consul\n    ------\n      Total Runs: 659\n      Metrics: 1, Total Metrics: 658\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    cpu\n    ---\n      Total Runs: 659\n      Metrics: 6, Total Metrics: 3942\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    disk\n    ----\n      Total Runs: 659\n      Metrics: 168, Total Metrics: over 100K\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    docker\n    ------\n      Total Runs: 659\n      Metrics: 60, Total Metrics: 39480\n      Events: 0, Total Events: 37\n      Service Checks: 1, Total Service Checks: 658\n  \n    file_handle\n    -----------\n      Total Runs: 659\n      Metrics: 1, Total Metrics: 658\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    io\n    --\n      Total Runs: 659\n      Metrics: 156, Total Metrics: over 100K\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    load\n    ----\n      Total Runs: 659\n      Metrics: 6, Total Metrics: 3948\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    memory\n    ------\n      Total Runs: 659\n      Metrics: 14, Total Metrics: 9212\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    network\n    -------\n      Total Runs: 659\n      Metrics: 32, Total Metrics: 21056\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    ntp\n    ---\n      Total Runs: 659\n      Metrics: 1, Total Metrics: 645\n      Events: 0, Total Events: 0\n      Service Checks: 1, Total Service Checks: 658\n  \n    process\n    -------\n      Total Runs: 659\n      Metrics: 1, Total Metrics: 658\n      Events: 0, Total Events: 0\n      Service Checks: 1, Total Service Checks: 658\n      Warning: No matching process 'dockerd' was found\n        \n  \n    uptime\n    ------\n      Total Runs: 659\n      Metrics: 1, Total Metrics: 658\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n========\nJMXFetch\n========\n\n  Initialized checks\n  ==================\n    no checks\n    \n  Failed checks\n  =============\n    no checks\n    \n=========\nForwarder\n=========\n\n  CheckRunsV1: 659\n  IntakeV1: 54\n  RetryQueueSize: 0\n  Success: 1372\n  TimeseriesV1: 659\n\n  API Keys status\n  ===============\n    https://6-0-0-app.agent.datadoghq.com,*************************08e10: API Key valid\n\n=========\nDogStatsD\n=========\n\n  Checks Metric Sample: 310261\n  Event: 37\n  Events Flushed: 37\n  Number Of Flushes: 659\n  Series Flushed: 293123\n  Service Check: 9885\n  Service Checks Flushed: 10529\n  Dogstatsd Metric Sample: 478263\n\n"
                    },
                    {
                        "Start": "2017-12-13T19:48:50.126361152Z",
                        "End": "2017-12-13T19:48:50.161490858Z",
                        "ExitCode": 0,
                        "Output": "Getting the status from the agent.\n\n===================================\nAgent (v6.0.0-beta.5+git.1.ae3b024)\n===================================\n\n  Status date: 2017-12-13 19:48:50.155267 UTC\n  Pid: 7\n  Python Version: 2.7.14\n  Logs: \n  Check Runners: 10\n  Log Level: INFO\n\n  Paths\n  =====\n    Config File: /etc/datadog-agent/datadog.yaml\n    conf.d: /etc/datadog-agent/conf.d\n    checks.d: /etc/datadog-agent/checks.d\n\n  Clocks\n  ======NTP offset: -0.00284102 s\n    System UTC time: 2017-12-13 19:48:50.155267 UTC\n\n  Host Info\n  =========\n    bootTime: 2017-12-11 17:57:37.000000 UTC\n    kernelVersion: 4.9.62-21.56.amzn1.x86_64\n    os: linux\n    platform: debian\n    platformFamily: debian\n    platformVersion: 9.2\n    procs: 60\n    uptime: 169274\n\n  Hostnames\n  =========\n    ec2-hostname: ip-172-26-0-54.customer.internal\n    hostname: api-stg-06436c77cfda5b700\n    instance-id: i-06436c77cfda5b700\n    socket-fqdn: api-stg-06436c77cfda5b700.customer.internal.\n    socket-hostname: api-stg-06436c77cfda5b700\n\n=========\nCollector\n=========\n\n  Running Checks\n  ==============\n    consul\n    ------\n      Total Runs: 679\n      Metrics: 1, Total Metrics: 678\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    cpu\n    ---\n      Total Runs: 679\n      Metrics: 6, Total Metrics: 4062\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    disk\n    ----\n      Total Runs: 679\n      Metrics: 168, Total Metrics: over 100K\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    docker\n    ------\n      Total Runs: 679\n      Metrics: 60, Total Metrics: 40680\n      Events: 0, Total Events: 39\n      Service Checks: 1, Total Service Checks: 678\n  \n    file_handle\n    -----------\n      Total Runs: 679\n      Metrics: 1, Total Metrics: 678\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    io\n    --\n      Total Runs: 679\n      Metrics: 156, Total Metrics: over 100K\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    load\n    ----\n      Total Runs: 679\n      Metrics: 6, Total Metrics: 4068\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    memory\n    ------\n      Total Runs: 679\n      Metrics: 14, Total Metrics: 9492\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    network\n    -------\n      Total Runs: 679\n      Metrics: 32, Total Metrics: 21696\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    ntp\n    ---\n      Total Runs: 679\n      Metrics: 1, Total Metrics: 665\n      Events: 0, Total Events: 0\n      Service Checks: 1, Total Service Checks: 678\n  \n    process\n    -------\n      Total Runs: 679\n      Metrics: 1, Total Metrics: 678\n      Events: 0, Total Events: 0\n      Service Checks: 1, Total Service Checks: 678\n      Warning: No matching process 'dockerd' was found\n        \n  \n    uptime\n    ------\n      Total Runs: 679\n      Metrics: 1, Total Metrics: 678\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n========\nJMXFetch\n========\n\n  Initialized checks\n  ==================\n    no checks\n    \n  Failed checks\n  =============\n    no checks\n    \n=========\nForwarder\n=========\n\n  CheckRunsV1: 679\n  IntakeV1: 56\n  RetryQueueSize: 0\n  Success: 1414\n  TimeseriesV1: 679\n\n  API Keys status\n  ===============\n    https://6-0-0-app.agent.datadoghq.com,*************************08e10: API Key valid\n\n=========\nDogStatsD\n=========\n\n  Checks Metric Sample: 319681\n  Event: 39\n  Events Flushed: 39\n  Number Of Flushes: 679\n  Series Flushed: 302028\n  Service Check: 10185\n  Service Checks Flushed: 10849\n  Dogstatsd Metric Sample: 492744\n\n"
                    },
                    {
                        "Start": "2017-12-13T19:53:50.16159119Z",
                        "End": "2017-12-13T19:53:50.197711879Z",
                        "ExitCode": 0,
                        "Output": "Getting the status from the agent.\n\n===================================\nAgent (v6.0.0-beta.5+git.1.ae3b024)\n===================================\n\n  Status date: 2017-12-13 19:53:50.190587 UTC\n  Pid: 7\n  Python Version: 2.7.14\n  Logs: \n  Check Runners: 10\n  Log Level: INFO\n\n  Paths\n  =====\n    Config File: /etc/datadog-agent/datadog.yaml\n    conf.d: /etc/datadog-agent/conf.d\n    checks.d: /etc/datadog-agent/checks.d\n\n  Clocks\n  ======NTP offset: -0.00502277 s\n    System UTC time: 2017-12-13 19:53:50.190587 UTC\n\n  Host Info\n  =========\n    bootTime: 2017-12-11 17:57:37.000000 UTC\n    kernelVersion: 4.9.62-21.56.amzn1.x86_64\n    os: linux\n    platform: debian\n    platformFamily: debian\n    platformVersion: 9.2\n    procs: 60\n    uptime: 169274\n\n  Hostnames\n  =========\n    ec2-hostname: ip-172-26-0-54.customer.internal\n    hostname: api-stg-06436c77cfda5b700\n    instance-id: i-06436c77cfda5b700\n    socket-fqdn: api-stg-06436c77cfda5b700.customer.internal.\n    socket-hostname: api-stg-06436c77cfda5b700\n\n=========\nCollector\n=========\n\n  Running Checks\n  ==============\n    consul\n    ------\n      Total Runs: 699\n      Metrics: 1, Total Metrics: 698\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    cpu\n    ---\n      Total Runs: 699\n      Metrics: 6, Total Metrics: 4182\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    disk\n    ----\n      Total Runs: 699\n      Metrics: 168, Total Metrics: over 100K\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    docker\n    ------\n      Total Runs: 699\n      Metrics: 60, Total Metrics: 41880\n      Events: 0, Total Events: 40\n      Service Checks: 1, Total Service Checks: 698\n  \n    file_handle\n    -----------\n      Total Runs: 699\n      Metrics: 1, Total Metrics: 698\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    io\n    --\n      Total Runs: 699\n      Metrics: 156, Total Metrics: over 100K\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    load\n    ----\n      Total Runs: 699\n      Metrics: 6, Total Metrics: 4188\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    memory\n    ------\n      Total Runs: 699\n      Metrics: 14, Total Metrics: 9772\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    network\n    -------\n      Total Runs: 699\n      Metrics: 32, Total Metrics: 22336\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n    ntp\n    ---\n      Total Runs: 699\n      Metrics: 1, Total Metrics: 685\n      Events: 0, Total Events: 0\n      Service Checks: 1, Total Service Checks: 698\n  \n    process\n    -------\n      Total Runs: 699\n      Metrics: 1, Total Metrics: 698\n      Events: 0, Total Events: 0\n      Service Checks: 1, Total Service Checks: 698\n      Warning: No matching process 'dockerd' was found\n        \n  \n    uptime\n    ------\n      Total Runs: 699\n      Metrics: 1, Total Metrics: 698\n      Events: 0, Total Events: 0\n      Service Checks: 0, Total Service Checks: 0\n  \n========\nJMXFetch\n========\n\n  Initialized checks\n  ==================\n    no checks\n    \n  Failed checks\n  =============\n    no checks\n    \n=========\nForwarder\n=========\n\n  CheckRunsV1: 699\n  IntakeV1: 58\n  RetryQueueSize: 0\n  Success: 1456\n  TimeseriesV1: 699\n\n  API Keys status\n  ===============\n    https://6-0-0-app.agent.datadoghq.com,*************************08e10: API Key valid\n\n=========\nDogStatsD\n=========\n\n  Checks Metric Sample: 329101\n  Event: 40\n  Events Flushed: 40\n  Number Of Flushes: 699\n  Series Flushed: 310943\n  Service Check: 10485\n  Service Checks Flushed: 11169\n  Dogstatsd Metric Sample: 507278\n\n"
                    }
                ]
            }
        },
        "Image": "sha256:abd2a89de08274b74f2d93a5fcb47b337ce89d1ff929de674afdcdc4d65348ab",
        "ResolvConfPath": "/var/lib/docker/containers/bd814234d446bd5d6fc0fbc9271a99560120b4ffba97d3412ccf9da6770f2028/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/bd814234d446bd5d6fc0fbc9271a99560120b4ffba97d3412ccf9da6770f2028/hostname",
        "HostsPath": "/var/lib/docker/containers/bd814234d446bd5d6fc0fbc9271a99560120b4ffba97d3412ccf9da6770f2028/hosts",
        "LogPath": "/var/lib/docker/containers/bd814234d446bd5d6fc0fbc9271a99560120b4ffba97d3412ccf9da6770f2028/bd814234d446bd5d6fc0fbc9271a99560120b4ffba97d3412ccf9da6770f2028-json.log",
        "Name": "/ecs-datadog-stg-16-datadog-9680f395e1c0b89bdb01",
        "RestartCount": 0,
        "Driver": "devicemapper",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/var/run/docker.sock:/var/run/docker.sock",
                "/proc/:/host/proc/:ro",
                "/cgroup/:/host/sys/fs/cgroup:ro",
                "/opt/dd-agent-conf.d/:/conf.d:ro",
                "/var/lib/datadog-agent:/opt/datadog-agent/run",
                "/var/lib/docker/devicemapper/mnt/:/container_volumes:ro"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "host",
            "PortBindings": {
                "8125/udp": [
                    {
                        "HostIp": "",
                        "HostPort": "8125"
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "CapAdd": null,
            "CapDrop": null,
            "Dns": null,
            "DnsOptions": null,
            "DnsSearch": null,
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": true,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": [
                "label=disable"
            ],
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 128,
            "Memory": 268435456,
            "NanoCpus": 0,
            "CgroupParent": "/ecs/1c342d18-800a-4da2-b559-f6061618e454",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": null,
            "DeviceCgroupRules": null,
            "DiskQuota": 0,
            "KernelMemory": 0,
            "MemoryReservation": 0,
            "MemorySwap": 536870912,
            "MemorySwappiness": 0,
            "OomKillDisable": false,
            "PidsLimit": 0,
            "Ulimits": [
                {
                    "Name": "nofile",
                    "Hard": 4096,
                    "Soft": 1024
                }
            ],
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0
        },
        "GraphDriver": {
            "Data": {
                "DeviceId": "114",
                "DeviceName": "docker-259:3-263310-039062c2cf44486f73e688a257b46712f600372bc4be3de510cbf167608dbb4a",
                "DeviceSize": "10737418240"
            },
            "Name": "devicemapper"
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/proc",
                "Destination": "/host/proc",
                "Mode": "ro",
                "RW": false,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/cgroup",
                "Destination": "/host/sys/fs/cgroup",
                "Mode": "ro",
                "RW": false,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/opt/dd-agent-conf.d",
                "Destination": "/conf.d",
                "Mode": "ro",
                "RW": false,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/var/lib/datadog-agent",
                "Destination": "/opt/datadog-agent/run",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/var/lib/docker/devicemapper/mnt",
                "Destination": "/container_volumes",
                "Mode": "ro",
                "RW": false,
                "Propagation": "rprivate"
            },
            {
                "Type": "volume",
                "Name": "634b3089c5721168e90181d52293483fe44c64271d599b39be53586ad2b19f70",
                "Source": "/var/lib/docker/volumes/634b3089c5721168e90181d52293483fe44c64271d599b39be53586ad2b19f70/_data",
                "Destination": "/checks.d",
                "Driver": "local",
                "Mode": "",
                "RW": true,
                "Propagation": ""
            },
            {
                "Type": "bind",
                "Source": "/var/run/docker.sock",
                "Destination": "/var/run/docker.sock",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],
        "Config": {
            "Hostname": "api-stg-06436c77cfda5b700",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "8125/udp": {},
                "8126/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "DD_API_KEY=0000000000000000000000000",
                "DD_ENABLE_LOGS=true",
                "DD_HOSTNAME=",
                "ENABLE_INTEGRATIONS=consul,hub,process",
                "CONSUL_ADDR_FROM_AWS_META=yes",
                "EC2_TAGS=",
                "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI=/v2/credentials/7c340fc2-efe5-42fa-8957-f6e5e2c9c443",
                "TAGS=customer-stg",
                "AWS_SECURITY_GROUPS=yes",
                "CONSUL_DC=stg",
                "CONSUL_PREFIX=config/datadog/stg",
                "SERVICE_8125_NAME=datadog",
                "CONSUL_HTTP_ADDR=",
                "DD_LOG_LEVEL=INFO",
                "PATH=/opt/datadog-agent/bin/agent/:/opt/datadog-agent/embedded/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "DOCKER_DD_AGENT=yes",
                "CURL_CA_BUNDLE=/opt/datadog-agent/embedded/ssl/certs/cacert.pem"
            ],
            "Cmd": [
                "/opt/datadog-agent/bin/agent/agent",
                "start"
            ],
            "Healthcheck": {
                "Test": [
                    "CMD",
                    "/opt/datadog-agent/bin/agent/agent",
                    "status"
                ],
                "Interval": 300000000000,
                "Timeout": 20000000000,
                "Retries": 1
            },
            "ArgsEscaped": true,
            "Image": "000000000000.dkr.ecr.us-west-2.amazonaws.com/datadog-agent:6.0.0-beta.5",
            "Volumes": {
                "/checks.d": {},
                "/conf.d": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "/tini",
                "--",
                "/entrypoint.sh"
            ],
            "OnBuild": null,
            "Labels": {
                "com.amazonaws.ecs.cluster": "api-stg",
                "com.amazonaws.ecs.container-name": "datadog",
                "com.amazonaws.ecs.task-arn": "arn:aws:ecs:us-west-2:000000000000:task/1c342d18-800a-4da2-b559-f6061618e454",
                "com.amazonaws.ecs.task-definition-family": "datadog-stg",
                "com.amazonaws.ecs.task-definition-version": "16",
                "maintainer": "Datadog <[email protected]>"
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "1d563bef1c0ff6ce7f80bd08b4c855bdaecf86fb22523b88d3b9891909f7b985",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {},
            "SandboxKey": "/var/run/docker/netns/default",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "host": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "972fdc2dba3a8c340c25b1d6759a90f2f87900501e01a30bd4fb7e8365c934b0",
                    "EndpointID": "1df44ca3fadb0976650f7015c4dc5b5c6699bc50b45551345f1e7d5d9e098d9e",
                    "Gateway": "",
                    "IPAddress": "",
                    "IPPrefixLen": 0,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "",
                    "DriverOpts": null
                }
            }
        }
    }
]

blakeneyops avatar Dec 13 '17 20:12 blakeneyops

Hi @blakeneyops, Thanks a lot for submitting your issue, we are currently investigating on what's happening here and we'll get back to you ASAP. Cheers

ajacquemot avatar Dec 18 '17 11:12 ajacquemot

Hello @blakeneyops,

After investigation, we can confirm that the behaviour is a current limitation of the agent. The label parameter is currently designed to look only for the key of the label and not key:value.

So if you added label: env this would work.

I have raised this internally with your name for tracking and I'll make sure we let you know as soon as we change the behaviour to accept key:value as expected with Docker labels.

Thanks, Nils

NilsBunge avatar Dec 18 '17 13:12 NilsBunge

Thank you for the update.

blakeneyops avatar Dec 18 '17 19:12 blakeneyops

Hello @blakeneyops,

I just wanted to let you know that the latest version of the agent (beta9) now contains the fix for this. With this change, we now accept a comma separated list of labels that can be formatted either as key:value, key=value, or simply key.

Let me know if that works for you. Thanks, Nils

NilsBunge avatar Jan 29 '18 19:01 NilsBunge

I'm going to close this issue, but feel free to re-open it in case you spot any problem.

Thanks a lot, Nils

NilsBunge avatar Jan 30 '18 13:01 NilsBunge