-
Notifications
You must be signed in to change notification settings - Fork 206
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 #1003
Add Cloud Metadata #1003
Conversation
This commit adds the fetching of cloud metadata to the agent, to send as part of the agent metadata when an agent is running in a Cloud provider. On starting the payload sender's work loop, the first iteration will asynchronously fetch the metadata for the cloud provider specified with the ELASTIC_APM_CLOUD_PROVIDER env var, or the ElasticApm:CloudProvider app setting. Values are aws, gcp, azure and false. When false is specified, no cloud metadata providers are registered, so there are no attempts to fetch metadata. The default value of null or "" will attempt to fetch metadata using all registered providers. Closes elastic#918
jenkins run the tests please |
Will follow up in a separate PR for retrieving metadata for Azure App Services |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, LGTM!
I left 1 comment regarding printing warnings - definitely not a blocker, it's for consideration.
} | ||
catch (Exception e) | ||
{ | ||
_logger.Warning()?.LogException(e, "Unable to get {Provider} cloud metadata", Provider); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure about the Warning
level? Given the default for this setting is to try all ICloudMetadataProvider
implementations, the agent will start with 3 warnings in non-cloud and with 2 if it runs in one of the cloud providers.
I feel we should use info
here.
We have a similar situation with the central config fetcher and I see people are very confused about those warnings as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will change to info
- agree that warning
seems way too strong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as Greg, otherwise docs LG
Co-authored-by: Brandon Morelli <[email protected]>
jenkins run the tests please |
Relates: elastic/apm#256
This commit adds the fetching of cloud metadata to
the agent, to send as part of the agent metadata
when an agent is running in a Cloud provider.
On starting the payload sender's work loop,
the first iteration will asynchronously fetch
the metadata for the cloud provider specified with
the ELASTIC_APM_CLOUD_PROVIDER env var, or the
ElasticApm:CloudProvider app setting. Values
are aws, gcp, azure and false. When false is
specified, no cloud metadata providers are
registered, so there are no attempts to fetch
metadata. The default value of null or ""
will attempt to fetch metadata using all registered
providers.
Closes #918