aws / amazon-cloudwatch-agent

CloudWatch Agent enables you to collect and export host-level metrics and logs on instances running Linux or Windows server.
MIT License
435 stars 196 forks source link

v1.300046.0 doesn't work on ECS Fargate #1343

Open rchanbg opened 1 week ago

rchanbg commented 1 week ago

Describe the bug Latest version v1.300046.0 doesn't work on ECS Fargate. The following error is presented: 2024-09-10T16:45:28Z W!

{
    "caller": "entitystore/ec2Info.go:64",
    "msg": "Failed to get Instance Id through metadata provider",
    "kind": "extension",
    "name": "entitystore",
    "error": "EC2MetadataRequestError: failed to get EC2 instance identity document\ncaused by: RequestError: send request failed\ncaused by: Get \"http://169.254.169.254/latest/dynamic/instance-identity/document\": dial tcp 169.254.169.254:80: connect: invalid argument"
}

caused by: Put "http://169.254.169.254/latest/api/token": dial tcp 169.254.169.254:80: connect: invalid argumentD! should retry true for imds error : RequestError: send request failed

Steps to reproduce Running the cloudwatch agent as a sidecar container in ECS Fargate

What did you expect to see? No error related to imds

What did you see instead? imds errors

What version did you use? v1.300046.0

What config did you use? Default config

Environment ECS Fargate

Additional context Previous version 1.300045.1 works fine.

jefchien commented 6 days ago

v1.300046.0 makes additional calls to IMDS to get instance information using the AWS SDK, but should not have issues getting the token. We recommend using v1.300045.1 and have updated the latest tag to point to that version.