Skip to content

Instrumenting ECS Fargate Services

Note

The following steps must be completed for each ECS Fargate service that should be instrumented.

1. Verify Datadog prerequisites

Before enrolling AWS services such as ECS Fargate or Lambda functions in Datadog, the following must already be configured:

  • Datadog AWS Integration
  • Datadog Log Forwarder
  • AWS IAM policies related to Datadog and API keys

These steps only need to be completed once per AWS account that will be enrolled in Datadog.

Contact Team Cloud to verify that this setup has already been completed.


2. Locate the Terraform code for the service

Find the Terraform configuration that manages the ECS Fargate service for your product.

Example:

BYM-IKT/SykkelhotellInfrastruktur/BYM-DP-Sykkelhotell-Prod/prod/eu-west-1/sykkelhotell/main.tf


3. Enable observability in Terraform

Set enable_observability to true for the ECS service configuration.

main.tf
module "app_master_module" {
  source = "git@github.com:BYM-IKT/terraform-byks-module.git?ref=v10"

  ecs_services = {
    sykkelhotell-service = {
      ...
      enable_observability = true
    }
  }
}

5. Instrument the Application Code

Instrument the application so it emits traces, metrics, and logs.

Reference implementations: