Consume v4 container metadata handler from ecs-agent module #3727
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Consume v4 container metadata handler from ecs-agent module. The handler was added to ecs-agent module in #3720.
Implementation details
type TMDSAgentState struct
that implementsAgentState
interface introduced in Add v4 container metadata handler to ecs-agent module #3720.AgentState
interface has methods that ecs-agent module uses to get metadata information from Agent.tmdsv4.ContainerMetadataHandler
function imported from ecs-agent module. The handler from ecs-agent module supports publishing of metrics, however, since ECS Agent does not support metrics publishing,metrics.NewNopEntryFactory()
was used to supply the handler a no-op implementation of metrics publishing.ContainerMetadataHandler
function fromagent/handlers/v4/container_metadata_handler.go
file.Testing
Test driven development practice was followed and unit tests for container metadata endpoints were improved in #3722 as a part of that. The improved unit tests, existing integration tests, and existing functional tests are passing.
In addition to automated tests, manual regression, stress, and performance testing was performed. For manual testing, Agent was built and run on an EC2 instance from the source in this PR. Another EC2 instance was provisioned with Agent v1.71.1.
Manual regression testing was done by calling v4 container metadata endpoints on the two instances for the same task (two replicas under a service), and the responses were compared using
diff
. No regression was detected.For stress testing, v4 container metadata endpoint was called on both instances at 3000 rps. 100% success rate was achieved on both instances and no significant differences were seen in the throughput (both instances achieved ~3000 rps throughput).
For performance testing, profiling data was collected for heap and cpu usage from the two Agents while stress testing v4 container metadata endpoints. No significant differences were seen in CPU and heap usage.
New tests cover the changes: no
Description for the changelog
Consume v4 container metadata handler from ecs-agent module.
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.