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

add_cloud_metadata: env var override for providers #38669

Merged
merged 10 commits into from
Apr 16, 2024

Conversation

axw
Copy link
Member

@axw axw commented Mar 28, 2024

Proposed commit message

Add support for configuring the add_cloud_metadata providers with an environment variable, $BEATS_ADD_CLOUD_METADATA_PROVIDERS. This may be useful when deploying Elastic Agent standalone in a cloud provider (e.g. in a managed Kubernetes cluster), where the cloud provider is known at deployment time.

This is intended as a workaround for #13816 and issues like it.

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

Run Metricbeat enough times on EC2 to trigger #13816, and then check that setting BEATS_ADD_CLOUD_METADATA_PROVIDERS=ec2 disables the openstack provider and the issue no longer occurs.

Related issues

Relates to #13816

Use cases

As a user deploying Elastic Agent standalone on EKS, I want to ensure that documents are enriched with EC2 cloud metadata.

Screenshots

N/A

Logs

N/A

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Mar 28, 2024
@mergify mergify bot assigned axw Mar 28, 2024
Copy link
Contributor

mergify bot commented Mar 28, 2024

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

Add support for configuring the add_cloud_metadata providers
with an environment variable, $BEATS_ADD_CLOUD_METADATA_PROVIDERS.

This may be useful when deploying Elastic Agent standalone in a
cloud provider managed Kubernetes cluster, where the cloud provider
is known at deployment time.
@axw axw added the Team:obs-ds-hosted-services Label for the Observability Hosted Services team label Mar 28, 2024
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Mar 28, 2024
@axw axw marked this pull request as ready for review March 28, 2024 06:29
@axw axw requested a review from a team as a code owner March 28, 2024 06:29
@elasticmachine
Copy link
Collaborator

Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services)

@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 28, 2024

💚 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: 114 min 43 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!)

Copy link
Contributor

@kaiyan-sheng kaiyan-sheng left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@axw axw added the backport-v8.13.0 Automated backport with mergify label Apr 15, 2024
@axw axw enabled auto-merge (squash) April 16, 2024 03:22
@axw axw merged commit d0399e0 into elastic:main Apr 16, 2024
200 of 204 checks passed
mergify bot pushed a commit that referenced this pull request Apr 16, 2024
* add_cloud_metadata: env var override for providers

Add support for configuring the add_cloud_metadata providers
with an environment variable, $BEATS_ADD_CLOUD_METADATA_PROVIDERS.

This may be useful when deploying Elastic Agent standalone in a
cloud provider managed Kubernetes cluster, where the cloud provider
is known at deployment time.

* Fix changelog

* appease golangci-lint

* More appeasement

(cherry picked from commit d0399e0)
@axw axw deleted the add_cloud_metadata_env branch April 16, 2024 10:19
axw added a commit that referenced this pull request Apr 16, 2024
…iders (#38965)

* add_cloud_metadata: env var override for providers (#38669)

* add_cloud_metadata: env var override for providers

Add support for configuring the add_cloud_metadata providers
with an environment variable, $BEATS_ADD_CLOUD_METADATA_PROVIDERS.

This may be useful when deploying Elastic Agent standalone in a
cloud provider managed Kubernetes cluster, where the cloud provider
is known at deployment time.

* Fix changelog

* appease golangci-lint

* More appeasement

(cherry picked from commit d0399e0)

* Update CHANGELOG.next.asciidoc

---------

Co-authored-by: Andrew Wilkins <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.13.0 Automated backport with mergify Team:obs-ds-hosted-services Label for the Observability Hosted Services team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants