[8.13](backport #38669) add_cloud_metadata: env var override for providers #38965
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
- [ ] I have made corresponding change to the default configuration filesCHANGELOG.next.asciidoc
orCHANGELOG-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
This is an automatic backport of pull request #38669 done by Mergify.