Skip to content

Commit

Permalink
Merge pull request #15 from lagerfeuer/master
Browse files Browse the repository at this point in the history
Add Datadog Process collection for ECS
  • Loading branch information
robertomoutinho authored Dec 29, 2023
2 parents f0c0ac7 + 61a79e7 commit 0f5054e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ This repository contains Terraform infrastructure code which creates AWS resourc
| <a name="input_datadog_agent_container_image"></a> [datadog\_agent\_container\_image](#input\_datadog\_agent\_container\_image) | The datadog agent sidecar container image | `string` | `"datadog/agent:latest"` | no |
| <a name="input_datadog_firelens_container_essential"></a> [datadog\_firelens\_container\_essential](#input\_datadog\_firelens\_container\_essential) | Determines whether all other containers in a task are stopped, if this container fails or stops for any reason | `bool` | `false` | no |
| <a name="input_datadog_firelens_container_image"></a> [datadog\_firelens\_container\_image](#input\_datadog\_firelens\_container\_image) | The datadog firelens sidecar container image | `string` | `"amazon/aws-for-fluent-bit:stable"` | no |
| <a name="input_datadog_process_collection_enabled"></a> [datadog\_process\_collection\_enabled](#input\_datadog\_process\_collection\_enabled) | Whether to enable process collection | `bool` | `true` | no |
| <a name="input_datadog_service_name"></a> [datadog\_service\_name](#input\_datadog\_service\_name) | The datadog service name | `string` | `""` | no |
| <a name="input_datadog_tags"></a> [datadog\_tags](#input\_datadog\_tags) | Tags for datadog agent container. | `string` | `"env:default, service:default, region:default"` | no |
| <a name="input_docker_labels"></a> [docker\_labels](#input\_docker\_labels) | Docker labels to add to the container | `map(string)` | `{}` | no |
Expand Down
4 changes: 4 additions & 0 deletions dd-agent.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ module "datadog_sidecar" {
name = "DD_TAGS"
value = replace(var.datadog_tags, ",", " ")
},
{
name = "DD_PROCESS_AGENT_PROCESS_COLLECTION_ENABLED"
value = tostring(var.datadog_process_collection_enabled)
}
]

secrets = [
Expand Down
3 changes: 3 additions & 0 deletions ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -206,5 +206,8 @@ resource "aws_ecs_task_definition" "app" {
}
}
}

pid_mode = var.datadog_process_collection_enabled ? "task" : null

tags = local.local_tags
}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,12 @@ variable "datadog_service_name" {
default = ""
}

variable "datadog_process_collection_enabled" {
description = "Whether to enable process collection"
type = bool
default = true
}

variable "datadog_tags" {
description = " Tags for datadog agent container."
type = string
Expand Down

0 comments on commit 0f5054e

Please sign in to comment.