vectordotdev / vectordotdev/vector

bug(aws_ecs_metrics source): issue with endpoint version detection

Open Beginner friendly
#12,917 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

source: aws_ecs_metrics
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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.