diff --git a/opentelemetry-resource-detectors/src/host.rs b/opentelemetry-resource-detectors/src/host.rs index 64aeff36..febed0d0 100644 --- a/opentelemetry-resource-detectors/src/host.rs +++ b/opentelemetry-resource-detectors/src/host.rs @@ -52,6 +52,7 @@ fn host_id_detect() -> Option { let dbus_machine_id_path = Path::new("/var/lib/dbus/machine-id"); read_to_string(machine_id_path) .or_else(|_| read_to_string(dbus_machine_id_path)) + .map(|id| id.trim().to_string()) .ok() }