elastic / elastic-otel-java

Apache License 2.0
14 stars 12 forks source link

Simplify resource attributes implementation #257

Closed SylvainJuge closed 4 months ago

SylvainJuge commented 4 months ago

Description

The cloud resource attributes detection is included and enabled by default for GCP and AWS. That's in line with our focus on a good on-boarding experience, things have to be enabled by default if we can.

For GCP and AWS, those are also included in the upstream otel agent, but disabled by default.

In addition to the default, we also execute the "time costly" ones asynchronously as an attempt to minimize the application startup overhead: those providers, in particular the EC2 one, have to call a metadata endpoint which can cause delays due to DNS or TLS handshake.

In addition to this, there are multiple ways to control which of those are enabled or not in updtream agent (sdk autoconfiguration):

The problem here is that we have to re-implement the configuration to support the following use-cases that work out-of-the-box with the upstream agent:

Proposal

Further improvements in the future

See if and how the results of the OpenTelemetry Entity Data Model allow to implement this in a better way by enabling to provide those attributes asynchronously: https://docs.google.com/document/d/1FdhTOvB1xhx7Ks7dFW6Ht1Vfw2myU6vyKtEfr_pqZPw/edit#heading=h.h8e21dbp9mv2