Skip to content

Commit

Permalink
prefer /etc/machine-id over /var/lib/dbus; specify linux for privileg…
Browse files Browse the repository at this point in the history
…ed lookup
  • Loading branch information
mwear committed Feb 6, 2023
1 parent 315b9f7 commit 3da0fb0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions specification/resource/semantic_conventions/host.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ sources listed below to obtain the machine id.

| OS | Primary | Fallback |
|---------|-------------------------------------------------------------------------------------|----------------------------------------|
| Linux | contents of `/var/lib/dbus/machine-id` | contents of `/etc/machine-id` |
| Linux | contents of `/etc/machine-id` | contents of `/var/lib/dbus/machine-id` |
| BSD | contents of `/etc/hostid` | output of `kenv -q smbios.system.uuid` |
| MacOS | `IOPlatformUUID` line from the output of `ioreg -rd1 -c "IOPlatformExpertDevice"` | - |
| Windows | `MachineGuid` from registry `HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography` | - |

### Privileged Machine ID Lookup

The `host.id` can be looked up using privileged sources such as the output of
`dmidecode -t system`, `dmidecode -t baseboard`, `dmidecode -t chassis`, or
reading the corresponding data from the filesystem (e.g.
`cat /sys/devices/virtual/dmi/id/product_id`,
`cat /sys/devices/virtual/dmi/id/product_uuid`, etc), however SDK resource
The `host.id` can be looked up using privileged sources. For example, Linux
systems can use the output of `dmidecode -t system`, `dmidecode -t baseboard`,
`dmidecode -t chassis`, or read the corresponding data from the filesystem
(e.g. `cat /sys/devices/virtual/dmi/id/product_id`,
`cat /sys/devices/virtual/dmi/id/product_uuid`, etc), however, SDK resource
detector implementations MUST not collect `host.id` from privileged sources. If
privileged lookup of `host.id` is required, the value should be injected via the
`OTEL_RESOURCE_ATTRIBUTES` environment variable.

0 comments on commit 3da0fb0

Please sign in to comment.