Class HostIdResource

java.lang.Object
io.opentelemetry.instrumentation.resources.HostIdResource

public final class HostIdResource extends Object
ResourceProvider for automatically configuring host.id according to the semantic conventions.

The lookup is non-privileged and OS specific:

  • Linux: /etc/machine-id, falling back to /var/lib/dbus/machine-id
  • BSD: /etc/hostid, falling back to /bin/kenv -q smbios.system.uuid
  • macOS: the IOPlatformUUID from /usr/sbin/ioreg -rd1 -c IOPlatformExpertDevice
  • Windows: the MachineGuid registry value
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Deprecated.
    This constant is no longer used and will be removed in a future release.
  • Method Summary

    Modifier and Type
    Method
    Description
    static io.opentelemetry.sdk.resources.Resource
    get()
    Returns a Resource containing the host.id resource attribute.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • REGISTRY_QUERY

      @Deprecated public static final String REGISTRY_QUERY
      Deprecated.
      This constant is no longer used and will be removed in a future release. The Windows registry is now queried using an absolute path to reg.exe.
      See Also:
  • Method Details

    • get

      public static io.opentelemetry.sdk.resources.Resource get()
      Returns a Resource containing the host.id resource attribute.