vectordotdev / vectordotdev/vector
bug(aws_ecs_metrics source): issue with endpoint version detection
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 22.6k
- Forks
- 2.3k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 146
Description
Currently, the aws_ecs_metrics source has support for three different task metadata endpoints -- versions 2, 3, and 4 -- that are possible to encounter in the wild. It has logic to autodetect the highest version available based on environment variables that will be set by various versions of the ECS runtime/environment.
Crucially, while the logic that the source uses to check for version four, then version three, then version two, is sequenced correctly, it has the two environment variables to check for swapped: when it tries to look up if version 4 is being used (ECS_CONTAINER_METADATA_URI_V4), it actually checks the version 3 environment variable (ECS_CONTAINER_METADATA_URI), and vise versa.
Luckily, given AWS' support of simultaneous versions of the task metadata endpoint, and the way the code is arranged, users should always hit either the version 3 or version 2 endpoints in practice, and the payload parser is progressive, so we don't see outright errors when using the source... but it isn't correct, and we need to fix it.
The related code for the issue can be seen here.
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 in src/sources/aws_ecs_metrics/mod.rs around lines 43–60 and inspect the environment-variable checks used to detect task metadata endpoint versions 4, 3, and 2. Confirm each version checks its corresponding ECS variable, then verify the detection order remains highest to lowest and the source selects the expected endpoint version.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, rust
- Domain
- cloud, observability
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100