Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docker-daemon] Add recipe and tests #249

Merged
merged 1 commit into from Oct 27, 2015

Conversation

Projects
None yet
2 participants
@kurochan
Copy link
Contributor

kurochan commented Oct 26, 2015

Add a recipe to create an agent configuration file in order to monitor docker with "docker_daemon" check.
Because "docker" check is deprecated.
The attributes available following:

datadog: {
  docker: {
    init_config: {
      docker_root: '/',
      socket_timeout: 10,
      tls: false,
      tls_client_cert: '/path/to/client-cert.pem',
      tls_client_key: '/path/to/client-key.pem',
      tls_cacert: '/path/to/ca.pem',
      tls_verify: true
    },
    instances: [
      {
        url: 'unix://var/run/docker.sock',
        tags: [
          'toto',
          'tata'
        ],
        include: [
          'docker_image:ubuntu',
          'docker_image:debian'
        ],
        exclude: [
          '.*'
        ],
        performance_tags: [
          'container_name',
          'image_name',
          'image_tag',
          'docker_image'
        ],
        container_tags: [
          'image_name',
          'image_tag',
          'docker_image'
        ],
        collect_labels_as_tags: [
          'com.docker.compose.service',
          'com.docker.compose.project'
        ],
        ecs_tags: true,
        collect_events: true,
        collect_container_size: false,
        collect_image_size: false,
        collect_images_stats: false
      }
    ]
  }
}

@kurochan kurochan force-pushed the kurochan:docker-daemon branch from 183e2e9 to 1e07396 Oct 26, 2015

@@ -0,0 +1,28 @@
# Generated by Chef, local modifications will be overwritten

init_config:

This comment has been minimized.

Copy link
@miketheman

miketheman Oct 26, 2015

Collaborator

@kurochan Thanks! Could you possibly try to replace this section with a similar one to the instances one? This retains flexibility in the Chef template if/when the Agent config changes.

Something like:

<%= JSON.parse(({ 'init_config' => @ init_config }).to_json).to_yaml %>
@miketheman

This comment has been minimized.

Copy link
Collaborator

miketheman commented Oct 26, 2015

Nice stuff, thanks!

I added a note in the template that should be addressed.

Also, you may want to add a spec test for faster feedback - this is something I have started to do with recent changes. See https://github.com/DataDog/chef-datadog/blob/master/spec/integrations/redis_spec.rb for an example.

Running rspec spec/integrations/redis_spec.rb is much faster than running a complete kitchen test.

@miketheman miketheman added the feature label Oct 26, 2015

@kurochan kurochan force-pushed the kurochan:docker-daemon branch from 1e07396 to f23edcb Oct 26, 2015

@kurochan

This comment has been minimized.

Copy link
Contributor Author

kurochan commented Oct 26, 2015

@miketheman Thank you for reviewing.
I fixed spec and template. Is this OK?

@kurochan kurochan force-pushed the kurochan:docker-daemon branch from f23edcb to 07ade25 Oct 26, 2015

@miketheman

This comment has been minimized.

Copy link
Collaborator

miketheman commented Oct 27, 2015

@kurochan This looks good, thank you!

@miketheman miketheman added this to the 2.2.0 milestone Oct 27, 2015

@miketheman miketheman self-assigned this Oct 27, 2015

miketheman added a commit that referenced this pull request Oct 27, 2015

Merge pull request #249 from kurochan/docker-daemon
[docker-daemon] Add recipe and tests

@miketheman miketheman merged commit 10a9bfc into DataDog:master Oct 27, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls First build on master at 100.0%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.