Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use correct cgroup path for tasks which with long task ARN format #98

Merged
merged 2 commits into from
Sep 25, 2020
Merged

Use correct cgroup path for tasks which with long task ARN format #98

merged 2 commits into from
Sep 25, 2020

Conversation

hdj630
Copy link
Contributor

@hdj630 hdj630 commented Sep 25, 2020

Description of the issue

There are two formats of ECS task ARN as following. Currently, customer can opt-in the new ARN format.

  • arn:aws:ecs:region:aws_account_id:task/task-id (old)
  • arn:aws:ecs:region:aws_account_id:task/cluster-name/task-id (new)

Previously, if a task is with new ARN format, it will also contain "cluster-name" in its cgroup path, which is expected by CWAgent. But it is no longer the case after ECS Agent get upgraded. (According to this PR). Thus if customer launch a ECS cluster with latest ECS Agent, there is no "cluster-name" in its cgroup path which cause CWAgent fail to read cgroup stats.

Description of changes

This PR will make CWAgent to attempt to read task cgroup path without the "cluster-name" first. And fallback to read task cgroup path with the "cluster-name" in case for customers who are still using old version of ECS Agent.

License

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Tests

Test the CWAgent in latest ECS cluster with new ARN format enabled & disabled.

@yimuniao yimuniao merged commit 92d696a into aws:master Sep 25, 2020
sky333999 pushed a commit that referenced this pull request Jul 21, 2023
* Reduce Name Of EC2LinuxIntegrationTest To Show More Test Info In GHA (#666)

* nick-invision/retry@v2 Became nick-fields/retry@v2 Fix ECSEC2LaunchDa… (#669)

* update RELEASE_NOTES for 1.247358 (#676)

---------

Co-authored-by: Seth L <[email protected]>
Co-authored-by: Chad Patel <[email protected]>
lisguo added a commit to lisguo/amazon-cloudwatch-agent that referenced this pull request Oct 25, 2023
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.

2 participants