{"version":3,"file":"HostDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/HostDetector.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,8CAAgF;AAChF,2BAAoC;AAOpC,4DAAyD;AACzD,mCAAwC;AAExC;;;GAGG;AACH,MAAM,YAAY;IAChB,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAA+B;YAC7C,CAAC,wBAAc,CAAC,EAAE,IAAA,aAAQ,GAAE;YAC5B,CAAC,wBAAc,CAAC,EAAE,IAAA,qBAAa,EAAC,IAAA,SAAI,GAAE,CAAC;YACvC,CAAC,sBAAY,CAAC,EAAE,IAAA,2BAAY,GAAE;SAC/B,CAAC;QAEF,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAEY,QAAA,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ATTR_HOST_ARCH, ATTR_HOST_ID, ATTR_HOST_NAME } from '../../../semconv';\nimport { arch, hostname } from 'os';\nimport type { ResourceDetectionConfig } from '../../../config';\nimport type {\n  DetectedResource,\n  DetectedResourceAttributes,\n  ResourceDetector,\n} from '../../../types';\nimport { getMachineId } from './machine-id/getMachineId';\nimport { normalizeArch } from './utils';\n\n/**\n * HostDetector detects the resources related to the host current process is\n * running on. Currently only non-cloud-based attributes are included.\n */\nclass HostDetector implements ResourceDetector {\n  detect(_config?: ResourceDetectionConfig): DetectedResource {\n    const attributes: DetectedResourceAttributes = {\n      [ATTR_HOST_NAME]: hostname(),\n      [ATTR_HOST_ARCH]: normalizeArch(arch()),\n      [ATTR_HOST_ID]: getMachineId(),\n    };\n\n    return { attributes };\n  }\n}\n\nexport const hostDetector = new HostDetector();\n"]}