{"version":3,"file":"HostDetector.mjs","names":[],"sources":["../../../../src/detectors/platform/node/HostDetector.ts"],"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"],"mappings":";;;;;;;;;AAoBA,IAAM,eAAN,MAA+C;CAC7C,OAAO,SAAqD;EAO1D,OAAO,EAAE,YAAA;IALN,iBAAiB,SAAS;IAC1B,iBAAiB,cAAc,KAAK,CAAC;IACrC,eAAe,aAAa;EAGb,EAAE;CACtB;AACF;AAEA,MAAa,eAAe,IAAI,aAAa"}