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

[metricbeat] [gcp] remove compute metadata cache #33655

Merged
merged 11 commits into from Dec 5, 2022

Conversation

gpop63
Copy link
Contributor

@gpop63 gpop63 commented Nov 11, 2022

What does this PR do?

Removes compute metadata cache.

Why is it important?

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

Related issues

Use cases

Screenshots

Logs

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Nov 11, 2022
@gpop63 gpop63 changed the title [metricbeat] [gc] remove compute metadata cache [metricbeat] [gcp] remove compute metadata cache Nov 11, 2022
@gpop63 gpop63 added the Team:Cloud-Monitoring Label for the Cloud Monitoring team label Nov 11, 2022
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Nov 11, 2022
@mergify mergify bot assigned gpop63 Nov 11, 2022
@mergify
Copy link
Contributor

mergify bot commented Nov 11, 2022

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @gpop63? 🙏.
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

@gpop63 gpop63 added backport-v7.17.0 Automated backport with mergify backport-v8.4.0 Automated backport with mergify labels Nov 11, 2022
@elasticmachine
Copy link
Collaborator

elasticmachine commented Nov 11, 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-12-05T19:27:56.062+0000

  • Duration: 54 min 23 sec

Test stats 🧪

Test Results
Failed 0
Passed 1392
Skipped 90
Total 1482

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

@gpop63
Copy link
Contributor Author

gpop63 commented Nov 15, 2022

/test

@gpop63 gpop63 force-pushed the remove_gcp-compute_metadata_cache branch from efb1722 to 114a009 Compare November 15, 2022 11:22
@endorama
Copy link
Member

@gpop63 I like the direction this is headed, can we move forward with it?

@gpop63 gpop63 marked this pull request as ready for review November 23, 2022 21:29
@gpop63 gpop63 requested a review from a team as a code owner November 23, 2022 21:29
"github.com/elastic/beats/v7/x-pack/metricbeat/module/gcp"
"github.com/elastic/elastic-agent-libs/logp"
)

/*
const (
Copy link
Contributor

Choose a reason for hiding this comment

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

can we remove these const since we are not using it anymore? :)

Copy link
Member

@endorama endorama left a comment

Choose a reason for hiding this comment

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

Logic is correct, can you please clean up all the commented code?

@mergify
Copy link
Contributor

mergify bot commented Dec 1, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b remove_gcp-compute_metadata_cache upstream/remove_gcp-compute_metadata_cache
git merge upstream/main
git push upstream remove_gcp-compute_metadata_cache

projectID: "projectID",
instanceCache: common.NewCache(30*time.Second, 13),
projectID: "projectID",
// instanceCache: common.NewCache(30*time.Second, 13),
Copy link
Member

Choose a reason for hiding this comment

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

Can we get rid of this too?

region string
regions []string
opt []option.ClientOption
// instanceCache *common.Cache
Copy link
Member

Choose a reason for hiding this comment

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

Can we get rid of this too?

@mergify
Copy link
Contributor

mergify bot commented Dec 2, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b remove_gcp-compute_metadata_cache upstream/remove_gcp-compute_metadata_cache
git merge upstream/main
git push upstream remove_gcp-compute_metadata_cache

@sonarcloud
Copy link

sonarcloud bot commented Dec 5, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.3% 0.3% Duplication

@gpop63 gpop63 merged commit 74edd05 into elastic:main Dec 5, 2022
mergify bot pushed a commit that referenced this pull request Dec 5, 2022
* remove compute metadata cache

* add logs and change map key type

* add import aliases

* add changelog entry

* cleanup comments

* remove comments

(cherry picked from commit 74edd05)

# Conflicts:
#	x-pack/metricbeat/module/gcp/metrics/compute/metadata.go
mergify bot pushed a commit that referenced this pull request Dec 5, 2022
* remove compute metadata cache

* add logs and change map key type

* add import aliases

* add changelog entry

* cleanup comments

* remove comments

(cherry picked from commit 74edd05)

# Conflicts:
#	x-pack/metricbeat/module/gcp/metrics/compute/metadata.go
gpop63 added a commit that referenced this pull request Feb 6, 2023
…che (#33948)

* [metricbeat] [gcp] remove compute metadata cache (#33655)

* remove compute metadata cache

* add logs and change map key type

* add import aliases

* add changelog entry

* cleanup comments

* remove comments

(cherry picked from commit 74edd05)

# Conflicts:
#	x-pack/metricbeat/module/gcp/metrics/compute/metadata.go

* fix CHANGELOG

* fix merge conflicts

* fix linter

* remove unused package

---------

Co-authored-by: Gabriel Pop <94497545+gpop63@users.noreply.github.com>
Co-authored-by: Edoardo Tenani <edoardo.tenani@elastic.co>
Co-authored-by: Edoardo Tenani <526307+endorama@users.noreply.github.com>
chrisberkhout pushed a commit that referenced this pull request Jun 1, 2023
* remove compute metadata cache

* add logs and change map key type

* add import aliases

* add changelog entry

* cleanup comments

* remove comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v7.17.0 Automated backport with mergify backport-v8.4.0 Automated backport with mergify Team:Cloud-Monitoring Label for the Cloud Monitoring team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GCP metadata instance cache is never refreshed but also never used
4 participants