Skip to content

Make block I/O stat Op parsing case insensitive#4836

Merged
danehlim merged 1 commit into
aws:devfrom
danehlim:case-insensitive-blk-io-parsing
Jan 7, 2026
Merged

Make block I/O stat Op parsing case insensitive#4836
danehlim merged 1 commit into
aws:devfrom
danehlim:case-insensitive-blk-io-parsing

Conversation

@danehlim
Copy link
Copy Markdown
Contributor

@danehlim danehlim commented Jan 6, 2026

Summary

Make logic that parses block I/O Op from docker stats case insensitive.

This is because docker stats could return values of Op which may or may not have consistent capitalization (for example, Docker returns values of Op such as "read" and "write" for cgroups v2 as opposed to "Read" and "Write" for cgroups v1). Thus, without the change in this pull request, ECS Agent currently is susceptible to potentially ignore data that it actually should take it into account for storage metrics that ECS surfaces to CloudWatch.

Implementation details

See "Summary" section above.

Testing

New tests cover the changes: yes (new unit test added and existing integ test updated)

Manually performed the following end to end test:

  • Set up an ECS cluster with "Container Insights with enhanced observability" feature enabled with container instances using the latest AL2023 ECS-Optimized ARM64 AMI (which uses cgroups v2)
  • In the cluster, launch an ECS task which explicitly writes to storage
  • Observe that ECS emits a storage write metric value of 0 in CloudWatch
  • Subsequently, stop ECS Agent and relaunch a custom ECS Agent incorporating the changes from this pull request
  • After the custom ECS Agent has launched, confirm that ECS emits a nonzero storage write metric value in CloudWatch

Description for the changelog

Bugfix - Make block I/O stat Op parsing case insensitive

Additional Information

Does this PR include breaking model changes? If so, Have you added transformation functions?

No

Does this PR include the addition of new environment variables in the README?

No

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@danehlim danehlim force-pushed the case-insensitive-blk-io-parsing branch from a8c5484 to 56d9868 Compare January 6, 2026 23:50
@danehlim danehlim marked this pull request as ready for review January 6, 2026 23:58
@danehlim danehlim requested a review from a team as a code owner January 6, 2026 23:58
Comment thread agent/stats/engine_integ_test.go
singholt
singholt previously approved these changes Jan 7, 2026
prateekchaudhry
prateekchaudhry previously approved these changes Jan 7, 2026
singholt
singholt previously approved these changes Jan 7, 2026
@danehlim danehlim dismissed stale reviews from singholt and prateekchaudhry via 2de35c5 January 7, 2026 01:24
@danehlim danehlim force-pushed the case-insensitive-blk-io-parsing branch from 2a5b461 to 2de35c5 Compare January 7, 2026 01:24
@danehlim danehlim enabled auto-merge (rebase) January 7, 2026 05:07
@danehlim danehlim merged commit e23308f into aws:dev Jan 7, 2026
43 of 44 checks passed
@prateekchaudhry prateekchaudhry mentioned this pull request Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants