Support service discovery (#215)

* Updates image to docker-dd-agent:11.1.580
* Adds support for service discovery configuration
This commit is contained in:
Jan B 2016-07-18 18:17:20 +02:00 committed by Bill Maxwell
parent 3550b050db
commit e34229480c
4 changed files with 132 additions and 8 deletions

View File

@ -0,0 +1,38 @@
datadog-init:
image: janeczku/datadog-rancher-init:v2.2
net: none
command: /bin/true
volumes:
- /opt/rancher
labels:
io.rancher.container.start_once: 'true'
io.rancher.container.pull_image: always
datadog-agent:
image: datadog/docker-dd-agent:11.1.580
entrypoint: /opt/rancher/entrypoint-wrapper.py
command:
- supervisord
- -n
- -c
- /etc/dd-agent/supervisor.conf
restart: always
environment:
API_KEY: ${api_key}
SD_BACKEND_HOST: ${sd_backend_host}
SD_BACKEND_PORT: ${sd_backend_port}
SD_TEMPLATE_DIR: ${sd_template_dir}
STATSD_METRIC_NAMESPACE: ${statsd_namespace}
DD_STATSD_STANDALONE: "${statsd_standalone}"
DD_HOST_LABELS: ${host_labels}
DD_CONTAINER_LABELS: ${service_labels}
DD_SERVICE_DISCOVERY: ${service_discovery}
DD_SD_CONFIG_BACKEND: ${sd_config_backend}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /proc/:/host/proc/:ro
- /sys/fs/cgroup/:/host/sys/fs/cgroup:ro
volumes_from:
- datadog-init
labels:
io.rancher.scheduler.global: "${global_service}"
io.rancher.sidekicks: 'datadog-init'

View File

@ -0,0 +1,84 @@
.catalog:
name: "DataDog"
version: "11.1.580-rancher1"
description: "Real-time performance tracking and visualization of your container-based application deployment"
minimum_rancher_version: v0.46.0
questions:
- variable: "api_key"
label: "DataDog Api Key"
description: |
Enter your DataDog API key.
required: true
type: "string"
- variable: "global_service"
label: "Global Service"
description: |
Enable this option to run a DataDog agent container on every host in the environment.
required: true
type: "boolean"
default: true
- variable: "host_labels"
label: "Export Host Labels as Tags"
description: |
Comma delimited list of host labels to export as DataDog host tags, e.g. 'region,zone'.
required: false
type: "string"
- variable: "service_labels"
label: "Export Service Labels as Tags"
description: |
Comma delimited list of service labels to export as DataDog metric tags.
'io.rancher.stack.name' and 'io.rancher.stack_service.name' are exported by default.
required: false
type: "string"
- variable: "service_discovery"
label: "Enable Service Discovery"
description: |
Collect metrics from supported applications running in Docker containers.
required: true
type: "boolean"
default: false
- variable: sd_config_backend
label: Service Discovery Config Backend
description: |
Choose a key/value store to use for looking up application configuration templates.
If none is provided only auto config templates will be used.
required: true
type: enum
default: none
options:
- none
- etcd
- consul
- variable: "sd_backend_host"
label: "Config Backend Host"
description: |
IP address or DNS name to use to connect to the configuration backend.
required: false
type: "string"
- variable: "sd_backend_port"
label: "Config Backend Port"
description: |
Port to use to connect to the configuration backend.
required: false
type: "int"
- variable: "sd_template_dir"
label: "Config Backend Template Path"
description: |
Specify a custom path where the agent should look for configuration templates in the backend.
The default is '/datadog/check_configs'.
required: false
type: "string"
- variable: "statsd_standalone"
label: "Run Standalone DogStatsD"
description: |
Enable this option to run just the DogStatsD service without the full agent.
Should be used with the Global Service option set 'False'.
required: true
type: "boolean"
default: false
- variable: "statsd_namespace"
label: "StatsD Metric Namespace"
description: |
Optional namespace for aggregated StatsD metrics.
required: false
type: "string"

View File

@ -1,8 +1,10 @@
# Datadog Agent & DogStatsD
# DataDog Agent
This template deploys a Datadog Agent stack consisting of the official [docker-dd-agent image](https://www.github.com/Datadog/docker-dd-agent) and a sidekick config volume with a custom entrypoint script for improved integration with the Rancher Cattle environment:
This template deploys a [DataDog](https://www.datadoghq.com/) agent stack consisting of the official [docker-dd-agent](https://www.github.com/Datadog/docker-dd-agent) image and a configuration sidekick that provides closer integration with Rancher:
* Reports the actual name of the host instead of the container's hostname
* Let's you specify `host` and `service` labels to be mapped to Datadog tags
* Starts as global service by default so that system and Docker metrics from every host are captured
* Allows deployment as a standalone `DogStatsD` service that aggregates StatsD metrics sent from applications
* Hosts in Datadog are named correctly
* Host labels can be exported as DataDog host tags
* Service labels can be exported as DataDog metric tags
## Service Discovery
Please refer to the Datadog documentation [here](http://docs.datadoghq.com/guides/servicediscovery/) to learn how to provide configuration templates for Service Discovery in etcd or Consul.

View File

@ -1,7 +1,7 @@
name: Datadog
description: |
Real-time performance tracking and visualization of your container-based application deployment
version: 11.0.580-rancher1
version: 11.1.580-rancher1
category: Monitoring
maintainer: "Jan Bruder <jan@rancher.com>"
license: Apache License 2.0
license: The MIT License