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] Added support for DesiredStatus and KnownStatus for ECS Tasks #32342

Merged
merged 9 commits into from
Jul 20, 2022

Conversation

girodav
Copy link
Contributor

@girodav girodav commented Jul 13, 2022

What does this PR do?

This PR adds DesiredStatus and KnownStatus among the collected metrics for ECS Fargate. The values are collected at the task level, not at the container level. More info at: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-metadata-endpoint-v4.html

This PR also includes some minor refactoring and fixes for golangci-lint related errors that were present prior to this change.

Why is it important?

See #32077

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.

How to test this PR locally

Inside x-pack/metricbeat/module/awsfargate/task_stats

  • go test to execute unit tests
  • go test -tags=integration to execute integration tests

To test the end-to-end data flow, the easiest approach would be running amazon-ecs-local-container-endpoints and metricbeat in two Docker containers on the same network (more info available at this blog post from AWS)

Related issues

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 13, 2022
@girodav girodav requested a review from a team July 13, 2022 10:50
@girodav girodav added the Team:Cloud-Monitoring Label for the Cloud Monitoring team label Jul 13, 2022
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 13, 2022
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 13, 2022

💚 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: 2022-07-19T15:28:16.323+0000

  • Duration: 96 min 8 sec

Test stats 🧪

Test Results
Failed 0
Passed 3864
Skipped 990
Total 4854

💚 Flaky test report

Tests succeeded.

🤖 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!)

@girodav girodav marked this pull request as ready for review July 14, 2022 09:48
@girodav girodav requested a review from a team as a code owner July 14, 2022 09:48
@girodav
Copy link
Contributor Author

girodav commented Jul 14, 2022

/test

Copy link
Contributor

@zmoog zmoog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I added a few comments for a couple of nonblocking aspects.

x-pack/metricbeat/module/awsfargate/task_stats/data.go Outdated Show resolved Hide resolved
@@ -148,15 +150,6 @@
},
"name": "query-metadata"
},
"event": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are those two fields no longer present in the data.json file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed the same but could not find the exact cause. That files was generated by executing go test -data -tags=integration inside task_stats

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Team:Cloud-Monitoring Label for the Cloud Monitoring team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Metricbeat] [AWS Fargate] Include 'DesiredStatus' and 'KnownStatus' fields with module/agent integration
4 participants