Closed
Description
The resource providers that are used in #4 are SDK providers, and those are required to be immutable by the SDK by design (in the sense that it's not something that we might change easily).
As a consequence, adding some cloud resource providers like GCP or AWS should work, but this will further delay the agent (and likely the application) startup. Those type of metadata endpoints seem to have quite often long response times (in the order of seconds), which makes the problem even worse when trying multiple of them in a sequence for "automatic" cloud provider detection.
This is an additional challenge to having a suitable implementation to use, so far only the AWS implementation is available in the opentelemetry-contrib-java repo.
implementation idea
- remove the cloud resource providers from automatic service loader configuration, thus they aren't automatically executed by the SDK on agent startup.
- execute them explicitly and asynchronously when the agent starts, we might even start them in parallel or apply heuristics (for example on environment variables) to prioritize detection.
- buffering all the data is required while the cloud resource providers execute
- wrap all the
SpanData
at export time (in the span/metric exporter) to send with the updated resource once it's available (given it's expected to be immutable, it should be easily cacheable and avoid too much allocation).
Metadata
Metadata
Assignees
Labels
No labels