feat(new transform): add AWS ECS metadata transform#25579
Conversation
When container_name is configured, select the container from /task directly instead of requiring the current-container endpoint to succeed. Also add support for the documented container Snapshotter scalar field and cover both changes with regression tests.
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fec5314883
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
rtrieu
left a comment
There was a problem hiding this comment.
left some editorial suggestions
| ] | ||
| warnings: [ | ||
| """ | ||
| Do not enable this transform if you are running Vector as an Aggregator, metadata |
There was a problem hiding this comment.
| Do not enable this transform if you are running Vector as an Aggregator, metadata | |
| Do not enable this transform if you are running Vector as an Aggregator. Metadata |
| warnings: [ | ||
| """ | ||
| Do not enable this transform if you are running Vector as an Aggregator, metadata | ||
| will be sourced from the Aggregator task's metadata endpoint and not the client's. |
There was a problem hiding this comment.
| will be sourced from the Aggregator task's metadata endpoint and not the client's. | |
| will be sourced from the Aggregator task's metadata endpoint and not the originating task's endpoint. |
| } | ||
| } | ||
| required: { | ||
| description: "Requires the transform to be able to successfully query the ECS metadata before starting to process the data." |
There was a problem hiding this comment.
| description: "Requires the transform to be able to successfully query the ECS metadata before starting to process the data." | |
| description: "If true, Vector will not start until ECS metadata is successfully retrieved." |
| } | ||
| } | ||
| initial_retry_attempts: { | ||
| description: "The number of initial metadata refresh attempts before the transform starts." |
There was a problem hiding this comment.
| description: "The number of initial metadata refresh attempts before the transform starts." | |
| description: "The number of times to attempt fetching metadata at startup before Vector begins processing events." |
| } | ||
| } | ||
| refresh_interval_secs: { | ||
| description: "The interval between querying for updated metadata, in seconds." |
There was a problem hiding this comment.
| description: "The interval between querying for updated metadata, in seconds." | |
| description: "Interval between metadata refresh requests, in seconds." |
| ] | ||
| warnings: [ | ||
| """ | ||
| Do not enable this transform if you are running Vector as an Aggregator, metadata |
There was a problem hiding this comment.
| Do not enable this transform if you are running Vector as an Aggregator, metadata | |
| Do not enable this transform if you are running Vector as an Aggregator. Metadata |
| } | ||
| } | ||
| required: { | ||
| description: "Requires the transform to be able to successfully query the ECS metadata before starting to process the data." |
There was a problem hiding this comment.
| description: "Requires the transform to be able to successfully query the ECS metadata before starting to process the data." | |
| description: "Requires the transform to successfully query the ECS metadata endpoint before processing events." |
|
Thanks for the suggestions. I applied them in 7df82ed. |
Summary
Adds a new
aws_ecs_metadatatransform that enriches log and metric events with Amazon ECS task metadata from the ECS Task Metadata v4 endpoint.The transform supports the ECS metadata endpoint exposed through
ECS_CONTAINER_METADATA_URI_V4, with an explicitendpointoverride for tests and non-standard deployments. It fetches task metadata at startup, refreshes it periodically, and can optionally require metadata availability before Vector starts processing events.This PR also adds component reference documentation, generated docs, and a changelog fragment.
Generated substantially with Codex (gpt-5.5 default).
Vector configuration
For local testing with a mock endpoint:
How did you test this PR?
I validated the implementation with unit tests, documentation checks, and local equivalents of the relevant CI checks.
Ran successfully:
make check-fmtmake check-clippymake testmake check-events./scripts/check_changelog_fragments.shmake check-markdownmake check-licensesmake check-denymake check-deny-licensesmise exec node@22 cue@0.16.1 -- make check-docscd website && mise exec node@22 cue@0.16.1 -- make cue-buildmise exec node@22 cue@0.16.1 -- make check-generated-docscd rust-doc && make ci-docs-buildmake test-vrlcd lib/vector-vrl/web-playground && wasm-pack build --target web --out-dir public/pkgAdditional real AWS validation:
Provisioned temporary ECS test infrastructure with OpenTofu and validated the transform against the ECS Task Metadata v4 endpoint in all targeted ECS execution environments.
container_nameoverrideFARGATEEC2MANAGED_INSTANCESThe ECS validation task ran a Vector container from this PR branch plus an
appsidecar container. The Vector config exercised both default current-container enrichment andcontainer_name: appenrichment, and verified enriched log events and internal metrics in CloudWatch Logs.I can provide the detailed validation report, CloudWatch Logs evidence samples, and the OpenTofu reproduction code if reviewers would like to inspect the setup in more detail.
Change Type
Is this a breaking change?
Does this PR include user facing changes?
no-changeloglabel to this PR.Changelog fragment added:
changelog.d/2894_aws_ecs_metadata_transform.feature.mdReferences
Notes
The implementation intentionally mirrors the existing
aws_ec2_metadatatransform shape where practical, while keeping ECS-specific behavior isolated:requiredcontrols whether startup must fail when metadata cannot be fetched;