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 |
gregkalapos
left a comment
There was a problem hiding this comment.
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.
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.
Will change to info - agree that warning seems way too strong
bmorelli25
left a comment
There was a problem hiding this comment.
Same comment as Greg, otherwise docs LG
Co-authored-by: Brandon Morelli <bmorelli25@gmail.com>
|
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