Skip to content

Commit

Permalink
fix: Enable Datadog filtering for HMS/WD metrics on ECS with Apiary t…
Browse files Browse the repository at this point in the history
…ags (#252)

Co-authored-by: Eddy Perez <[email protected]>
  • Loading branch information
eddydecena and Eddy Perez authored Mar 25, 2024
1 parent 2a758e3 commit 510cf55
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions common.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ locals {
apiary_bucket_prefix = "${local.instance_alias}-${data.aws_caller_identity.current.account_id}-${data.aws_region.current.name}"
apiary_assume_role_bucket_prefix = [for assumerole in var.apiary_assume_roles : "${local.instance_alias}-${data.aws_caller_identity.current.account_id}-${lookup(assumerole, "allow_cross_region_access", false) ? "*" : data.aws_region.current.name}"]
enable_route53_records = var.apiary_domain_name == "" ? false : true

datadog_tags = join(" ", formatlist("%s:%s", keys(var.apiary_tags), values(var.apiary_tags)))
#
# Create a new list of maps with some extra attributes needed later
#
Expand Down
2 changes: 2 additions & 0 deletions templates.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ locals{
metrics_port = var.datadog_metrics_port
datadog_agent_version = var.datadog_agent_version
datadog_agent_enabled = var.datadog_agent_enabled
datadog_tags = local.datadog_tags
})

hms_readonly_template = templatefile("${path.module}/templates/apiary-hms-readonly.json", {
Expand Down Expand Up @@ -118,5 +119,6 @@ locals{
wd_instance_type = var.hms_instance_type
metrics_port = var.datadog_metrics_port
datadog_agent_version = var.datadog_agent_version
datadog_tags = local.datadog_tags
})
}
4 changes: 4 additions & 0 deletions templates/apiary-hms-readonly.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@
{
"name": "ECS_FARGATE",
"value": "true"
},
{
"name": "DD_TAGS",
"value": "${datadog_tags}"
}
]
}
Expand Down
4 changes: 4 additions & 0 deletions templates/apiary-hms-readwrite.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@
{
"name": "ECS_FARGATE",
"value": "true"
},
{
"name": "DD_TAGS",
"value": "${datadog_tags}"
}
]
}
Expand Down

0 comments on commit 510cf55

Please sign in to comment.