{"version":3,"file":"getMachineId-bsd.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-bsd.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,UAAgB,YAAY;;;;;;;oBAEf,qBAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAA;;oBAA/D,MAAM,GAAG,SAAsD;oBACrE,sBAAO,MAAM,CAAC,IAAI,EAAE,EAAC;;;oBAErB,IAAI,CAAC,KAAK,CAAC,+BAA6B,GAAG,CAAC,CAAC;;;;oBAI9B,qBAAM,SAAS,CAAC,4BAA4B,CAAC,EAAA;;oBAAtD,MAAM,GAAG,SAA6C;oBAC5D,sBAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAC;;;oBAE5B,IAAI,CAAC,KAAK,CAAC,+BAA6B,GAAG,CAAC,CAAC;;wBAG/C,sBAAO,EAAE,EAAC;;;;CACX","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { promises as fs } from 'fs';\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise {\n try {\n const result = await fs.readFile('/etc/hostid', { encoding: 'utf8' });\n return result.trim();\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n try {\n const result = await execAsync('kenv -q smbios.system.uuid');\n return result.stdout.trim();\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return '';\n}\n"]}