Skip to content

Commit f687f56

Browse files
committed
Merge pull request #253 from CodeNow/SAN-3238-datadog-integrations
San 3238 datadog integrations
2 parents 0dca508 + a20b5c6 commit f687f56

9 files changed

Lines changed: 61 additions & 7 deletions

File tree

ansible/docks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
roles:
1111
- { role: docker, tags: "docker" }
1212
- { role: iptables, tags: "iptables, security" }
13-
- { role: datadog }
13+
- { role: datadog, tags: "datadog" }
1414

1515
- include: krain.yml
1616
- include: filibuster.yml

ansible/gamma-hosts/variables

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ vault_aws_region=us-east-1
5858
ansible_ssh_private_key_file=~/.ssh/gamma.pem
5959
datadog_host_address=10.4.6.251
6060
datadog_tags=env:gamma
61+
datadog_mongodb_user=datadog
62+
datadog_mongodb_pwd=sqa3WBgkCgZsFZuex0kBNahZ
6163
domain=runnable-gamma.com
6264
mongo_port=27017
6365
new_relic_license_key=338516e0826451c297d44dc60aeaf0a0ca4bfead
@@ -70,6 +72,7 @@ registry_host=10.4.4.82
7072
swarm_token=d363b783f03a845a2c82b081bfe8443e
7173
user_content_domain=runnable.ninja
7274
api_hello_runnable_github_token=88ddc423c2312d02a8bbcaad76dd4c374a30e4af
75+
no_dd_monitoring=false
7376

7477
[ec2:vars]
7578
env=gamma

ansible/group_vars/alpha-mongo.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ db_path: "/opt/mongodb/db"
77
container_image: mongo
88
container_tag: "latest"
99
container_run_opts: "-d --name mongodb -p 27017:27017 -v {{ db_path }}:/data/db:rw"
10+
11+
# do not monitor docker-daemon for mongo, as there is none
12+
no_dd_monitoring: true

ansible/mongo.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
- { role: notify, tags: "notify" }
77
- { role: database }
88
- { role: container_kill_start, tags: "deploy" }
9+
- { role: datadog, tags: "datadog" }

ansible/rabbitmq.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
- { role: database }
88
- { role: rabbitmq }
99
- { role: container_kill_start, tags: "deploy" }
10+
- { role: datadog, tags: datadog }
Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,77 @@
11
---
22
- name: add https transport
3-
tags: ['datadog']
43
sudo: yes
54
apt:
65
name=apt-transport-https
76
state=latest
87

98
- name: add datadog apt key
10-
tags: ['datadog']
119
sudo: yes
1210
apt_key:
1311
id=C7A7DA52
1412
keyserver=keyserver.ubuntu.com
1513
state=present
1614

1715
- name: add datadog repository
18-
tags: ['datadog']
1916
sudo: yes
2017
apt_repository:
2118
repo='deb http://apt.datadoghq.com/ stable main'
2219
state=present
2320
update_cache=yes
2421

22+
- name: install dd agent
23+
sudo: yes
24+
apt:
25+
name=datadog-agent
26+
state=latest
27+
28+
- name: add docker to dd-agent group
29+
sudo: yes
30+
when: no_dd_monitoring != false
31+
user:
32+
name=dd-agent
33+
groups=docker
34+
35+
- name: create dd configdir
36+
sudo: yes
37+
file:
38+
path=/etc/dd-agent/conf.d
39+
owner=root
40+
mode=0555
41+
state=directory
42+
2543
- name: Create main Datadog agent configuration file
26-
tags: ['datadog']
2744
sudo: yes
2845
template:
2946
src=datadog.conf.j2
3047
dest=/etc/dd-agent/datadog.conf
3148
notify: restart datadog-agent
3249

3350
- name: install network checks for dock services
34-
tags: ['datadog']
3551
sudo: yes
3652
when: docker_config == "docks"
3753
template:
3854
src=tcp_check.yaml.j2
3955
dest=/etc/dd-agent/conf.d/tcp_check.yaml
4056
notify: restart datadog-agent
4157

58+
- name: install docker integration
59+
sudo: yes
60+
when: no_dd_monitoring != false
61+
template:
62+
src=docker_daemon.yaml.j2
63+
dest=/etc/dd-agent/conf.d/docker_daemon.yaml
64+
notify: restart datadog-agent
65+
66+
# assumes a config for {{ name }} exists
67+
- name: install datadog integrations
68+
sudo: yes
69+
template:
70+
src="{{ name }}.yaml.j2"
71+
dest="/etc/dd-agent/conf.d/{{ name }}.yaml"
72+
notify: restart datadog-agent
73+
4274
- name: force restart
43-
tags: ['datadogg']
4475
command: echo restart datadog
4576
when: force_restart is defined
4677
notify: restart datadog-agent
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
init_config:
2+
3+
instances:
4+
- url: "unix://var/run/docker.sock"
5+
new_tag_names: true
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
init_config:
2+
3+
instances:
4+
- server: mongodb://{{ datadog_mongodb_user }}:{{ datadog_mongodb_pwd }}@localhost:27017
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
init_config:
2+
3+
instances:
4+
- {{ name }}_api_url: http://localhost:54320/api/
5+
{{ name }}_user: {{ rabbit_username }}
6+
{{ name }}_pass: {{ rabbit_password }}

0 commit comments

Comments
 (0)