Skip to content
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

Consistently record host.id as a resource attribute #3574

Closed
mwear opened this issue Jan 27, 2023 · 2 comments · Fixed by #3575
Closed

Consistently record host.id as a resource attribute #3574

mwear opened this issue Jan 27, 2023 · 2 comments · Fixed by #3575
Assignees

Comments

@mwear
Copy link
Member

mwear commented Jan 27, 2023

Is your feature request related to a problem? Please describe.

I would like to be able to consistently record host.id as a resource attribute. The spec has the following description:

Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized Linux systems, the machine-id located in /etc/machine-id or /var/lib/dbus/machine-id may be used.

The cloud provider resource detectors (aws ec2, gcp, etc) add the host.id as spec'd but we don't have a way to easily add it for non-cloud hosts.

Describe the solution you'd like

I propose collecting the host.id in the existing HostDetector, which currently only collects non-cloud host attributes. Depending on OS there are files that can be read, or commands that can be executed to obtain the machine id. There is a well used library, nodde-machind-id that handles machine id discovery for *nix, MacOs, and Windows. We can use it, or write something comparable ourselves if we'd rather avoid a dependency.

Describe alternatives you've considered

If we don't think this functionality belongs in HostDetector we could introduce it in a separate detector.

Additional context

I'm planning to do this work and will open a PR shortly. We can continue discussions here and/or there.

@dyladan
Copy link
Member

dyladan commented Feb 9, 2023

@mwear did you open a spec issue for this?

@mwear
Copy link
Member Author

mwear commented Feb 11, 2023

I have a spec PR here: open-telemetry/opentelemetry-specification#3173

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants