aws-samples / aws-samples/amazon-cloudwatch-container-insights

Missing AWS_EMF_AGENT_ENDPOINT environment variable in example ECS task definition for EMF

Open
#101 0 comments 1 reaction 0 assignees View on GitHub
good first issue
Dominant language
Shell
Stars
178
Forks
117
Avg merge
1d 10h
Merged PRs (30d)
3

Description

I'm deploying my app on ECS and I'm using EMF to publish structured logs and metrics. I'm using [the Java client library](https://github.com/awslabs/aws-embedded-metrics-java) and [the example task definition](https://github.com/aws-samples/amazon-cloudwatch-container-insights/blob/062b626aba4f7f290e5101d0f4c33014884535eb/ecs-task-definition-templates/deployment-mode/sidecar/cwagent-emf/cwagent-emf-ec2.json), but I can not get my logs received by the CloudWatch Agent.

After some investigation, I found I'm missing a **AWS_EMF_AGENT_ENDPOINT** envirionment variable in the definition. Also, this variable is included in [the AWS documentation for using EMF with CloudWatch Agent](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Embedded_Metric_Format_Generation_CloudWatch_Agent.html), so I think it should be included in the 2 examples here as well (EC2 and Fargate) to avoid confusion to customers.

Contributor guide

Open the contributing guide

Research direction

Start with ecs-task-definition-templates/deployment-mode/sidecar/cwagent-emf/cwagent-emf-ec2.json and locate the corresponding Fargate EMF example. Compare both task definitions with the linked CloudWatch documentation, then verify that the AWS_EMF_AGENT_ENDPOINT setting is represented consistently in both examples; done means the examples match the documented EMF setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java
Domain
cloud, devops, observability-sre
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.