aws / aws/aws-xray-daemon

Improve logging for IMDS failures

Open
#190 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.