Skip to content

Commit

Permalink
fix: Add tags to Datadog agent
Browse files Browse the repository at this point in the history
  • Loading branch information
eddydecena committed May 8, 2024
1 parent 34931f6 commit 0642850
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [4.5.1] - 2024-05-08
### Added
- Adding tags to the Datadog agent

## [4.5.0] - 2024-04-25
### Added
Expand Down
2 changes: 2 additions & 0 deletions ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ resource "aws_ecs_service" "waggledance_service" {
task_definition = aws_ecs_task_definition.waggledance[0].arn
desired_count = var.wd_ecs_task_count

platform_version = "1.4.0"

propagate_tags = "SERVICE"
tags = var.tags

Expand Down
2 changes: 2 additions & 0 deletions templates.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
locals {
default_exposed_endpoints = "health,info,metrics"
exposed_endpoints = var.prometheus_enabled ? join(",", [local.default_exposed_endpoints, "prometheus"]) : local.default_exposed_endpoints
datadog_tags = join(" ", formatlist("%s:%s", keys(var.tags), values(var.tags)))
}

data "template_file" "endpoints_server_yaml" {
Expand Down Expand Up @@ -206,5 +207,6 @@ data "template_file" "datadog-agent" {
wd_instance_type = var.wd_instance_type
metrics_port = var.metrics_port
datadog_agent_version = var.datadog_agent_version
datadog_tags = local.datadog_tags
}
}
4 changes: 4 additions & 0 deletions templates/datadog-agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
{
"name": "ECS_FARGATE",
"value": "true"
},
{
"name": "DD_TAGS",
"value": "${datadog_tags}"
}
],
"healthCheck": {
Expand Down

0 comments on commit 0642850

Please sign in to comment.