Improve logging for IMDS failures
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 193
- Forks
- 73
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 3
Description
When the daemon starts up, it searches for metadata about the host or container it's operating on. First it tries to ping IMDS (for EC2 hosts) then TMDE (for ECS containers). If the IMDS call fails, it logs something like:
2023-02-16T08:16:14Z [Error] Get instance id metadata failed: RequestError: send request failed
caused by: Get "http://169.254.169.254/latest/meta-data/instance-id": dial tcp 169.254.169.254:80: connect: invalid argument
However on e.g. Fargate services, the IMDS call will always fail and this is expected. We should improve this logging so that on Fargate it doesn't log any errors, and it only logs a warning if both IMDS & TMDE fail.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at daemon startup where host or container metadata is looked up, then trace the IMDS and TMDE request handling and its logging. Reproduce the Fargate case if possible and verify that an IMDS failure alone is not logged as an error, while failure of both lookups produces a warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100