Skip to content

Commit 8538d72

Browse files
authored
Merge pull request #145 from ExpediaGroup/feature/datadog-tags-v2
fix: Add tags to Datadog agent
2 parents 34931f6 + 0642850 commit 8538d72

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file.
33

44
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).
55

6+
## [4.5.1] - 2024-05-08
7+
### Added
8+
- Adding tags to the Datadog agent
69

710
## [4.5.0] - 2024-04-25
811
### Added

ecs.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ resource "aws_ecs_service" "waggledance_service" {
1818
task_definition = aws_ecs_task_definition.waggledance[0].arn
1919
desired_count = var.wd_ecs_task_count
2020

21+
platform_version = "1.4.0"
22+
2123
propagate_tags = "SERVICE"
2224
tags = var.tags
2325

templates.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
locals {
88
default_exposed_endpoints = "health,info,metrics"
99
exposed_endpoints = var.prometheus_enabled ? join(",", [local.default_exposed_endpoints, "prometheus"]) : local.default_exposed_endpoints
10+
datadog_tags = join(" ", formatlist("%s:%s", keys(var.tags), values(var.tags)))
1011
}
1112

1213
data "template_file" "endpoints_server_yaml" {
@@ -206,5 +207,6 @@ data "template_file" "datadog-agent" {
206207
wd_instance_type = var.wd_instance_type
207208
metrics_port = var.metrics_port
208209
datadog_agent_version = var.datadog_agent_version
210+
datadog_tags = local.datadog_tags
209211
}
210212
}

templates/datadog-agent.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
{
2020
"name": "ECS_FARGATE",
2121
"value": "true"
22+
},
23+
{
24+
"name": "DD_TAGS",
25+
"value": "${datadog_tags}"
2226
}
2327
],
2428
"healthCheck": {

0 commit comments

Comments
 (0)