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

[AWS Fargate] Add memory hard limit from container metadata and remove usage percentage #37194

Merged

Conversation

lucian-ioan
Copy link
Contributor

@lucian-ioan lucian-ioan commented Nov 24, 2023

Proposed commit message

Add memory hard limit from container metadata and remove usage percentage.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • [ ]

How to test this PR locally

  1. Follow the AWS Fargate blogpost to create to set up the integration and create the resources.

  2. Be sure that your resource has cmd execution rights, for example add "enable-execute-command" argument while creating the resource via the AWS CLI:

aws ecs create-service \
    --cluster cluster-name \
    --task-definition task-definition-name \
    --enable-execute-command \
    --service-name service-name \
    --desired-count 1
  1. Run the shell via AWS CLI via:
aws ecs execute-command --cluster cluster-name \
    --task task-id \
    --container container-name \
    --interactive \
    --command "/bin/sh"
  1. Retrieve ECS_CONTAINER_METADATA_URI_V4 via echo $ECS_CONTAINER_METADATA_URI_V4.

  2. Fetch task data via curl:

curl $ECS_CONTAINER_METADATA_URI_V4/task
curl $ECS_CONTAINER_METADATA_URI_V4/task/stats
  1. Check data with the one fetched from the agent deployed in AWS (note that the agent needs to be built from the code in this PR).

Related issues

@lucian-ioan lucian-ioan self-assigned this Nov 24, 2023
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Nov 24, 2023
@lucian-ioan lucian-ioan added the Team:Integrations Label for the Integrations team label Nov 24, 2023
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Nov 24, 2023
Copy link
Contributor

mergify bot commented Nov 24, 2023

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @lucian-ioan? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@elasticmachine

This comment was marked as outdated.

@lucian-ioan lucian-ioan force-pushed the awsfargate_metricbeat_memory_limits branch from d5344b0 to e747537 Compare November 28, 2023 17:56
@elasticmachine

This comment was marked as outdated.

@elasticmachine

This comment was marked as outdated.

@elasticmachine

This comment was marked as outdated.

@lalit-satapathy
Copy link
Contributor

lalit-satapathy commented Nov 29, 2023

CC: @agithomas @shmsr to planing the review once the PR is opened.

@lucian-ioan lucian-ioan force-pushed the awsfargate_metricbeat_memory_limits branch from 4a52ebd to 8a3e623 Compare November 30, 2023 04:36
@elasticmachine

This comment was marked as outdated.

@lucian-ioan lucian-ioan force-pushed the awsfargate_metricbeat_memory_limits branch from 49e65da to ad0a9e8 Compare November 30, 2023 13:14
@elasticmachine

This comment was marked as outdated.

@lucian-ioan lucian-ioan force-pushed the awsfargate_metricbeat_memory_limits branch from 4e73b12 to 4082276 Compare November 30, 2023 14:05
@elasticmachine

This comment was marked as outdated.

@elasticmachine

This comment was marked as outdated.

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-11-30T14:29:49.526+0000

  • Duration: 75 min 45 sec

Test stats 🧪

Test Results
Failed 0
Passed 4698
Skipped 1015
Total 5713

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@lucian-ioan lucian-ioan marked this pull request as ready for review November 30, 2023 16:01
@lucian-ioan lucian-ioan requested a review from a team as a code owner November 30, 2023 16:01
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Duration: 70 min 42 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@lucian-ioan lucian-ioan force-pushed the awsfargate_metricbeat_memory_limits branch from e4dab69 to e1d2e62 Compare December 5, 2023 17:43
@elasticmachine

This comment was marked as outdated.

@elasticmachine

This comment was marked as outdated.

@elasticmachine

This comment was marked as outdated.

@elasticmachine

This comment was marked as outdated.

@elasticmachine

This comment was marked as outdated.

@lucian-ioan lucian-ioan requested a review from gpop63 December 5, 2023 20:18
@elasticmachine

This comment was marked as outdated.

@elasticmachine

This comment was marked as outdated.

@elasticmachine

This comment was marked as outdated.

@gpop63
Copy link
Contributor

gpop63 commented Dec 5, 2023

@lucian-ioan you were able to get actual container limits while testing this with a custom built agent containing these changes, right?

@lucian-ioan
Copy link
Contributor Author

@gpop63 yes, tested multiple times and the memory limits line up with what I set in AWS.

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-12-05T20:44:37.193+0000

  • Duration: 78 min 33 sec

Test stats 🧪

Test Results
Failed 0
Passed 4650
Skipped 1015
Total 5665

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@lucian-ioan lucian-ioan merged commit 16b713b into elastic:main Dec 5, 2023
33 checks passed
Scholar-Li pushed a commit to Scholar-Li/beats that referenced this pull request Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[AWS Fargate] Add Memory Hard Limit from container metadata
6 participants