Skip to content

Commit 67b30de

Browse files
wathiedecijothomas
andauthored
Trim host-id whitespace on Linux (#141)
Co-authored-by: Cijo Thomas <[email protected]>
1 parent 30a3f4e commit 67b30de

File tree

1 file changed

+1
-0
lines changed
  • opentelemetry-resource-detectors/src

1 file changed

+1
-0
lines changed

opentelemetry-resource-detectors/src/host.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ fn host_id_detect() -> Option<String> {
5252
let dbus_machine_id_path = Path::new("/var/lib/dbus/machine-id");
5353
read_to_string(machine_id_path)
5454
.or_else(|_| read_to_string(dbus_machine_id_path))
55+
.map(|id| id.trim().to_string())
5556
.ok()
5657
}
5758

0 commit comments

Comments
 (0)