Skip to content

Commit

Permalink
Merge pull request #778 from habitat-sh/SA/terraform-mcache
Browse files Browse the repository at this point in the history
Terraform - add memcache stats to datadog
  • Loading branch information
chefsalim committed Nov 4, 2018
2 parents 7ad1708 + 138950a commit d15a4d9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions terraform/files/mcache.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
init_config:

instances:
- url: localhost # url used to connect to the memcached instance
# socket: /socket/path # if url missing; 'dd-agent' user must have read/write permission
# port: 11211 # If this line is not present, port will default to 11211
# username: my_username
# password: my_password
# tags:
# - optional_tag

# options:
# items: false # set to true if you wish to collect items memcached stats.
# slabs: false # set to true if you wish to collect slabs memcached stats.
6 changes: 6 additions & 0 deletions terraform/instances.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ resource "aws_instance" "api" {
destination = "/tmp/nginx.yaml"
}

provisioner "file" {
source = "${path.module}/files/mcache.yaml"
destination = "/tmp/mcache.yaml"
}

provisioner "file" {
source = "${path.module}/files/nginx.logrotate"
destination = "/tmp/nginx.logrotate"
Expand All @@ -63,6 +68,7 @@ resource "aws_instance" "api" {
provisioner "remote-exec" {
inline = [
"sudo cp /tmp/nginx.yaml /etc/dd-agent/conf.d/nginx.yaml",
"sudo cp /tmp/mcache.yaml /etc/dd-agent/conf.d/mcache.yaml",
"sudo cp /tmp/nginx.logrotate /etc/logrotate.d/nginx",
"sudo /etc/init.d/datadog-agent start"
]
Expand Down

0 comments on commit d15a4d9

Please sign in to comment.