Start generating `host.id` from Beyla
grcevski opened this issue · comments
In case Beyla is directly generating OpenTelemetry data and pushing it to an endpoint, without the support of the OpenTelemetry collector, the host.id
field will not be populated, since we don't generate it at the moment.
Beyla should generate the host.id
field, when configured to do so.
The collector implementation, which is able to get host.id from a wide range of environments and doesn't rely on Go SDK/Contrib resource detectors: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/resourcedetectionprocessor/factory.go#L49
If we decide to implement using the Go SDK:
For bare-metal host, an extension method is part of the SDK: https://pkg.go.dev/go.opentelemetry.io/otel/sdk/resource#WithHostID
There's a contrib resource detector for AWS: https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/detectors/aws
There's another contrib resource detector for GCP: https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/detectors/gcp
There's a PR in flight for Azure which will be merged soon: open-telemetry/opentelemetry-go-contrib#5422
Thanks @pyohannes!