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

kurochan
Copy link
Contributor

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
      }
    ]
  }
}

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

init_config:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link
Contributor

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.

@kurochan
Copy link
Contributor Author

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

@miketheman
Copy link
Contributor

@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
[docker-daemon] Add recipe and tests
@miketheman miketheman merged commit 10a9bfc into DataDog:master Oct 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants