@opentelemetry/resources
Advanced tools
+1
-12
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| export {}; | ||
| //# sourceMappingURL=config.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","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 type { ResourceDetector } from './types';\n\n/**\n * ResourceDetectionConfig provides an interface for configuring resource auto-detection.\n */\nexport interface ResourceDetectionConfig {\n detectors?: Array<ResourceDetector>;\n}\n"]} | ||
| {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ResourceDetector } from './types';\n\n/**\n * ResourceDetectionConfig provides an interface for configuring resource auto-detection.\n */\nexport interface ResourceDetectionConfig {\n detectors?: Array<ResourceDetector>;\n}\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ let serviceName; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"default-service-name.js","sourceRoot":"","sources":["../../src/default-service-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,IAAI,WAA+B,CAAC;AAEpC;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,WAAW,KAAK,SAAS,EAAE;QAC7B,IAAI;YACF,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC;YACvC,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,mBAAmB,KAAK,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC;SACtE;QAAC,MAAM;YACN,WAAW,GAAG,iBAAiB,CAAC;SACjC;KACF;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,6BAA6B;IAC3C,WAAW,GAAG,SAAS,CAAC;AAC1B,CAAC","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\nlet serviceName: string | undefined;\n\n/**\n * Returns the default service name for OpenTelemetry resources.\n * In Node.js environments, returns \"unknown_service:<process.argv0>\".\n * In browser/edge environments, returns \"unknown_service\".\n */\nexport function defaultServiceName(): string {\n if (serviceName === undefined) {\n try {\n const argv0 = globalThis.process.argv0;\n serviceName = argv0 ? `unknown_service:${argv0}` : 'unknown_service';\n } catch {\n serviceName = 'unknown_service';\n }\n }\n return serviceName;\n}\n\n/** @internal For testing purposes only */\nexport function _clearDefaultServiceNameCache(): void {\n serviceName = undefined;\n}\n"]} | ||
| {"version":3,"file":"default-service-name.js","sourceRoot":"","sources":["../../src/default-service-name.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,IAAI,WAA+B,CAAC;AAEpC;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,WAAW,KAAK,SAAS,EAAE;QAC7B,IAAI;YACF,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC;YACvC,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,mBAAmB,KAAK,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC;SACtE;QAAC,MAAM;YACN,WAAW,GAAG,iBAAiB,CAAC;SACjC;KACF;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,6BAA6B;IAC3C,WAAW,GAAG,SAAS,CAAC;AAC1B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nlet serviceName: string | undefined;\n\n/**\n * Returns the default service name for OpenTelemetry resources.\n * In Node.js environments, returns \"unknown_service:<process.argv0>\".\n * In browser/edge environments, returns \"unknown_service\".\n */\nexport function defaultServiceName(): string {\n if (serviceName === undefined) {\n try {\n const argv0 = globalThis.process.argv0;\n serviceName = argv0 ? `unknown_service:${argv0}` : 'unknown_service';\n } catch {\n serviceName = 'unknown_service';\n }\n }\n return serviceName;\n}\n\n/** @internal For testing purposes only */\nexport function _clearDefaultServiceNameCache(): void {\n serviceName = undefined;\n}\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { diag } from '@opentelemetry/api'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"detect-resources.js","sourceRoot":"","sources":["../../src/detect-resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAG7E;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,SAAkC,EAAE,EAC1B,EAAE;IACZ,MAAM,SAAS,GAAe,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;QAC7D,IAAI;YACF,MAAM,QAAQ,GAAG,4BAA4B,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;YAChE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,kBAAkB,EAAE,QAAQ,CAAC,CAAC;YAC9D,OAAO,QAAQ,CAAC;SACjB;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YACzD,OAAO,aAAa,EAAE,CAAC;SACxB;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC,MAAM,CACrB,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,EACtC,aAAa,EAAE,CAChB,CAAC;AACJ,CAAC,CAAC","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 { diag } from '@opentelemetry/api';\nimport { Resource } from './Resource';\nimport { emptyResource, resourceFromDetectedResource } from './ResourceImpl';\nimport { ResourceDetectionConfig } from './config';\n\n/**\n * Runs all resource detectors and returns the results merged into a single Resource.\n *\n * @param config Configuration for resource detection\n */\nexport const detectResources = (\n config: ResourceDetectionConfig = {}\n): Resource => {\n const resources: Resource[] = (config.detectors || []).map(d => {\n try {\n const resource = resourceFromDetectedResource(d.detect(config));\n diag.debug(`${d.constructor.name} found resource.`, resource);\n return resource;\n } catch (e) {\n diag.debug(`${d.constructor.name} failed: ${e.message}`);\n return emptyResource();\n }\n });\n\n return resources.reduce(\n (acc, resource) => acc.merge(resource),\n emptyResource()\n );\n};\n"]} | ||
| {"version":3,"file":"detect-resources.js","sourceRoot":"","sources":["../../src/detect-resources.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAG7E;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,SAAkC,EAAE,EAC1B,EAAE;IACZ,MAAM,SAAS,GAAe,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;QAC7D,IAAI;YACF,MAAM,QAAQ,GAAG,4BAA4B,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;YAChE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,kBAAkB,EAAE,QAAQ,CAAC,CAAC;YAC9D,OAAO,QAAQ,CAAC;SACjB;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YACzD,OAAO,aAAa,EAAE,CAAC;SACxB;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC,MAAM,CACrB,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,EACtC,aAAa,EAAE,CAChB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { diag } from '@opentelemetry/api';\nimport { Resource } from './Resource';\nimport { emptyResource, resourceFromDetectedResource } from './ResourceImpl';\nimport { ResourceDetectionConfig } from './config';\n\n/**\n * Runs all resource detectors and returns the results merged into a single Resource.\n *\n * @param config Configuration for resource detection\n */\nexport const detectResources = (\n config: ResourceDetectionConfig = {}\n): Resource => {\n const resources: Resource[] = (config.detectors || []).map(d => {\n try {\n const resource = resourceFromDetectedResource(d.detect(config));\n diag.debug(`${d.constructor.name} found resource.`, resource);\n return resource;\n } catch (e) {\n diag.debug(`${d.constructor.name} failed: ${e.message}`);\n return emptyResource();\n }\n });\n\n return resources.reduce(\n (acc, resource) => acc.merge(resource),\n emptyResource()\n );\n};\n"]} |
@@ -11,4 +11,2 @@ import { ResourceDetectionConfig } from '../config'; | ||
| private readonly _LABEL_KEY_VALUE_SPLITTER; | ||
| private readonly _ERROR_MESSAGE_INVALID_CHARS; | ||
| private readonly _ERROR_MESSAGE_INVALID_VALUE; | ||
| /** | ||
@@ -26,30 +24,15 @@ * Returns a {@link Resource} populated with attributes from the | ||
| * | ||
| * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes describing | ||
| * the source in more detail, e.g. “key1=val1,key2=val2”. Domain names and | ||
| * paths are accepted as attribute keys. Values may be quoted or unquoted in | ||
| * general. If a value contains whitespace, =, or " characters, it must | ||
| * always be quoted. | ||
| * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes in the | ||
| * format "key1=value1,key2=value2". The ',' and '=' characters in keys | ||
| * and values MUST be percent-encoded. Other characters MAY be percent-encoded. | ||
| * | ||
| * Per the spec, on any error (e.g., decoding failure), the entire environment | ||
| * variable value is discarded. | ||
| * | ||
| * @param rawEnvAttributes The resource attributes as a comma-separated list | ||
| * of key/value pairs. | ||
| * @returns The sanitized resource attributes. | ||
| * @returns The parsed resource attributes. | ||
| * @throws Error if parsing fails (caller handles by discarding all attributes) | ||
| */ | ||
| private _parseResourceAttributes; | ||
| /** | ||
| * Determines whether the given String is a valid printable ASCII string with | ||
| * a length not exceed _MAX_LENGTH characters. | ||
| * | ||
| * @param str The String to be validated. | ||
| * @returns Whether the String is valid. | ||
| */ | ||
| private _isValid; | ||
| private _isBaggageOctetString; | ||
| /** | ||
| * Determines whether the given String is a valid printable ASCII string with | ||
| * a length greater than 0 and not exceed _MAX_LENGTH characters. | ||
| * | ||
| * @param str The String to be validated. | ||
| * @returns Whether the String is valid and not empty. | ||
| */ | ||
| private _isValidAndNotEmpty; | ||
| } | ||
@@ -56,0 +39,0 @@ export declare const envDetector: EnvDetector; |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -30,8 +19,2 @@ import { diag } from '@opentelemetry/api'; | ||
| _LABEL_KEY_VALUE_SPLITTER = '='; | ||
| _ERROR_MESSAGE_INVALID_CHARS = 'should be a ASCII string with a length greater than 0 and not exceed ' + | ||
| this._MAX_LENGTH + | ||
| ' characters.'; | ||
| _ERROR_MESSAGE_INVALID_VALUE = 'should be a ASCII string with a length not exceed ' + | ||
| this._MAX_LENGTH + | ||
| ' characters.'; | ||
| /** | ||
@@ -54,3 +37,3 @@ * Returns a {@link Resource} populated with attributes from the | ||
| catch (e) { | ||
| diag.debug(`EnvDetector failed: ${e.message}`); | ||
| diag.debug(`EnvDetector failed: ${e instanceof Error ? e.message : e}`); | ||
| } | ||
@@ -67,11 +50,13 @@ } | ||
| * | ||
| * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes describing | ||
| * the source in more detail, e.g. “key1=val1,key2=val2”. Domain names and | ||
| * paths are accepted as attribute keys. Values may be quoted or unquoted in | ||
| * general. If a value contains whitespace, =, or " characters, it must | ||
| * always be quoted. | ||
| * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes in the | ||
| * format "key1=value1,key2=value2". The ',' and '=' characters in keys | ||
| * and values MUST be percent-encoded. Other characters MAY be percent-encoded. | ||
| * | ||
| * Per the spec, on any error (e.g., decoding failure), the entire environment | ||
| * variable value is discarded. | ||
| * | ||
| * @param rawEnvAttributes The resource attributes as a comma-separated list | ||
| * of key/value pairs. | ||
| * @returns The sanitized resource attributes. | ||
| * @returns The parsed resource attributes. | ||
| * @throws Error if parsing fails (caller handles by discarding all attributes) | ||
| */ | ||
@@ -82,54 +67,38 @@ _parseResourceAttributes(rawEnvAttributes) { | ||
| const attributes = {}; | ||
| const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR, -1); | ||
| const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR); | ||
| for (const rawAttribute of rawAttributes) { | ||
| const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER, -1); | ||
| const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER); | ||
| // Per spec: ',' and '=' MUST be percent-encoded in keys and values. | ||
| // If we get != 2 parts, there's an unencoded '=' which is an error. | ||
| if (keyValuePair.length !== 2) { | ||
| continue; | ||
| throw new Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${rawAttribute}". ` + | ||
| `Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`); | ||
| } | ||
| let [key, value] = keyValuePair; | ||
| // Leading and trailing whitespaces are trimmed. | ||
| key = key.trim(); | ||
| value = value.trim().split(/^"|"$/).join(''); | ||
| if (!this._isValidAndNotEmpty(key)) { | ||
| throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`); | ||
| const [rawKey, rawValue] = keyValuePair; | ||
| const key = rawKey.trim(); | ||
| const value = rawValue.trim(); | ||
| if (key.length === 0) { | ||
| throw new Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${rawAttribute}".`); | ||
| } | ||
| if (!this._isValid(value)) { | ||
| throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`); | ||
| let decodedKey; | ||
| let decodedValue; | ||
| try { | ||
| decodedKey = decodeURIComponent(key); | ||
| decodedValue = decodeURIComponent(value); | ||
| } | ||
| attributes[key] = decodeURIComponent(value); | ||
| catch (e) { | ||
| throw new Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${rawAttribute}": ${e instanceof Error ? e.message : e}`); | ||
| } | ||
| if (decodedKey.length > this._MAX_LENGTH) { | ||
| throw new Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${decodedKey}".`); | ||
| } | ||
| if (decodedValue.length > this._MAX_LENGTH) { | ||
| throw new Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${decodedKey}".`); | ||
| } | ||
| attributes[decodedKey] = decodedValue; | ||
| } | ||
| return attributes; | ||
| } | ||
| /** | ||
| * Determines whether the given String is a valid printable ASCII string with | ||
| * a length not exceed _MAX_LENGTH characters. | ||
| * | ||
| * @param str The String to be validated. | ||
| * @returns Whether the String is valid. | ||
| */ | ||
| _isValid(name) { | ||
| return name.length <= this._MAX_LENGTH && this._isBaggageOctetString(name); | ||
| } | ||
| // https://www.w3.org/TR/baggage/#definition | ||
| _isBaggageOctetString(str) { | ||
| for (let i = 0; i < str.length; i++) { | ||
| const ch = str.charCodeAt(i); | ||
| if (ch < 0x21 || ch === 0x2c || ch === 0x3b || ch === 0x5c || ch > 0x7e) { | ||
| return false; | ||
| } | ||
| } | ||
| return true; | ||
| } | ||
| /** | ||
| * Determines whether the given String is a valid printable ASCII string with | ||
| * a length greater than 0 and not exceed _MAX_LENGTH characters. | ||
| * | ||
| * @param str The String to be validated. | ||
| * @returns Whether the String is valid and not empty. | ||
| */ | ||
| _isValidAndNotEmpty(str) { | ||
| return str.length > 0 && this._isValid(str); | ||
| } | ||
| } | ||
| export const envDetector = new EnvDetector(); | ||
| //# sourceMappingURL=EnvDetector.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"EnvDetector.js","sourceRoot":"","sources":["../../../src/detectors/EnvDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAc,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;A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AE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,GAAG,IAAI,EAAE;gBACvE,OAAO,KAAK,CAAC;aACd;SACF;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACK,mBAAmB,CAAC,GAAW;QACrC,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC9C,CAAC;CACF;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC","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 { Attributes, diag } from '@opentelemetry/api';\nimport { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';\nimport { ResourceDetectionConfig } from '../config';\nimport { DetectedResource, ResourceDetector } from '../types';\nimport { getStringFromEnv } from '@opentelemetry/core';\n\n/**\n * EnvDetector can be used to detect the presence of and create a Resource\n * from the OTEL_RESOURCE_ATTRIBUTES environment variable.\n */\nclass EnvDetector implements ResourceDetector {\n // Type, attribute keys, and attribute values should not exceed 256 characters.\n private readonly _MAX_LENGTH = 255;\n\n // OTEL_RESOURCE_ATTRIBUTES is a comma-separated list of attributes.\n private readonly _COMMA_SEPARATOR = ',';\n\n // OTEL_RESOURCE_ATTRIBUTES contains key value pair separated by '='.\n private readonly _LABEL_KEY_VALUE_SPLITTER = '=';\n\n private readonly _ERROR_MESSAGE_INVALID_CHARS =\n 'should be a ASCII string with a length greater than 0 and not exceed ' +\n this._MAX_LENGTH +\n ' characters.';\n\n private readonly _ERROR_MESSAGE_INVALID_VALUE =\n 'should be a ASCII string with a length not exceed ' +\n this._MAX_LENGTH +\n ' characters.';\n\n /**\n * Returns a {@link Resource} populated with attributes from the\n * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async\n * function to conform to the Detector interface.\n *\n * @param config The resource detection config\n */\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n const attributes: Attributes = {};\n\n const rawAttributes = getStringFromEnv('OTEL_RESOURCE_ATTRIBUTES');\n const serviceName = getStringFromEnv('OTEL_SERVICE_NAME');\n\n if (rawAttributes) {\n try {\n const parsedAttributes = this._parseResourceAttributes(rawAttributes);\n Object.assign(attributes, parsedAttributes);\n } catch (e) {\n diag.debug(`EnvDetector failed: ${e.message}`);\n }\n }\n\n if (serviceName) {\n attributes[ATTR_SERVICE_NAME] = serviceName;\n }\n\n return { attributes };\n }\n\n /**\n * Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment\n * variable.\n *\n * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes describing\n * the source in more detail, e.g. “key1=val1,key2=val2”. Domain names and\n * paths are accepted as attribute keys. Values may be quoted or unquoted in\n * general. If a value contains whitespace, =, or \" characters, it must\n * always be quoted.\n *\n * @param rawEnvAttributes The resource attributes as a comma-separated list\n * of key/value pairs.\n * @returns The sanitized resource attributes.\n */\n private _parseResourceAttributes(rawEnvAttributes?: string): Attributes {\n if (!rawEnvAttributes) return {};\n\n const attributes: Attributes = {};\n const rawAttributes: string[] = rawEnvAttributes.split(\n this._COMMA_SEPARATOR,\n -1\n );\n for (const rawAttribute of rawAttributes) {\n const keyValuePair: string[] = rawAttribute.split(\n this._LABEL_KEY_VALUE_SPLITTER,\n -1\n );\n if (keyValuePair.length !== 2) {\n continue;\n }\n let [key, value] = keyValuePair;\n // Leading and trailing whitespaces are trimmed.\n key = key.trim();\n value = value.trim().split(/^\"|\"$/).join('');\n if (!this._isValidAndNotEmpty(key)) {\n throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);\n }\n if (!this._isValid(value)) {\n throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);\n }\n attributes[key] = decodeURIComponent(value);\n }\n return attributes;\n }\n\n /**\n * Determines whether the given String is a valid printable ASCII string with\n * a length not exceed _MAX_LENGTH characters.\n *\n * @param str The String to be validated.\n * @returns Whether the String is valid.\n */\n private _isValid(name: string): boolean {\n return name.length <= this._MAX_LENGTH && this._isBaggageOctetString(name);\n }\n\n // https://www.w3.org/TR/baggage/#definition\n private _isBaggageOctetString(str: string): boolean {\n for (let i = 0; i < str.length; i++) {\n const ch = str.charCodeAt(i);\n if (ch < 0x21 || ch === 0x2c || ch === 0x3b || ch === 0x5c || ch > 0x7e) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Determines whether the given String is a valid printable ASCII string with\n * a length greater than 0 and not exceed _MAX_LENGTH characters.\n *\n * @param str The String to be validated.\n * @returns Whether the String is valid and not empty.\n */\n private _isValidAndNotEmpty(str: string): boolean {\n return str.length > 0 && this._isValid(str);\n }\n}\n\nexport const envDetector = new EnvDetector();\n"]} | ||
| {"version":3,"file":"EnvDetector.js","sourceRoot":"","sources":["../../../src/detectors/EnvDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAc,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAGxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW;IACf,+EAA+E;IAC9D,WAAW,GAAG,GAAG,CAAC;IAEnC,oEAAoE;IACnD,gBAAgB,GAAG,GAAG,CAAC;IAExC,qEAAqE;IACpD,yBAAyB,GAAG,GAAG,CAAC;IAEjD;;;;;;OAMG;IACH,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAe,EAAE,CAAC;QAElC,MA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AAG,QAAQ,CAAC,IAAI,EAAE,CAAC;YAE9B,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;gBACpB,MAAM,IAAI,KAAK,CACb,6DAA6D,YAAY,IAAI,CAC9E,CAAC;aACH;YAED,IAAI,UAAkB,CAAC;YACvB,IAAI,YAAoB,CAAC;YACzB,IAAI;gBACF,UAAU,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;gBACrC,YAAY,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;aAC1C;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,IAAI,KAAK,CACb,4DAA4D,YAAY,MAAM,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CACnH,CAAC;aACH;YAED,IAAI,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE;gBACxC,MAAM,IAAI,KAAK,CACb,+CAA+C,IAAI,CAAC,WAAW,iBAAiB,UAAU,IAAI,CAC/F,CAAC;aACH;YAED,IAAI,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE;gBAC1C,MAAM,IAAI,KAAK,CACb,iDAAiD,IAAI,CAAC,WAAW,wBAAwB,UAAU,IAAI,CACxG,CAAC;aACH;YAED,UAAU,CAAC,UAAU,CAAC,GAAG,YAAY,CAAC;SACvC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Attributes, diag } from '@opentelemetry/api';\nimport { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';\nimport { ResourceDetectionConfig } from '../config';\nimport { DetectedResource, ResourceDetector } from '../types';\nimport { getStringFromEnv } from '@opentelemetry/core';\n\n/**\n * EnvDetector can be used to detect the presence of and create a Resource\n * from the OTEL_RESOURCE_ATTRIBUTES environment variable.\n */\nclass EnvDetector implements ResourceDetector {\n // Type, attribute keys, and attribute values should not exceed 256 characters.\n private readonly _MAX_LENGTH = 255;\n\n // OTEL_RESOURCE_ATTRIBUTES is a comma-separated list of attributes.\n private readonly _COMMA_SEPARATOR = ',';\n\n // OTEL_RESOURCE_ATTRIBUTES contains key value pair separated by '='.\n private readonly _LABEL_KEY_VALUE_SPLITTER = '=';\n\n /**\n * Returns a {@link Resource} populated with attributes from the\n * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async\n * function to conform to the Detector interface.\n *\n * @param config The resource detection config\n */\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n const attributes: Attributes = {};\n\n const rawAttributes = getStringFromEnv('OTEL_RESOURCE_ATTRIBUTES');\n const serviceName = getStringFromEnv('OTEL_SERVICE_NAME');\n\n if (rawAttributes) {\n try {\n const parsedAttributes = this._parseResourceAttributes(rawAttributes);\n Object.assign(attributes, parsedAttributes);\n } catch (e) {\n diag.debug(`EnvDetector failed: ${e instanceof Error ? e.message : e}`);\n }\n }\n\n if (serviceName) {\n attributes[ATTR_SERVICE_NAME] = serviceName;\n }\n\n return { attributes };\n }\n\n /**\n * Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment\n * variable.\n *\n * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes in the\n * format \"key1=value1,key2=value2\". The ',' and '=' characters in keys\n * and values MUST be percent-encoded. Other characters MAY be percent-encoded.\n *\n * Per the spec, on any error (e.g., decoding failure), the entire environment\n * variable value is discarded.\n *\n * @param rawEnvAttributes The resource attributes as a comma-separated list\n * of key/value pairs.\n * @returns The parsed resource attributes.\n * @throws Error if parsing fails (caller handles by discarding all attributes)\n */\n private _parseResourceAttributes(rawEnvAttributes?: string): Attributes {\n if (!rawEnvAttributes) return {};\n\n const attributes: Attributes = {};\n const rawAttributes: string[] = rawEnvAttributes.split(\n this._COMMA_SEPARATOR\n );\n\n for (const rawAttribute of rawAttributes) {\n const keyValuePair: string[] = rawAttribute.split(\n this._LABEL_KEY_VALUE_SPLITTER\n );\n\n // Per spec: ',' and '=' MUST be percent-encoded in keys and values.\n // If we get != 2 parts, there's an unencoded '=' which is an error.\n if (keyValuePair.length !== 2) {\n throw new Error(\n `Invalid format for OTEL_RESOURCE_ATTRIBUTES: \"${rawAttribute}\". ` +\n `Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`\n );\n }\n\n const [rawKey, rawValue] = keyValuePair;\n const key = rawKey.trim();\n const value = rawValue.trim();\n\n if (key.length === 0) {\n throw new Error(\n `Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in \"${rawAttribute}\".`\n );\n }\n\n let decodedKey: string;\n let decodedValue: string;\n try {\n decodedKey = decodeURIComponent(key);\n decodedValue = decodeURIComponent(value);\n } catch (e) {\n throw new Error(\n `Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry \"${rawAttribute}\": ${e instanceof Error ? e.message : e}`\n );\n }\n\n if (decodedKey.length > this._MAX_LENGTH) {\n throw new Error(\n `Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: \"${decodedKey}\".`\n );\n }\n\n if (decodedValue.length > this._MAX_LENGTH) {\n throw new Error(\n `Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key \"${decodedKey}\".`\n );\n }\n\n attributes[decodedKey] = decodedValue;\n }\n\n return attributes;\n }\n}\n\nexport const envDetector = new EnvDetector();\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ export { envDetector } from './EnvDetector'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/detectors/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,YAAY,EACZ,UAAU,EACV,eAAe,EACf,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC","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\nexport { envDetector } from './EnvDetector';\nexport {\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './platform';\nexport { noopDetector } from './NoopDetector';\n"]} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/detectors/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,YAAY,EACZ,UAAU,EACV,eAAe,EACf,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { envDetector } from './EnvDetector';\nexport {\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './platform';\nexport { noopDetector } from './NoopDetector';\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ export class NoopDetector { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"NoopDetector.js","sourceRoot":"","sources":["../../../src/detectors/NoopDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,OAAO,YAAY;IACvB,MAAM;QACJ,OAAO;YACL,UAAU,EAAE,EAAE;SACf,CAAC;IACJ,CAAC;CACF;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC","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 { DetectedResource, ResourceDetector } from '../types';\n\nexport class NoopDetector implements ResourceDetector {\n detect(): DetectedResource {\n return {\n attributes: {},\n };\n }\n}\n\nexport const noopDetector = new NoopDetector();\n"]} | ||
| {"version":3,"file":"NoopDetector.js","sourceRoot":"","sources":["../../../src/detectors/NoopDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,OAAO,YAAY;IACvB,MAAM;QACJ,OAAO;YACL,UAAU,EAAE,EAAE;SACf,CAAC;IACJ,CAAC;CACF;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DetectedResource, ResourceDetector } from '../types';\n\nexport class NoopDetector implements ResourceDetector {\n detect(): DetectedResource {\n return {\n attributes: {},\n };\n }\n}\n\nexport const noopDetector = new NoopDetector();\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { noopDetector } from '../../NoopDetector'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"HostDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/HostDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CAAC","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 { noopDetector } from '../../NoopDetector';\n\nexport const hostDetector = noopDetector;\n"]} | ||
| {"version":3,"file":"HostDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/HostDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { noopDetector } from '../../NoopDetector';\n\nexport const hostDetector = noopDetector;\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ export { hostDetector } from './HostDetector'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC","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\nexport { hostDetector } from './HostDetector';\nexport { osDetector } from './OSDetector';\nexport { processDetector } from './ProcessDetector';\nexport { serviceInstanceIdDetector } from './ServiceInstanceIdDetector';\n"]} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { hostDetector } from './HostDetector';\nexport { osDetector } from './OSDetector';\nexport { processDetector } from './ProcessDetector';\nexport { serviceInstanceIdDetector } from './ServiceInstanceIdDetector';\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { noopDetector } from '../../NoopDetector'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"OSDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/OSDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC","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 { noopDetector } from '../../NoopDetector';\n\nexport const osDetector = noopDetector;\n"]} | ||
| {"version":3,"file":"OSDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/OSDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { noopDetector } from '../../NoopDetector';\n\nexport const osDetector = noopDetector;\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { noopDetector } from '../../NoopDetector'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ProcessDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/ProcessDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC","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 { noopDetector } from '../../NoopDetector';\n\nexport const processDetector = noopDetector;\n"]} | ||
| {"version":3,"file":"ProcessDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/ProcessDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { noopDetector } from '../../NoopDetector';\n\nexport const processDetector = noopDetector;\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { noopDetector } from '../../NoopDetector'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ServiceInstanceIdDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/ServiceInstanceIdDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,YAAY,CAAC","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 { noopDetector } from '../../NoopDetector';\n\n/**\n * @experimental\n */\nexport const serviceInstanceIdDetector = noopDetector;\n"]} | ||
| {"version":3,"file":"ServiceInstanceIdDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/ServiceInstanceIdDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,YAAY,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { noopDetector } from '../../NoopDetector';\n\n/**\n * @experimental\n */\nexport const serviceInstanceIdDetector = noopDetector;\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| export { hostDetector, osDetector, processDetector, serviceInstanceIdDetector, } from './node'; | ||
| //# sourceMappingURL=index.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/detectors/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,YAAY,EACZ,UAAU,EACV,eAAe,EACf,yBAAyB,GAC1B,MAAM,QAAQ,CAAC","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 */\nexport {\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './node';\n"]} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/detectors/platform/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,YAAY,EACZ,UAAU,EACV,eAAe,EACf,yBAAyB,GAC1B,MAAM,QAAQ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport {\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './node';\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { ATTR_HOST_ARCH, ATTR_HOST_ID, ATTR_HOST_NAME } from '../../../semconv'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"HostDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/HostDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAOpC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC;;;GAGG;AACH,MAAM,YAAY;IAChB,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAA+B;YAC7C,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE;YAC5B,CAAC,cAAc,CAAC,EAAE,aAAa,CAAC,IAAI,EAAE,CAAC;YACvC,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE;SAC/B,CAAC;QAEF,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC","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 { ATTR_HOST_ARCH, ATTR_HOST_ID, ATTR_HOST_NAME } from '../../../semconv';\nimport { arch, hostname } from 'os';\nimport { ResourceDetectionConfig } from '../../../config';\nimport {\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"]} | ||
| {"version":3,"file":"HostDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/HostDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAOpC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC;;;GAGG;AACH,MAAM,YAAY;IAChB,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAA+B;YAC7C,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE;YAC5B,CAAC,cAAc,CAAC,EAAE,aAAa,CAAC,IAAI,EAAE,CAAC;YACvC,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE;SAC/B,CAAC;QAEF,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,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 { ResourceDetectionConfig } from '../../../config';\nimport {\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"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ export { hostDetector } from './HostDetector'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC","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\nexport { hostDetector } from './HostDetector';\nexport { osDetector } from './OSDetector';\nexport { processDetector } from './ProcessDetector';\nexport { serviceInstanceIdDetector } from './ServiceInstanceIdDetector';\n"]} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { hostDetector } from './HostDetector';\nexport { osDetector } from './OSDetector';\nexport { processDetector } from './ProcessDetector';\nexport { serviceInstanceIdDetector } from './ServiceInstanceIdDetector';\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import * as child_process from 'child_process'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"execAsync.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/execAsync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,aAAa,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC","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 * as child_process from 'child_process';\nimport * as util from 'util';\n\nexport const execAsync = util.promisify(child_process.exec);\n"]} | ||
| {"version":3,"file":"execAsync.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/execAsync.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,aAAa,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport * as child_process from 'child_process';\nimport * as util from 'util';\n\nexport const execAsync = util.promisify(child_process.exec);\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { promises as fs } from 'fs'; |
@@ -1,1 +0,1 @@ | ||
| {"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,CAAC,KAAK,UAAU,YAAY;IAChC,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QACtE,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;KACtB;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,4BAA4B,CAAC,CAAC;QAC7D,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;KAC7B;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","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<string | undefined> {\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 undefined;\n}\n"]} | ||
| {"version":3,"file":"getMachineId-bsd.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-bsd.ts"],"names":[],"mappings":"AAAA;;;GAGG;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,CAAC,KAAK,UAAU,YAAY;IAChC,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QACtE,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;KACtB;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,4BAA4B,CAAC,CAAC;QAC7D,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;KAC7B;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { promises as fs } from 'fs';\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\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 undefined;\n}\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { execAsync } from './execAsync'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"getMachineId-darwin.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-darwin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,wCAAwC,CAAC,CAAC;QAEzE,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM;aACzB,KAAK,CAAC,IAAI,CAAC;aACX,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAEjD,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,SAAS,CAAC;SAClB;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;SAC9B;KACF;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","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 { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n try {\n const result = await execAsync('ioreg -rd1 -c \"IOPlatformExpertDevice\"');\n\n const idLine = result.stdout\n .split('\\n')\n .find(line => line.includes('IOPlatformUUID'));\n\n if (!idLine) {\n return undefined;\n }\n\n const parts = idLine.split('\" = \"');\n if (parts.length === 2) {\n return parts[1].slice(0, -1);\n }\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return undefined;\n}\n"]} | ||
| {"version":3,"file":"getMachineId-darwin.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-darwin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,wCAAwC,CAAC,CAAC;QAEzE,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM;aACzB,KAAK,CAAC,IAAI,CAAC;aACX,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAEjD,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,SAAS,CAAC;SAClB;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;SAC9B;KACF;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n try {\n const result = await execAsync('ioreg -rd1 -c \"IOPlatformExpertDevice\"');\n\n const idLine = result.stdout\n .split('\\n')\n .find(line => line.includes('IOPlatformUUID'));\n\n if (!idLine) {\n return undefined;\n }\n\n const parts = idLine.split('\" = \"');\n if (parts.length === 2) {\n return parts[1].slice(0, -1);\n }\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return undefined;\n}\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { promises as fs } from 'fs'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"getMachineId-linux.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-linux.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,KAAK,GAAG,CAAC,iBAAiB,EAAE,0BAA0B,CAAC,CAAC;IAE9D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;YAC7D,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;SACtB;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;SAC9C;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","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 */\nimport { promises as fs } from 'fs';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n const paths = ['/etc/machine-id', '/var/lib/dbus/machine-id'];\n\n for (const path of paths) {\n try {\n const result = await fs.readFile(path, { encoding: 'utf8' });\n return result.trim();\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n }\n\n return undefined;\n}\n"]} | ||
| {"version":3,"file":"getMachineId-linux.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-linux.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,KAAK,GAAG,CAAC,iBAAiB,EAAE,0BAA0B,CAAC,CAAC;IAE9D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;YAC7D,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;SACtB;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;SAC9C;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { promises as fs } from 'fs';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n const paths = ['/etc/machine-id', '/var/lib/dbus/machine-id'];\n\n for (const path of paths) {\n try {\n const result = await fs.readFile(path, { encoding: 'utf8' });\n return result.trim();\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n }\n\n return undefined;\n}\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { diag } from '@opentelemetry/api'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"getMachineId-unsupported.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-unsupported.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,IAAI,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;IAC9D,OAAO,SAAS,CAAC;AACnB,CAAC","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 { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n diag.debug('could not read machine-id: unsupported platform');\n return undefined;\n}\n"]} | ||
| {"version":3,"file":"getMachineId-unsupported.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-unsupported.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,IAAI,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;IAC9D,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n diag.debug('could not read machine-id: unsupported platform');\n return undefined;\n}\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import * as process from 'process'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"getMachineId-win.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-win.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,IAAI,GACR,4EAA4E,CAAC;IAC/E,IAAI,OAAO,GAAG,6BAA6B,CAAC;IAC5C,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,IAAI,wBAAwB,IAAI,OAAO,CAAC,GAAG,EAAE;QACtE,OAAO,GAAG,kCAAkC,GAAG,OAAO,CAAC;KACxD;IAED,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,GAAG,OAAO,IAAI,IAAI,EAAE,CAAC,CAAC;QACrD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACxB;KACF;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","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 * as process from 'process';\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n const args =\n 'QUERY HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Cryptography /v MachineGuid';\n let command = '%windir%\\\\System32\\\\REG.exe';\n if (process.arch === 'ia32' && 'PROCESSOR_ARCHITEW6432' in process.env) {\n command = '%windir%\\\\sysnative\\\\cmd.exe /c ' + command;\n }\n\n try {\n const result = await execAsync(`${command} ${args}`);\n const parts = result.stdout.split('REG_SZ');\n if (parts.length === 2) {\n return parts[1].trim();\n }\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return undefined;\n}\n"]} | ||
| {"version":3,"file":"getMachineId-win.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-win.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,IAAI,GACR,4EAA4E,CAAC;IAC/E,IAAI,OAAO,GAAG,6BAA6B,CAAC;IAC5C,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,IAAI,wBAAwB,IAAI,OAAO,CAAC,GAAG,EAAE;QACtE,OAAO,GAAG,kCAAkC,GAAG,OAAO,CAAC;KACxD;IAED,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,GAAG,OAAO,IAAI,IAAI,EAAE,CAAC,CAAC;QACrD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACxB;KACF;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport * as process from 'process';\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n const args =\n 'QUERY HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Cryptography /v MachineGuid';\n let command = '%windir%\\\\System32\\\\REG.exe';\n if (process.arch === 'ia32' && 'PROCESSOR_ARCHITEW6432' in process.env) {\n command = '%windir%\\\\sysnative\\\\cmd.exe /c ' + command;\n }\n\n try {\n const result = await execAsync(`${command} ${args}`);\n const parts = result.stdout.split('REG_SZ');\n if (parts.length === 2) {\n return parts[1].trim();\n }\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return undefined;\n}\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import * as process from 'process'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"getMachineId.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,IAAI,gBAAiE,CAAC;AAEtE,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,IAAI,CAAC,gBAAgB,EAAE;QACrB,QAAQ,OAAO,CAAC,QAAQ,EAAE;YACxB,KAAK,QAAQ;gBACX,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC;qBAC1D,YAAY,CAAC;gBAChB,MAAM;YACR,KAAK,OAAO;gBACV,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;qBACzD,YAAY,CAAC;gBAChB,MAAM;YACR,KAAK,SAAS;gBACZ,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,YAAY,CAAC;gBACxE,MAAM;YACR,KAAK,OAAO;gBACV,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,YAAY,CAAC;gBACxE,MAAM;YACR;gBACE,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,+BAA+B,CAAC,CAAC;qBAC/D,YAAY,CAAC;gBAChB,MAAM;SACT;KACF;IAED,OAAO,gBAAgB,EAAE,CAAC;AAC5B,CAAC","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 */\nimport * as process from 'process';\n\nlet getMachineIdImpl: undefined | (() => Promise<string | undefined>);\n\nexport async function getMachineId(): Promise<string | undefined> {\n if (!getMachineIdImpl) {\n switch (process.platform) {\n case 'darwin':\n getMachineIdImpl = (await import('./getMachineId-darwin.js'))\n .getMachineId;\n break;\n case 'linux':\n getMachineIdImpl = (await import('./getMachineId-linux.js'))\n .getMachineId;\n break;\n case 'freebsd':\n getMachineIdImpl = (await import('./getMachineId-bsd.js')).getMachineId;\n break;\n case 'win32':\n getMachineIdImpl = (await import('./getMachineId-win.js')).getMachineId;\n break;\n default:\n getMachineIdImpl = (await import('./getMachineId-unsupported.js'))\n .getMachineId;\n break;\n }\n }\n\n return getMachineIdImpl();\n}\n"]} | ||
| {"version":3,"file":"getMachineId.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,IAAI,gBAAiE,CAAC;AAEtE,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,IAAI,CAAC,gBAAgB,EAAE;QACrB,QAAQ,OAAO,CAAC,QAAQ,EAAE;YACxB,KAAK,QAAQ;gBACX,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC;qBAC1D,YAAY,CAAC;gBAChB,MAAM;YACR,KAAK,OAAO;gBACV,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;qBACzD,YAAY,CAAC;gBAChB,MAAM;YACR,KAAK,SAAS;gBACZ,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,YAAY,CAAC;gBACxE,MAAM;YACR,KAAK,OAAO;gBACV,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,YAAY,CAAC;gBACxE,MAAM;YACR;gBACE,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,+BAA+B,CAAC,CAAC;qBAC/D,YAAY,CAAC;gBAChB,MAAM;SACT;KACF;IAED,OAAO,gBAAgB,EAAE,CAAC;AAC5B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport * as process from 'process';\n\nlet getMachineIdImpl: undefined | (() => Promise<string | undefined>);\n\nexport async function getMachineId(): Promise<string | undefined> {\n if (!getMachineIdImpl) {\n switch (process.platform) {\n case 'darwin':\n getMachineIdImpl = (await import('./getMachineId-darwin.js'))\n .getMachineId;\n break;\n case 'linux':\n getMachineIdImpl = (await import('./getMachineId-linux.js'))\n .getMachineId;\n break;\n case 'freebsd':\n getMachineIdImpl = (await import('./getMachineId-bsd.js')).getMachineId;\n break;\n case 'win32':\n getMachineIdImpl = (await import('./getMachineId-win.js')).getMachineId;\n break;\n default:\n getMachineIdImpl = (await import('./getMachineId-unsupported.js'))\n .getMachineId;\n break;\n }\n }\n\n return getMachineIdImpl();\n}\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { ATTR_OS_TYPE, ATTR_OS_VERSION } from '../../../semconv'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"OSDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/OSDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAGvC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC;;;GAGG;AACH,MAAM,UAAU;IACd,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAe;YAC7B,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC;YACzC,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE;SAC7B,CAAC;QACF,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC","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 { Attributes } from '@opentelemetry/api';\nimport { ATTR_OS_TYPE, ATTR_OS_VERSION } from '../../../semconv';\nimport { platform, release } from 'os';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { DetectedResource, ResourceDetector } from '../../../types';\nimport { normalizeType } from './utils';\n\n/**\n * OSDetector detects the resources related to the operating system (OS) on\n * which the process represented by this resource is running.\n */\nclass OSDetector implements ResourceDetector {\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n const attributes: Attributes = {\n [ATTR_OS_TYPE]: normalizeType(platform()),\n [ATTR_OS_VERSION]: release(),\n };\n return { attributes };\n }\n}\n\nexport const osDetector = new OSDetector();\n"]} | ||
| {"version":3,"file":"OSDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/OSDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAGvC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC;;;GAGG;AACH,MAAM,UAAU;IACd,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAe;YAC7B,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC;YACzC,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE;SAC7B,CAAC;QACF,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Attributes } from '@opentelemetry/api';\nimport { ATTR_OS_TYPE, ATTR_OS_VERSION } from '../../../semconv';\nimport { platform, release } from 'os';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { DetectedResource, ResourceDetector } from '../../../types';\nimport { normalizeType } from './utils';\n\n/**\n * OSDetector detects the resources related to the operating system (OS) on\n * which the process represented by this resource is running.\n */\nclass OSDetector implements ResourceDetector {\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n const attributes: Attributes = {\n [ATTR_OS_TYPE]: normalizeType(platform()),\n [ATTR_OS_VERSION]: release(),\n };\n return { attributes };\n }\n}\n\nexport const osDetector = new OSDetector();\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { diag } from '@opentelemetry/api'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ProcessDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/ProcessDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAc,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,4BAA4B,EAC5B,4BAA4B,EAC5B,kBAAkB,EAClB,gBAAgB,EAChB,gCAAgC,EAChC,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAIzB;;;GAGG;AACH,MAAM,eAAe;IACnB,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAe;YAC7B,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,GAAG;YAC/B,CAAC,4BAA4B,CAAC,EAAE,OAAO,CAAC,KAAK;YAC7C,CAAC,4BAA4B,CAAC,EAAE,OAAO,CAAC,QAAQ;YAChD,CAAC,yBAAyB,CAAC,EAAE;gBAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;gBACf,GAAG,OAAO,CAAC,QAAQ;gBACnB,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;aACzB;YACD,CAAC,4BAA4B,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;YACrD,CAAC,yBAAyB,CAAC,EAAE,QAAQ;YACrC,CAAC,gCAAgC,CAAC,EAAE,SAAS;SAC9C,CAAC;QAEF,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3B,UAAU,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACpD;QAED,IAAI;YACF,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;YAC/B,UAAU,CAAC,kBAAkB,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC;SACpD;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,KAAK,CAAC,kCAAkC,CAAC,EAAE,CAAC,CAAC;SACnD;QAED,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC","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 { Attributes, diag } from '@opentelemetry/api';\nimport {\n ATTR_PROCESS_COMMAND,\n ATTR_PROCESS_COMMAND_ARGS,\n ATTR_PROCESS_EXECUTABLE_NAME,\n ATTR_PROCESS_EXECUTABLE_PATH,\n ATTR_PROCESS_OWNER,\n ATTR_PROCESS_PID,\n ATTR_PROCESS_RUNTIME_DESCRIPTION,\n ATTR_PROCESS_RUNTIME_NAME,\n ATTR_PROCESS_RUNTIME_VERSION,\n} from '../../../semconv';\nimport * as os from 'os';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { DetectedResource, ResourceDetector } from '../../../types';\n\n/**\n * ProcessDetector will be used to detect the resources related current process running\n * and being instrumented from the NodeJS Process module.\n */\nclass ProcessDetector implements ResourceDetector {\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n const attributes: Attributes = {\n [ATTR_PROCESS_PID]: process.pid,\n [ATTR_PROCESS_EXECUTABLE_NAME]: process.title,\n [ATTR_PROCESS_EXECUTABLE_PATH]: process.execPath,\n [ATTR_PROCESS_COMMAND_ARGS]: [\n process.argv[0],\n ...process.execArgv,\n ...process.argv.slice(1),\n ],\n [ATTR_PROCESS_RUNTIME_VERSION]: process.versions.node,\n [ATTR_PROCESS_RUNTIME_NAME]: 'nodejs',\n [ATTR_PROCESS_RUNTIME_DESCRIPTION]: 'Node.js',\n };\n\n if (process.argv.length > 1) {\n attributes[ATTR_PROCESS_COMMAND] = process.argv[1];\n }\n\n try {\n const userInfo = os.userInfo();\n attributes[ATTR_PROCESS_OWNER] = userInfo.username;\n } catch (e) {\n diag.debug(`error obtaining process owner: ${e}`);\n }\n\n return { attributes };\n }\n}\n\nexport const processDetector = new ProcessDetector();\n"]} | ||
| {"version":3,"file":"ProcessDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/ProcessDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAc,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,4BAA4B,EAC5B,4BAA4B,EAC5B,kBAAkB,EAClB,gBAAgB,EAChB,gCAAgC,EAChC,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAIzB;;;GAGG;AACH,MAAM,eAAe;IACnB,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAe;YAC7B,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,GAAG;YAC/B,CAAC,4BAA4B,CAAC,EAAE,OAAO,CAAC,KAAK;YAC7C,CAAC,4BAA4B,CAAC,EAAE,OAAO,CAAC,QAAQ;YAChD,CAAC,yBAAyB,CAAC,EAAE;gBAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;gBACf,GAAG,OAAO,CAAC,QAAQ;gBACnB,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;aACzB;YACD,CAAC,4BAA4B,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;YACrD,CAAC,yBAAyB,CAAC,EAAE,QAAQ;YACrC,CAAC,gCAAgC,CAAC,EAAE,SAAS;SAC9C,CAAC;QAEF,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3B,UAAU,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACpD;QAED,IAAI;YACF,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;YAC/B,UAAU,CAAC,kBAAkB,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC;SACpD;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,KAAK,CAAC,kCAAkC,CAAC,EAAE,CAAC,CAAC;SACnD;QAED,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Attributes, diag } from '@opentelemetry/api';\nimport {\n ATTR_PROCESS_COMMAND,\n ATTR_PROCESS_COMMAND_ARGS,\n ATTR_PROCESS_EXECUTABLE_NAME,\n ATTR_PROCESS_EXECUTABLE_PATH,\n ATTR_PROCESS_OWNER,\n ATTR_PROCESS_PID,\n ATTR_PROCESS_RUNTIME_DESCRIPTION,\n ATTR_PROCESS_RUNTIME_NAME,\n ATTR_PROCESS_RUNTIME_VERSION,\n} from '../../../semconv';\nimport * as os from 'os';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { DetectedResource, ResourceDetector } from '../../../types';\n\n/**\n * ProcessDetector will be used to detect the resources related current process running\n * and being instrumented from the NodeJS Process module.\n */\nclass ProcessDetector implements ResourceDetector {\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n const attributes: Attributes = {\n [ATTR_PROCESS_PID]: process.pid,\n [ATTR_PROCESS_EXECUTABLE_NAME]: process.title,\n [ATTR_PROCESS_EXECUTABLE_PATH]: process.execPath,\n [ATTR_PROCESS_COMMAND_ARGS]: [\n process.argv[0],\n ...process.execArgv,\n ...process.argv.slice(1),\n ],\n [ATTR_PROCESS_RUNTIME_VERSION]: process.versions.node,\n [ATTR_PROCESS_RUNTIME_NAME]: 'nodejs',\n [ATTR_PROCESS_RUNTIME_DESCRIPTION]: 'Node.js',\n };\n\n if (process.argv.length > 1) {\n attributes[ATTR_PROCESS_COMMAND] = process.argv[1];\n }\n\n try {\n const userInfo = os.userInfo();\n attributes[ATTR_PROCESS_OWNER] = userInfo.username;\n } catch (e) {\n diag.debug(`error obtaining process owner: ${e}`);\n }\n\n return { attributes };\n }\n}\n\nexport const processDetector = new ProcessDetector();\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { ATTR_SERVICE_INSTANCE_ID } from '../../../semconv'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ServiceInstanceIdDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/ServiceInstanceIdDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAIpC;;GAEG;AACH,MAAM,yBAAyB;IAC7B,MAAM,CAAC,OAAiC;QACtC,OAAO;YACL,UAAU,EAAE;gBACV,CAAC,wBAAwB,CAAC,EAAE,UAAU,EAAE;aACzC;SACF,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,yBAAyB,EAAE,CAAC","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 { ATTR_SERVICE_INSTANCE_ID } from '../../../semconv';\nimport { randomUUID } from 'crypto';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { DetectedResource, ResourceDetector } from '../../../types';\n\n/**\n * ServiceInstanceIdDetector detects the resources related to the service instance ID.\n */\nclass ServiceInstanceIdDetector implements ResourceDetector {\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n return {\n attributes: {\n [ATTR_SERVICE_INSTANCE_ID]: randomUUID(),\n },\n };\n }\n}\n\n/**\n * @experimental\n */\nexport const serviceInstanceIdDetector = new ServiceInstanceIdDetector();\n"]} | ||
| {"version":3,"file":"ServiceInstanceIdDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/ServiceInstanceIdDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAIpC;;GAEG;AACH,MAAM,yBAAyB;IAC7B,MAAM,CAAC,OAAiC;QACtC,OAAO;YACL,UAAU,EAAE;gBACV,CAAC,wBAAwB,CAAC,EAAE,UAAU,EAAE;aACzC;SACF,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,yBAAyB,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ATTR_SERVICE_INSTANCE_ID } from '../../../semconv';\nimport { randomUUID } from 'crypto';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { DetectedResource, ResourceDetector } from '../../../types';\n\n/**\n * ServiceInstanceIdDetector detects the resources related to the service instance ID.\n */\nclass ServiceInstanceIdDetector implements ResourceDetector {\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n return {\n attributes: {\n [ATTR_SERVICE_INSTANCE_ID]: randomUUID(),\n },\n };\n }\n}\n\n/**\n * @experimental\n */\nexport const serviceInstanceIdDetector = new ServiceInstanceIdDetector();\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ export const normalizeArch = (nodeArchString) => { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,cAAsB,EAAU,EAAE;IAC9D,0EAA0E;IAC1E,8HAA8H;IAC9H,QAAQ,cAAc,EAAE;QACtB,KAAK,KAAK;YACR,OAAO,OAAO,CAAC;QACjB,KAAK,KAAK;YACR,OAAO,OAAO,CAAC;QACjB,KAAK,KAAK;YACR,OAAO,OAAO,CAAC;QACjB;YACE,OAAO,cAAc,CAAC;KACzB;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,YAAoB,EAAU,EAAE;IAC5D,8EAA8E;IAC9E,4HAA4H;IAC5H,QAAQ,YAAY,EAAE;QACpB,KAAK,OAAO;YACV,OAAO,SAAS,CAAC;QACnB,KAAK,OAAO;YACV,OAAO,SAAS,CAAC;QACnB;YACE,OAAO,YAAY,CAAC;KACvB;AACH,CAAC,CAAC","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 */\nexport const normalizeArch = (nodeArchString: string): string => {\n // Maps from https://nodejs.org/api/os.html#osarch to arch values in spec:\n // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/host.md\n switch (nodeArchString) {\n case 'arm':\n return 'arm32';\n case 'ppc':\n return 'ppc32';\n case 'x64':\n return 'amd64';\n default:\n return nodeArchString;\n }\n};\n\nexport const normalizeType = (nodePlatform: string): string => {\n // Maps from https://nodejs.org/api/os.html#osplatform to arch values in spec:\n // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/os.md\n switch (nodePlatform) {\n case 'sunos':\n return 'solaris';\n case 'win32':\n return 'windows';\n default:\n return nodePlatform;\n }\n};\n"]} | ||
| {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,cAAsB,EAAU,EAAE;IAC9D,0EAA0E;IAC1E,8HAA8H;IAC9H,QAAQ,cAAc,EAAE;QACtB,KAAK,KAAK;YACR,OAAO,OAAO,CAAC;QACjB,KAAK,KAAK;YACR,OAAO,OAAO,CAAC;QACjB,KAAK,KAAK;YACR,OAAO,OAAO,CAAC;QACjB;YACE,OAAO,cAAc,CAAC;KACzB;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,YAAoB,EAAU,EAAE;IAC5D,8EAA8E;IAC9E,4HAA4H;IAC5H,QAAQ,YAAY,EAAE;QACpB,KAAK,OAAO;YACV,OAAO,SAAS,CAAC;QACnB,KAAK,OAAO;YACV,OAAO,SAAS,CAAC;QACnB;YACE,OAAO,YAAY,CAAC;KACvB;AACH,CAAC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport const normalizeArch = (nodeArchString: string): string => {\n // Maps from https://nodejs.org/api/os.html#osarch to arch values in spec:\n // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/host.md\n switch (nodeArchString) {\n case 'arm':\n return 'arm32';\n case 'ppc':\n return 'ppc32';\n case 'x64':\n return 'amd64';\n default:\n return nodeArchString;\n }\n};\n\nexport const normalizeType = (nodePlatform: string): string => {\n // Maps from https://nodejs.org/api/os.html#osplatform to arch values in spec:\n // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/os.md\n switch (nodePlatform) {\n case 'sunos':\n return 'solaris';\n case 'win32':\n return 'windows';\n default:\n return nodePlatform;\n }\n};\n"]} |
+1
-12
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ export { detectResources } from './detect-resources'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,eAAe,EACf,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC","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\nexport type { ResourceDetectionConfig } from './config';\nexport { detectResources } from './detect-resources';\nexport {\n envDetector,\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './detectors';\nexport type { Resource } from './Resource';\nexport {\n resourceFromAttributes,\n defaultResource,\n emptyResource,\n} from './ResourceImpl';\nexport { defaultServiceName } from './default-service-name';\nexport type {\n ResourceDetector,\n DetectedResource,\n DetectedResourceAttributes,\n RawResourceAttribute,\n MaybePromise,\n} from './types';\n"]} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,eAAe,EACf,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport type { ResourceDetectionConfig } from './config';\nexport { detectResources } from './detect-resources';\nexport {\n envDetector,\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './detectors';\nexport type { Resource } from './Resource';\nexport {\n resourceFromAttributes,\n defaultResource,\n emptyResource,\n} from './ResourceImpl';\nexport { defaultServiceName } from './default-service-name';\nexport type {\n ResourceDetector,\n DetectedResource,\n DetectedResourceAttributes,\n RawResourceAttribute,\n MaybePromise,\n} from './types';\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| export {}; | ||
| //# sourceMappingURL=Resource.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"Resource.js","sourceRoot":"","sources":["../../src/Resource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","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 { Attributes } from '@opentelemetry/api';\nimport { RawResourceAttribute } from './types';\n\n/**\n * An interface that represents a resource. A Resource describes the entity for which signals (metrics or trace) are\n * collected.\n *\n * This interface is NOT user-implementable. Valid ways to obtain a {@link Resource} are by using either of these functions\n * - {@link resourceFromAttributes}\n * - {@link emptyResource}\n * - {@link defaultResource}\n * - {@link detectResources}\n */\nexport interface Resource {\n /**\n * Check if async attributes have resolved. This is useful to avoid awaiting\n * waitForAsyncAttributes (which will introduce asynchronous behavior) when not necessary.\n *\n * @returns true if the resource \"attributes\" property is not yet settled to its final value\n */\n readonly asyncAttributesPending?: boolean;\n\n /**\n * @returns the Resource's attributes.\n */\n readonly attributes: Attributes;\n\n /**\n * @returns the Resource's schema URL or undefined if not set.\n */\n readonly schemaUrl?: string;\n\n /**\n * Returns a promise that will never be rejected. Resolves when all async attributes have finished being added to\n * this Resource's attributes. This is useful in exporters to block until resource detection\n * has finished.\n */\n waitForAsyncAttributes?(): Promise<void>;\n\n /**\n * Returns a new, merged {@link Resource} by merging the current Resource\n * with the other Resource. In case of a collision, other Resource takes\n * precedence.\n *\n * @param other the Resource that will be merged with this.\n * @returns the newly merged Resource.\n */\n merge(other: Resource | null): Resource;\n\n getRawAttributes(): RawResourceAttribute[];\n}\n"]} | ||
| {"version":3,"file":"Resource.js","sourceRoot":"","sources":["../../src/Resource.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Attributes } from '@opentelemetry/api';\nimport { RawResourceAttribute } from './types';\n\n/**\n * An interface that represents a resource. A Resource describes the entity for which signals (metrics or trace) are\n * collected.\n *\n * This interface is NOT user-implementable. Valid ways to obtain a {@link Resource} are by using either of these functions\n * - {@link resourceFromAttributes}\n * - {@link emptyResource}\n * - {@link defaultResource}\n * - {@link detectResources}\n */\nexport interface Resource {\n /**\n * Check if async attributes have resolved. This is useful to avoid awaiting\n * waitForAsyncAttributes (which will introduce asynchronous behavior) when not necessary.\n *\n * @returns true if the resource \"attributes\" property is not yet settled to its final value\n */\n readonly asyncAttributesPending?: boolean;\n\n /**\n * @returns the Resource's attributes.\n */\n readonly attributes: Attributes;\n\n /**\n * @returns the Resource's schema URL or undefined if not set.\n */\n readonly schemaUrl?: string;\n\n /**\n * Returns a promise that will never be rejected. Resolves when all async attributes have finished being added to\n * this Resource's attributes. This is useful in exporters to block until resource detection\n * has finished.\n */\n waitForAsyncAttributes?(): Promise<void>;\n\n /**\n * Returns a new, merged {@link Resource} by merging the current Resource\n * with the other Resource. In case of a collision, other Resource takes\n * precedence.\n *\n * @param other the Resource that will be merged with this.\n * @returns the newly merged Resource.\n */\n merge(other: Resource | null): Resource;\n\n getRawAttributes(): RawResourceAttribute[];\n}\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { diag } from '@opentelemetry/api'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ResourceImpl.js","sourceRoot":"","sources":["../../src/ResourceImpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAA8B,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAQ5D,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,YAAY;IACR,cAAc,CAAyB;IACvC,uBAAuB,GAAG,KAAK,CAAC;IAChC,UAAU,CAAU;IAEpB,mBAAmB,CAAc;IAEzC,MAAM,CAAC,iBAAiB,CACtB,UAAgE,EAChE,OAAyB;QAEzB,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAC1C,GAAG,CAAC,cAAc,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;QACtD,GAAG,CAAC,uBAAuB;YACzB,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QACjE,OAAO,GAAG,CAAC;IACb,CAAC;IAED;IACE;;;;OAIG;IACH,QAA0B,EAC1B,OAAyB;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SAAS,CAAC;AACnB,CAAC;AAED,SAAS,cAAc,CACrB,GAAa,EACb,QAAyB;IAEzB,MAAM,YAAY,GAAG,GAAG,EAAE,SAAS,CAAC;IACpC,MAAM,iBAAiB,GAAG,QAAQ,EAAE,SAAS,CAAC;IAE9C,MAAM,UAAU,GAAG,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,EAAE,CAAC;IACrE,MAAM,eAAe,GACnB,iBAAiB,KAAK,SAAS,IAAI,iBAAiB,KAAK,EAAE,CAAC;IAE9D,IAAI,UAAU,EAAE;QACd,OAAO,iBAAiB,CAAC;KAC1B;IAED,IAAI,eAAe,EAAE;QACnB,OAAO,YAAY,CAAC;KACrB;IAED,IAAI,YAAY,KAAK,iBAAiB,EAAE;QACtC,OAAO,YAAY,CAAC;KACrB;IAED,IAAI,CAAC,IAAI,CACP,kIAAkI,EAClI,YAAY,EACZ,iBAAiB,CAClB,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC","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 { Attributes, AttributeValue, diag } from '@opentelemetry/api';\nimport { SDK_INFO } from '@opentelemetry/core';\nimport {\n ATTR_SERVICE_NAME,\n ATTR_TELEMETRY_SDK_LANGUAGE,\n ATTR_TELEMETRY_SDK_NAME,\n ATTR_TELEMETRY_SDK_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { Resource } from './Resource';\nimport { defaultServiceName } from './default-service-name';\nimport {\n DetectedResource,\n DetectedResourceAttributes,\n MaybePromise,\n RawResourceAttribute,\n ResourceOptions,\n} from './types';\nimport { isPromiseLike } from './utils';\n\nclass ResourceImpl implements Resource {\n private _rawAttributes: RawResourceAttribute[];\n private _asyncAttributesPending = false;\n private _schemaUrl?: string;\n\n private _memoizedAttributes?: Attributes;\n\n static FromAttributeList(\n attributes: [string, MaybePromise<AttributeValue | undefined>][],\n options?: ResourceOptions\n ): Resource {\n const res = new ResourceImpl({}, options);\n res._rawAttributes = guardedRawAttributes(attributes);\n res._asyncAttributesPending =\n attributes.filter(([_, val]) => isPromiseLike(val)).length > 0;\n return res;\n }\n\n constructor(\n /**\n * A dictionary of attributes with string keys and values that provide\n * information about the entity as numbers, strings or booleans\n * TODO: Consider to add check/validation on attributes.\n */\n resource: DetectedResource,\n options?: ResourceOptions\n ) {\n const attributes = resource.attributes ?? {};\n this._rawAttributes = Object.entries(attributes).map(([k, v]) => {\n if (isPromiseLike(v)) {\n // side-effect\n this._asyncAttributesPending = true;\n }\n\n return [k, v];\n });\n\n this._rawAttributes = guardedRawAttributes(this._rawAttributes);\n this._schemaUrl = validateSchemaUrl(options?.schemaUrl);\n }\n\n public get asyncAttributesPending(): boolean {\n return this._asyncAttributesPending;\n }\n\n public async waitForAsyncAttributes(): Promise<void> {\n if (!this.asyncAttributesPending) {\n return;\n }\n\n for (let i = 0; i < this._rawAttributes.length; i++) {\n const [k, v] = this._rawAttributes[i];\n this._rawAttributes[i] = [k, isPromiseLike(v) ? await v : v];\n }\n\n this._asyncAttributesPending = false;\n }\n\n public get attributes(): Attributes {\n if (this.asyncAttributesPending) {\n diag.error(\n 'Accessing resource attributes before async attributes settled'\n );\n }\n\n if (this._memoizedAttributes) {\n return this._memoizedAttributes;\n }\n\n const attrs: Attributes = {};\n for (const [k, v] of this._rawAttributes) {\n if (isPromiseLike(v)) {\n diag.debug(`Unsettled resource attribute ${k} skipped`);\n continue;\n }\n if (v != null) {\n attrs[k] ??= v;\n }\n }\n\n // only memoize output if all attributes are settled\n if (!this._asyncAttributesPending) {\n this._memoizedAttributes = attrs;\n }\n\n return attrs;\n }\n\n public getRawAttributes(): RawResourceAttribute[] {\n return this._rawAttributes;\n }\n\n public get schemaUrl(): string | undefined {\n return this._schemaUrl;\n }\n\n public merge(resource: Resource | null): Resource {\n if (resource == null) return this;\n\n // Order is important\n // Spec states incoming attributes override existing attributes\n const mergedSchemaUrl = mergeSchemaUrl(this, resource);\n const mergedOptions: ResourceOptions | undefined = mergedSchemaUrl\n ? { schemaUrl: mergedSchemaUrl }\n : undefined;\n\n return ResourceImpl.FromAttributeList(\n [...resource.getRawAttributes(), ...this.getRawAttributes()],\n mergedOptions\n );\n }\n}\n\nexport function resourceFromAttributes(\n attributes: DetectedResourceAttributes,\n options?: ResourceOptions\n): Resource {\n return ResourceImpl.FromAttributeList(Object.entries(attributes), options);\n}\n\nexport function resourceFromDetectedResource(\n detectedResource: DetectedResource,\n options?: ResourceOptions\n): Resource {\n return new ResourceImpl(detectedResource, options);\n}\n\nexport function emptyResource(): Resource {\n return resourceFromAttributes({});\n}\n\nexport function defaultResource(): Resource {\n return resourceFromAttributes({\n [ATTR_SERVICE_NAME]: defaultServiceName(),\n [ATTR_TELEMETRY_SDK_LANGUAGE]: SDK_INFO[ATTR_TELEMETRY_SDK_LANGUAGE],\n [ATTR_TELEMETRY_SDK_NAME]: SDK_INFO[ATTR_TELEMETRY_SDK_NAME],\n [ATTR_TELEMETRY_SDK_VERSION]: SDK_INFO[ATTR_TELEMETRY_SDK_VERSION],\n });\n}\n\nfunction guardedRawAttributes(\n attributes: RawResourceAttribute[]\n): RawResourceAttribute[] {\n return attributes.map(([k, v]) => {\n if (isPromiseLike(v)) {\n return [\n k,\n v.catch(err => {\n diag.debug(\n 'promise rejection for resource attribute: %s - %s',\n k,\n err\n );\n return undefined;\n }),\n ];\n }\n return [k, v];\n });\n}\n\nfunction validateSchemaUrl(schemaUrl?: string): string | undefined {\n if (typeof schemaUrl === 'string' || schemaUrl === undefined) {\n return schemaUrl;\n }\n\n diag.warn(\n 'Schema URL must be string or undefined, got %s. Schema URL will be ignored.',\n schemaUrl\n );\n\n return undefined;\n}\n\nfunction mergeSchemaUrl(\n old: Resource,\n updating: Resource | null\n): string | undefined {\n const oldSchemaUrl = old?.schemaUrl;\n const updatingSchemaUrl = updating?.schemaUrl;\n\n const isOldEmpty = oldSchemaUrl === undefined || oldSchemaUrl === '';\n const isUpdatingEmpty =\n updatingSchemaUrl === undefined || updatingSchemaUrl === '';\n\n if (isOldEmpty) {\n return updatingSchemaUrl;\n }\n\n if (isUpdatingEmpty) {\n return oldSchemaUrl;\n }\n\n if (oldSchemaUrl === updatingSchemaUrl) {\n return oldSchemaUrl;\n }\n\n diag.warn(\n 'Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.',\n oldSchemaUrl,\n updatingSchemaUrl\n );\n\n return undefined;\n}\n"]} | ||
| {"version":3,"file":"ResourceImpl.js","sourceRoot":"","sources":["../../src/ResourceImpl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAA8B,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAQ5D,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,YAAY;IACR,cAAc,CAAyB;IACvC,uBAAuB,GAAG,KAAK,CAAC;IAChC,UAAU,CAAU;IAEpB,mBAAmB,CAAc;IAEzC,MAAM,CAAC,iBAAiB,CACtB,UAAgE,EAChE,OAAyB;QAEzB,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAC1C,GAAG,CAAC,cAAc,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;QACtD,GAAG,CAAC,uBAAuB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AAC,CAAC;AACL,CAAC;AAED,SAAS,iBAAiB,CAAC,SAAkB;IAC3C,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,SAAS,EAAE;QAC5D,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,CAAC,IAAI,CACP,6EAA6E,EAC7E,SAAS,CACV,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,cAAc,CACrB,GAAa,EACb,QAAyB;IAEzB,MAAM,YAAY,GAAG,GAAG,EAAE,SAAS,CAAC;IACpC,MAAM,iBAAiB,GAAG,QAAQ,EAAE,SAAS,CAAC;IAE9C,MAAM,UAAU,GAAG,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,EAAE,CAAC;IACrE,MAAM,eAAe,GACnB,iBAAiB,KAAK,SAAS,IAAI,iBAAiB,KAAK,EAAE,CAAC;IAE9D,IAAI,UAAU,EAAE;QACd,OAAO,iBAAiB,CAAC;KAC1B;IAED,IAAI,eAAe,EAAE;QACnB,OAAO,YAAY,CAAC;KACrB;IAED,IAAI,YAAY,KAAK,iBAAiB,EAAE;QACtC,OAAO,YAAY,CAAC;KACrB;IAED,IAAI,CAAC,IAAI,CACP,kIAAkI,EAClI,YAAY,EACZ,iBAAiB,CAClB,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Attributes, AttributeValue, diag } from '@opentelemetry/api';\nimport { SDK_INFO } from '@opentelemetry/core';\nimport {\n ATTR_SERVICE_NAME,\n ATTR_TELEMETRY_SDK_LANGUAGE,\n ATTR_TELEMETRY_SDK_NAME,\n ATTR_TELEMETRY_SDK_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { Resource } from './Resource';\nimport { defaultServiceName } from './default-service-name';\nimport {\n DetectedResource,\n DetectedResourceAttributes,\n MaybePromise,\n RawResourceAttribute,\n ResourceOptions,\n} from './types';\nimport { isPromiseLike } from './utils';\n\nclass ResourceImpl implements Resource {\n private _rawAttributes: RawResourceAttribute[];\n private _asyncAttributesPending = false;\n private _schemaUrl?: string;\n\n private _memoizedAttributes?: Attributes;\n\n static FromAttributeList(\n attributes: [string, MaybePromise<AttributeValue | undefined>][],\n options?: ResourceOptions\n ): Resource {\n const res = new ResourceImpl({}, options);\n res._rawAttributes = guardedRawAttributes(attributes);\n res._asyncAttributesPending =\n attributes.filter(([_, val]) => isPromiseLike(val)).length > 0;\n return res;\n }\n\n constructor(\n /**\n * A dictionary of attributes with string keys and values that provide\n * information about the entity as numbers, strings or booleans\n * TODO: Consider to add check/validation on attributes.\n */\n resource: DetectedResource,\n options?: ResourceOptions\n ) {\n const attributes = resource.attributes ?? {};\n this._rawAttributes = Object.entries(attributes).map(([k, v]) => {\n if (isPromiseLike(v)) {\n // side-effect\n this._asyncAttributesPending = true;\n }\n\n return [k, v];\n });\n\n this._rawAttributes = guardedRawAttributes(this._rawAttributes);\n this._schemaUrl = validateSchemaUrl(options?.schemaUrl);\n }\n\n public get asyncAttributesPending(): boolean {\n return this._asyncAttributesPending;\n }\n\n public async waitForAsyncAttributes(): Promise<void> {\n if (!this.asyncAttributesPending) {\n return;\n }\n\n for (let i = 0; i < this._rawAttributes.length; i++) {\n const [k, v] = this._rawAttributes[i];\n this._rawAttributes[i] = [k, isPromiseLike(v) ? await v : v];\n }\n\n this._asyncAttributesPending = false;\n }\n\n public get attributes(): Attributes {\n if (this.asyncAttributesPending) {\n diag.error(\n 'Accessing resource attributes before async attributes settled'\n );\n }\n\n if (this._memoizedAttributes) {\n return this._memoizedAttributes;\n }\n\n const attrs: Attributes = {};\n for (const [k, v] of this._rawAttributes) {\n if (isPromiseLike(v)) {\n diag.debug(`Unsettled resource attribute ${k} skipped`);\n continue;\n }\n if (v != null) {\n attrs[k] ??= v;\n }\n }\n\n // only memoize output if all attributes are settled\n if (!this._asyncAttributesPending) {\n this._memoizedAttributes = attrs;\n }\n\n return attrs;\n }\n\n public getRawAttributes(): RawResourceAttribute[] {\n return this._rawAttributes;\n }\n\n public get schemaUrl(): string | undefined {\n return this._schemaUrl;\n }\n\n public merge(resource: Resource | null): Resource {\n if (resource == null) return this;\n\n // Order is important\n // Spec states incoming attributes override existing attributes\n const mergedSchemaUrl = mergeSchemaUrl(this, resource);\n const mergedOptions: ResourceOptions | undefined = mergedSchemaUrl\n ? { schemaUrl: mergedSchemaUrl }\n : undefined;\n\n return ResourceImpl.FromAttributeList(\n [...resource.getRawAttributes(), ...this.getRawAttributes()],\n mergedOptions\n );\n }\n}\n\nexport function resourceFromAttributes(\n attributes: DetectedResourceAttributes,\n options?: ResourceOptions\n): Resource {\n return ResourceImpl.FromAttributeList(Object.entries(attributes), options);\n}\n\nexport function resourceFromDetectedResource(\n detectedResource: DetectedResource,\n options?: ResourceOptions\n): Resource {\n return new ResourceImpl(detectedResource, options);\n}\n\nexport function emptyResource(): Resource {\n return resourceFromAttributes({});\n}\n\nexport function defaultResource(): Resource {\n return resourceFromAttributes({\n [ATTR_SERVICE_NAME]: defaultServiceName(),\n [ATTR_TELEMETRY_SDK_LANGUAGE]: SDK_INFO[ATTR_TELEMETRY_SDK_LANGUAGE],\n [ATTR_TELEMETRY_SDK_NAME]: SDK_INFO[ATTR_TELEMETRY_SDK_NAME],\n [ATTR_TELEMETRY_SDK_VERSION]: SDK_INFO[ATTR_TELEMETRY_SDK_VERSION],\n });\n}\n\nfunction guardedRawAttributes(\n attributes: RawResourceAttribute[]\n): RawResourceAttribute[] {\n return attributes.map(([k, v]) => {\n if (isPromiseLike(v)) {\n return [\n k,\n v.catch(err => {\n diag.debug(\n 'promise rejection for resource attribute: %s - %s',\n k,\n err\n );\n return undefined;\n }),\n ];\n }\n return [k, v];\n });\n}\n\nfunction validateSchemaUrl(schemaUrl?: string): string | undefined {\n if (typeof schemaUrl === 'string' || schemaUrl === undefined) {\n return schemaUrl;\n }\n\n diag.warn(\n 'Schema URL must be string or undefined, got %s. Schema URL will be ignored.',\n schemaUrl\n );\n\n return undefined;\n}\n\nfunction mergeSchemaUrl(\n old: Resource,\n updating: Resource | null\n): string | undefined {\n const oldSchemaUrl = old?.schemaUrl;\n const updatingSchemaUrl = updating?.schemaUrl;\n\n const isOldEmpty = oldSchemaUrl === undefined || oldSchemaUrl === '';\n const isUpdatingEmpty =\n updatingSchemaUrl === undefined || updatingSchemaUrl === '';\n\n if (isOldEmpty) {\n return updatingSchemaUrl;\n }\n\n if (isUpdatingEmpty) {\n return oldSchemaUrl;\n }\n\n if (oldSchemaUrl === updatingSchemaUrl) {\n return oldSchemaUrl;\n }\n\n diag.warn(\n 'Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.',\n oldSchemaUrl,\n updatingSchemaUrl\n );\n\n return undefined;\n}\n"]} |
+1
-12
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ /* |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAA2B,CAAC;AAEjE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,yBAAkC,CAAC;AAE/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB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,CAAC,MAAM,eAAe,GAAG,YAAqB,CAAC;AAErD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,iBAA0B,CAAC;AAE/D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,sBAA+B,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,yBAAkC,CAAC;AAE/E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,yBAAkC,CAAC;AAE/E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAwB,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAsB,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAC3C,6BAAsC,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,sBAA+B,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,yBAAkC,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAA8B,CAAC;AAEvE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAA4B,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,uBAAgC,CAAC;AAE3E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAA4B,CAAC","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\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * The cloud account ID the resource is assigned to.\n *\n * @example 111111111111\n * @example opentelemetry\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_ACCOUNT_ID = 'cloud.account.id' as const;\n\n/**\n * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.\n *\n * @example us-east-1c\n *\n * @note Availability zones are called \"zones\" on Alibaba Cloud and Google Cloud.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_AVAILABILITY_ZONE = 'cloud.availability_zone' as const;\n\n/**\n * Name of the cloud provider.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_PROVIDER = 'cloud.provider' as const;\n\n/**\n * The geographical region the resource is running.\n *\n * @example us-central1\n * @example us-east-1\n *\n * @note Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091).\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_REGION = 'cloud.region' as const;\n\n/**\n * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated.\n *\n * @example a3bf90e006b2\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_ID = 'container.id' as const;\n\n/**\n * Name of the image the container was built on.\n *\n * @example gcr.io/opentelemetry/operator\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_IMAGE_NAME = 'container.image.name' as const;\n\n/**\n * Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `<tag>` section of the full name for example from `registry.example.com/my-org/my-image:<tag>`.\n *\n * @example [\"v1.27.1\", \"3.5.7-0\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_IMAGE_TAGS = 'container.image.tags' as const;\n\n/**\n * Container name used by container runtime.\n *\n * @example opentelemetry-autoconf\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_NAME = 'container.name' as const;\n\n/**\n * The CPU architecture the host system is running on.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_ARCH = 'host.arch' as const;\n\n/**\n * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system.\n *\n * @example fdbf79e8af94cb7f9e8df36789187052\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_ID = 'host.id' as const;\n\n/**\n * VM image ID or host OS image ID. For Cloud, this value is from the provider.\n *\n * @example ami-07b06b442921831e5\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_IMAGE_ID = 'host.image.id' as const;\n\n/**\n * Name of the VM image or OS install the host was instantiated from.\n *\n * @example infra-ami-eks-worker-node-7d4ec78312\n * @example CentOS-8-x86_64-1905\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_IMAGE_NAME = 'host.image.name' as const;\n\n/**\n * The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes).\n *\n * @example 0.1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_IMAGE_VERSION = 'host.image.version' as const;\n\n/**\n * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user.\n *\n * @example opentelemetry-test\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_NAME = 'host.name' as const;\n\n/**\n * Type of host. For Cloud, this must be the machine type.\n *\n * @example n1-standard-1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_TYPE = 'host.type' as const;\n\n/**\n * The name of the cluster.\n *\n * @example opentelemetry-cluster\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_CLUSTER_NAME = 'k8s.cluster.name' as const;\n\n/**\n * The name of the Deployment.\n *\n * @example opentelemetry\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_DEPLOYMENT_NAME = 'k8s.deployment.name' as const;\n\n/**\n * The name of the namespace that the pod is running in.\n *\n * @example default\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_NAMESPACE_NAME = 'k8s.namespace.name' as const;\n\n/**\n * The name of the Pod.\n *\n * @example opentelemetry-pod-autoconf\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_POD_NAME = 'k8s.pod.name' as const;\n\n/**\n * The operating system type.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OS_TYPE = 'os.type' as const;\n\n/**\n * The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes).\n *\n * @example 14.2.1\n * @example 18.04.1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OS_VERSION = 'os.version' as const;\n\n/**\n * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`.\n *\n * @example cmd/otelcol\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_COMMAND = 'process.command' as const;\n\n/**\n * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`.\n *\n * @example [\"cmd/otecol\", \"--config=config.yaml\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_COMMAND_ARGS = 'process.command_args' as const;\n\n/**\n * The name of the process executable. On Linux based systems, this **SHOULD** be set to the base name of the target of `/proc/[pid]/exe`. On Windows, this **SHOULD** be set to the base name of `GetProcessImageFileNameW`.\n *\n * @example otelcol\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_EXECUTABLE_NAME = 'process.executable.name' as const;\n\n/**\n * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`.\n *\n * @example /usr/bin/cmd/otelcol\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_EXECUTABLE_PATH = 'process.executable.path' as const;\n\n/**\n * The username of the user that owns the process.\n *\n * @example root\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_OWNER = 'process.owner' as const;\n\n/**\n * Process identifier (PID).\n *\n * @example 1234\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_PID = 'process.pid' as const;\n\n/**\n * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment.\n *\n * @example \"Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_DESCRIPTION =\n 'process.runtime.description' as const;\n\n/**\n * The name of the runtime of this process.\n *\n * @example OpenJDK Runtime Environment\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_NAME = 'process.runtime.name' as const;\n\n/**\n * The version of the runtime of this process, as returned by the runtime without modification.\n *\n * @example \"14.0.2\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_VERSION = 'process.runtime.version' as const;\n\n/**\n * The string ID of the service instance.\n *\n * @example 627cc493-f310-47de-96bd-71410b7dec09\n *\n * @note **MUST** be unique for each instance of the same `service.namespace,service.name` pair (in other words\n * `service.namespace,service.name,service.instance.id` triplet **MUST** be globally unique). The ID helps to\n * distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled\n * service).\n *\n * Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC\n * 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of\n * this value if stability is desirable. In that case, the ID **SHOULD** be used as source of a UUID Version 5 and\n * **SHOULD** use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`.\n *\n * UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is\n * needed. Similar to what can be seen in the man page for the\n * [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/latest/machine-id.html) file, the underlying\n * data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it\n * or not via another resource attribute.\n *\n * For applications running behind an application server (like unicorn), we do not recommend using one identifier\n * for all processes participating in the application. Instead, it's recommended each division (e.g. a worker\n * thread in unicorn) to have its own instance.id.\n *\n * It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the\n * service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will\n * likely be wrong, as the Collector might not know from which container within that pod the telemetry originated.\n * However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance\n * for that telemetry. This is typically the case for scraping receivers, as they know the target address and\n * port.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_SERVICE_INSTANCE_ID = 'service.instance.id' as const;\n\n/**\n * A namespace for `service.name`.\n *\n * @example Shop\n *\n * @note A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_SERVICE_NAMESPACE = 'service.namespace' as const;\n\n/**\n * Additional description of the web engine (e.g. detailed version and edition information).\n *\n * @example WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_WEBENGINE_DESCRIPTION = 'webengine.description' as const;\n\n/**\n * The name of the web engine.\n *\n * @example WildFly\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_WEBENGINE_NAME = 'webengine.name' as const;\n\n/**\n * The version of the web engine.\n *\n * @example 21.0.0\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_WEBENGINE_VERSION = 'webengine.version' as const;\n"]} | ||
| {"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAA2B,CAAC;AAEjE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,yBAAkC,CAAC;AAE/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAuB,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAuB,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,sBAA+B,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,sBAA+B,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,WAAoB,CAAC;AAEnD;;;;;;GAMG;A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AEvD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAC3C,6BAAsC,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,sBAA+B,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,yBAAkC,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAA8B,CAAC;AAEvE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAA4B,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,uBAAgC,CAAC;AAE3E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAA4B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * The cloud account ID the resource is assigned to.\n *\n * @example 111111111111\n * @example opentelemetry\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_ACCOUNT_ID = 'cloud.account.id' as const;\n\n/**\n * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.\n *\n * @example us-east-1c\n *\n * @note Availability zones are called \"zones\" on Alibaba Cloud and Google Cloud.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_AVAILABILITY_ZONE = 'cloud.availability_zone' as const;\n\n/**\n * Name of the cloud provider.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_PROVIDER = 'cloud.provider' as const;\n\n/**\n * The geographical region the resource is running.\n *\n * @example us-central1\n * @example us-east-1\n *\n * @note Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091).\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_REGION = 'cloud.region' as const;\n\n/**\n * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated.\n *\n * @example a3bf90e006b2\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_ID = 'container.id' as const;\n\n/**\n * Name of the image the container was built on.\n *\n * @example gcr.io/opentelemetry/operator\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_IMAGE_NAME = 'container.image.name' as const;\n\n/**\n * Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `<tag>` section of the full name for example from `registry.example.com/my-org/my-image:<tag>`.\n *\n * @example [\"v1.27.1\", \"3.5.7-0\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_IMAGE_TAGS = 'container.image.tags' as const;\n\n/**\n * Container name used by container runtime.\n *\n * @example opentelemetry-autoconf\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_NAME = 'container.name' as const;\n\n/**\n * The CPU architecture the host system is running on.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_ARCH = 'host.arch' as const;\n\n/**\n * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system.\n *\n * @example fdbf79e8af94cb7f9e8df36789187052\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_ID = 'host.id' as const;\n\n/**\n * VM image ID or host OS image ID. For Cloud, this value is from the provider.\n *\n * @example ami-07b06b442921831e5\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_IMAGE_ID = 'host.image.id' as const;\n\n/**\n * Name of the VM image or OS install the host was instantiated from.\n *\n * @example infra-ami-eks-worker-node-7d4ec78312\n * @example CentOS-8-x86_64-1905\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_IMAGE_NAME = 'host.image.name' as const;\n\n/**\n * The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes).\n *\n * @example 0.1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_IMAGE_VERSION = 'host.image.version' as const;\n\n/**\n * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user.\n *\n * @example opentelemetry-test\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_NAME = 'host.name' as const;\n\n/**\n * Type of host. For Cloud, this must be the machine type.\n *\n * @example n1-standard-1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_TYPE = 'host.type' as const;\n\n/**\n * The name of the cluster.\n *\n * @example opentelemetry-cluster\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_CLUSTER_NAME = 'k8s.cluster.name' as const;\n\n/**\n * The name of the Deployment.\n *\n * @example opentelemetry\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_DEPLOYMENT_NAME = 'k8s.deployment.name' as const;\n\n/**\n * The name of the namespace that the pod is running in.\n *\n * @example default\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_NAMESPACE_NAME = 'k8s.namespace.name' as const;\n\n/**\n * The name of the Pod.\n *\n * @example opentelemetry-pod-autoconf\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_POD_NAME = 'k8s.pod.name' as const;\n\n/**\n * The operating system type.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OS_TYPE = 'os.type' as const;\n\n/**\n * The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes).\n *\n * @example 14.2.1\n * @example 18.04.1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OS_VERSION = 'os.version' as const;\n\n/**\n * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`.\n *\n * @example cmd/otelcol\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_COMMAND = 'process.command' as const;\n\n/**\n * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`.\n *\n * @example [\"cmd/otecol\", \"--config=config.yaml\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_COMMAND_ARGS = 'process.command_args' as const;\n\n/**\n * The name of the process executable. On Linux based systems, this **SHOULD** be set to the base name of the target of `/proc/[pid]/exe`. On Windows, this **SHOULD** be set to the base name of `GetProcessImageFileNameW`.\n *\n * @example otelcol\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_EXECUTABLE_NAME = 'process.executable.name' as const;\n\n/**\n * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`.\n *\n * @example /usr/bin/cmd/otelcol\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_EXECUTABLE_PATH = 'process.executable.path' as const;\n\n/**\n * The username of the user that owns the process.\n *\n * @example root\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_OWNER = 'process.owner' as const;\n\n/**\n * Process identifier (PID).\n *\n * @example 1234\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_PID = 'process.pid' as const;\n\n/**\n * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment.\n *\n * @example \"Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_DESCRIPTION =\n 'process.runtime.description' as const;\n\n/**\n * The name of the runtime of this process.\n *\n * @example OpenJDK Runtime Environment\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_NAME = 'process.runtime.name' as const;\n\n/**\n * The version of the runtime of this process, as returned by the runtime without modification.\n *\n * @example \"14.0.2\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_VERSION = 'process.runtime.version' as const;\n\n/**\n * The string ID of the service instance.\n *\n * @example 627cc493-f310-47de-96bd-71410b7dec09\n *\n * @note **MUST** be unique for each instance of the same `service.namespace,service.name` pair (in other words\n * `service.namespace,service.name,service.instance.id` triplet **MUST** be globally unique). The ID helps to\n * distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled\n * service).\n *\n * Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC\n * 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of\n * this value if stability is desirable. In that case, the ID **SHOULD** be used as source of a UUID Version 5 and\n * **SHOULD** use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`.\n *\n * UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is\n * needed. Similar to what can be seen in the man page for the\n * [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/latest/machine-id.html) file, the underlying\n * data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it\n * or not via another resource attribute.\n *\n * For applications running behind an application server (like unicorn), we do not recommend using one identifier\n * for all processes participating in the application. Instead, it's recommended each division (e.g. a worker\n * thread in unicorn) to have its own instance.id.\n *\n * It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the\n * service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will\n * likely be wrong, as the Collector might not know from which container within that pod the telemetry originated.\n * However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance\n * for that telemetry. This is typically the case for scraping receivers, as they know the target address and\n * port.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_SERVICE_INSTANCE_ID = 'service.instance.id' as const;\n\n/**\n * A namespace for `service.name`.\n *\n * @example Shop\n *\n * @note A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_SERVICE_NAMESPACE = 'service.namespace' as const;\n\n/**\n * Additional description of the web engine (e.g. detailed version and edition information).\n *\n * @example WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_WEBENGINE_DESCRIPTION = 'webengine.description' as const;\n\n/**\n * The name of the web engine.\n *\n * @example WildFly\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_WEBENGINE_NAME = 'webengine.name' as const;\n\n/**\n * The version of the web engine.\n *\n * @example 21.0.0\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_WEBENGINE_VERSION = 'webengine.version' as const;\n"]} |
+1
-12
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| export {}; | ||
| //# sourceMappingURL=types.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","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 { AttributeValue } from '@opentelemetry/api';\nimport { ResourceDetectionConfig } from './config';\n\n/**\n * Interface for a Resource Detector.\n * A resource detector returns a set of detected resource attributes.\n * A detected resource attribute may be an {@link AttributeValue} or a Promise of an AttributeValue.\n */\nexport interface ResourceDetector {\n /**\n * Detect resource attributes.\n *\n * @returns a {@link DetectedResource} object containing detected resource attributes\n */\n detect(config?: ResourceDetectionConfig): DetectedResource;\n}\n\nexport type DetectedResource = {\n /**\n * Detected resource attributes.\n */\n attributes?: DetectedResourceAttributes;\n};\n\n/**\n * An object representing detected resource attributes.\n * Value may be {@link AttributeValue}s, a promise to an {@link AttributeValue}, or undefined.\n */\ntype DetectedResourceAttributeValue = MaybePromise<AttributeValue | undefined>;\n\n/**\n * An object representing detected resource attributes.\n * Values may be {@link AttributeValue}s or a promise to an {@link AttributeValue}.\n */\nexport type DetectedResourceAttributes = Record<\n string,\n DetectedResourceAttributeValue\n>;\n\nexport type MaybePromise<T> = T | Promise<T>;\n\nexport type RawResourceAttribute = [\n string,\n MaybePromise<AttributeValue | undefined>,\n];\n\n/**\n * Options for creating a {@link Resource}.\n */\nexport type ResourceOptions = {\n schemaUrl?: string;\n};\n"]} | ||
| {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { AttributeValue } from '@opentelemetry/api';\nimport { ResourceDetectionConfig } from './config';\n\n/**\n * Interface for a Resource Detector.\n * A resource detector returns a set of detected resource attributes.\n * A detected resource attribute may be an {@link AttributeValue} or a Promise of an AttributeValue.\n */\nexport interface ResourceDetector {\n /**\n * Detect resource attributes.\n *\n * @returns a {@link DetectedResource} object containing detected resource attributes\n */\n detect(config?: ResourceDetectionConfig): DetectedResource;\n}\n\nexport type DetectedResource = {\n /**\n * Detected resource attributes.\n */\n attributes?: DetectedResourceAttributes;\n};\n\n/**\n * An object representing detected resource attributes.\n * Value may be {@link AttributeValue}s, a promise to an {@link AttributeValue}, or undefined.\n */\ntype DetectedResourceAttributeValue = MaybePromise<AttributeValue | undefined>;\n\n/**\n * An object representing detected resource attributes.\n * Values may be {@link AttributeValue}s or a promise to an {@link AttributeValue}.\n */\nexport type DetectedResourceAttributes = Record<\n string,\n DetectedResourceAttributeValue\n>;\n\nexport type MaybePromise<T> = T | Promise<T>;\n\nexport type RawResourceAttribute = [\n string,\n MaybePromise<AttributeValue | undefined>,\n];\n\n/**\n * Options for creating a {@link Resource}.\n */\nexport type ResourceOptions = {\n schemaUrl?: string;\n};\n"]} |
+1
-12
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ export const isPromiseLike = (val) => { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAI,GAAY,EAAyB,EAAE;IACtE,OAAO,CACL,GAAG,KAAK,IAAI;QACZ,OAAO,GAAG,KAAK,QAAQ;QACvB,OAAQ,GAA+B,CAAC,IAAI,KAAK,UAAU,CAC5D,CAAC;AACJ,CAAC,CAAC","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\nexport const isPromiseLike = <R>(val: unknown): val is PromiseLike<R> => {\n return (\n val !== null &&\n typeof val === 'object' &&\n typeof (val as Partial<PromiseLike<R>>).then === 'function'\n );\n};\n"]} | ||
| {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAI,GAAY,EAAyB,EAAE;IACtE,OAAO,CACL,GAAG,KAAK,IAAI;QACZ,OAAO,GAAG,KAAK,QAAQ;QACvB,OAAQ,GAA+B,CAAC,IAAI,KAAK,UAAU,CAC5D,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport const isPromiseLike = <R>(val: unknown): val is PromiseLike<R> => {\n return (\n val !== null &&\n typeof val === 'object' &&\n typeof (val as Partial<PromiseLike<R>>).then === 'function'\n );\n};\n"]} |
@@ -1,2 +0,2 @@ | ||
| export declare const VERSION = "2.5.1"; | ||
| export declare const VERSION = "2.6.0"; | ||
| //# sourceMappingURL=version.d.ts.map |
@@ -17,3 +17,3 @@ /* | ||
| // this is autogenerated file, see scripts/version-update.js | ||
| export const VERSION = '2.5.1'; | ||
| export const VERSION = '2.6.0'; | ||
| //# sourceMappingURL=version.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC","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\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '2.5.1';\n"]} | ||
| {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC","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\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '2.6.0';\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| export {}; | ||
| //# sourceMappingURL=config.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","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 type { ResourceDetector } from './types';\n\n/**\n * ResourceDetectionConfig provides an interface for configuring resource auto-detection.\n */\nexport interface ResourceDetectionConfig {\n detectors?: Array<ResourceDetector>;\n}\n"]} | ||
| {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ResourceDetector } from './types';\n\n/**\n * ResourceDetectionConfig provides an interface for configuring resource auto-detection.\n */\nexport interface ResourceDetectionConfig {\n detectors?: Array<ResourceDetector>;\n}\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ let serviceName; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"default-service-name.js","sourceRoot":"","sources":["../../src/default-service-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,IAAI,WAA+B,CAAC;AAEpC;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,WAAW,KAAK,SAAS,EAAE;QAC7B,IAAI;YACF,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC;YACvC,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,mBAAmB,KAAK,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC;SACtE;QAAC,MAAM;YACN,WAAW,GAAG,iBAAiB,CAAC;SACjC;KACF;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,6BAA6B;IAC3C,WAAW,GAAG,SAAS,CAAC;AAC1B,CAAC","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\nlet serviceName: string | undefined;\n\n/**\n * Returns the default service name for OpenTelemetry resources.\n * In Node.js environments, returns \"unknown_service:<process.argv0>\".\n * In browser/edge environments, returns \"unknown_service\".\n */\nexport function defaultServiceName(): string {\n if (serviceName === undefined) {\n try {\n const argv0 = globalThis.process.argv0;\n serviceName = argv0 ? `unknown_service:${argv0}` : 'unknown_service';\n } catch {\n serviceName = 'unknown_service';\n }\n }\n return serviceName;\n}\n\n/** @internal For testing purposes only */\nexport function _clearDefaultServiceNameCache(): void {\n serviceName = undefined;\n}\n"]} | ||
| {"version":3,"file":"default-service-name.js","sourceRoot":"","sources":["../../src/default-service-name.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,IAAI,WAA+B,CAAC;AAEpC;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,WAAW,KAAK,SAAS,EAAE;QAC7B,IAAI;YACF,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC;YACvC,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,mBAAmB,KAAK,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC;SACtE;QAAC,MAAM;YACN,WAAW,GAAG,iBAAiB,CAAC;SACjC;KACF;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,6BAA6B;IAC3C,WAAW,GAAG,SAAS,CAAC;AAC1B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nlet serviceName: string | undefined;\n\n/**\n * Returns the default service name for OpenTelemetry resources.\n * In Node.js environments, returns \"unknown_service:<process.argv0>\".\n * In browser/edge environments, returns \"unknown_service\".\n */\nexport function defaultServiceName(): string {\n if (serviceName === undefined) {\n try {\n const argv0 = globalThis.process.argv0;\n serviceName = argv0 ? `unknown_service:${argv0}` : 'unknown_service';\n } catch {\n serviceName = 'unknown_service';\n }\n }\n return serviceName;\n}\n\n/** @internal For testing purposes only */\nexport function _clearDefaultServiceNameCache(): void {\n serviceName = undefined;\n}\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { diag } from '@opentelemetry/api'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"detect-resources.js","sourceRoot":"","sources":["../../src/detect-resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAG7E;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,SAAkC,EAAE,EAC1B,EAAE;IACZ,MAAM,SAAS,GAAe,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;QAC7D,IAAI;YACF,MAAM,QAAQ,GAAG,4BAA4B,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;YAChE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,kBAAkB,EAAE,QAAQ,CAAC,CAAC;YAC9D,OAAO,QAAQ,CAAC;SACjB;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YACzD,OAAO,aAAa,EAAE,CAAC;SACxB;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC,MAAM,CACrB,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,EACtC,aAAa,EAAE,CAChB,CAAC;AACJ,CAAC,CAAC","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 { diag } from '@opentelemetry/api';\nimport { Resource } from './Resource';\nimport { emptyResource, resourceFromDetectedResource } from './ResourceImpl';\nimport { ResourceDetectionConfig } from './config';\n\n/**\n * Runs all resource detectors and returns the results merged into a single Resource.\n *\n * @param config Configuration for resource detection\n */\nexport const detectResources = (\n config: ResourceDetectionConfig = {}\n): Resource => {\n const resources: Resource[] = (config.detectors || []).map(d => {\n try {\n const resource = resourceFromDetectedResource(d.detect(config));\n diag.debug(`${d.constructor.name} found resource.`, resource);\n return resource;\n } catch (e) {\n diag.debug(`${d.constructor.name} failed: ${e.message}`);\n return emptyResource();\n }\n });\n\n return resources.reduce(\n (acc, resource) => acc.merge(resource),\n emptyResource()\n );\n};\n"]} | ||
| {"version":3,"file":"detect-resources.js","sourceRoot":"","sources":["../../src/detect-resources.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAG7E;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,SAAkC,EAAE,EAC1B,EAAE;IACZ,MAAM,SAAS,GAAe,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;QAC7D,IAAI;YACF,MAAM,QAAQ,GAAG,4BAA4B,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;YAChE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,kBAAkB,EAAE,QAAQ,CAAC,CAAC;YAC9D,OAAO,QAAQ,CAAC;SACjB;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YACzD,OAAO,aAAa,EAAE,CAAC;SACxB;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC,MAAM,CACrB,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,EACtC,aAAa,EAAE,CAChB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { diag } from '@opentelemetry/api';\nimport { Resource } from './Resource';\nimport { emptyResource, resourceFromDetectedResource } from './ResourceImpl';\nimport { ResourceDetectionConfig } from './config';\n\n/**\n * Runs all resource detectors and returns the results merged into a single Resource.\n *\n * @param config Configuration for resource detection\n */\nexport const detectResources = (\n config: ResourceDetectionConfig = {}\n): Resource => {\n const resources: Resource[] = (config.detectors || []).map(d => {\n try {\n const resource = resourceFromDetectedResource(d.detect(config));\n diag.debug(`${d.constructor.name} found resource.`, resource);\n return resource;\n } catch (e) {\n diag.debug(`${d.constructor.name} failed: ${e.message}`);\n return emptyResource();\n }\n });\n\n return resources.reduce(\n (acc, resource) => acc.merge(resource),\n emptyResource()\n );\n};\n"]} |
@@ -11,4 +11,2 @@ import { ResourceDetectionConfig } from '../config'; | ||
| private readonly _LABEL_KEY_VALUE_SPLITTER; | ||
| private readonly _ERROR_MESSAGE_INVALID_CHARS; | ||
| private readonly _ERROR_MESSAGE_INVALID_VALUE; | ||
| /** | ||
@@ -26,30 +24,15 @@ * Returns a {@link Resource} populated with attributes from the | ||
| * | ||
| * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes describing | ||
| * the source in more detail, e.g. “key1=val1,key2=val2”. Domain names and | ||
| * paths are accepted as attribute keys. Values may be quoted or unquoted in | ||
| * general. If a value contains whitespace, =, or " characters, it must | ||
| * always be quoted. | ||
| * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes in the | ||
| * format "key1=value1,key2=value2". The ',' and '=' characters in keys | ||
| * and values MUST be percent-encoded. Other characters MAY be percent-encoded. | ||
| * | ||
| * Per the spec, on any error (e.g., decoding failure), the entire environment | ||
| * variable value is discarded. | ||
| * | ||
| * @param rawEnvAttributes The resource attributes as a comma-separated list | ||
| * of key/value pairs. | ||
| * @returns The sanitized resource attributes. | ||
| * @returns The parsed resource attributes. | ||
| * @throws Error if parsing fails (caller handles by discarding all attributes) | ||
| */ | ||
| private _parseResourceAttributes; | ||
| /** | ||
| * Determines whether the given String is a valid printable ASCII string with | ||
| * a length not exceed _MAX_LENGTH characters. | ||
| * | ||
| * @param str The String to be validated. | ||
| * @returns Whether the String is valid. | ||
| */ | ||
| private _isValid; | ||
| private _isBaggageOctetString; | ||
| /** | ||
| * Determines whether the given String is a valid printable ASCII string with | ||
| * a length greater than 0 and not exceed _MAX_LENGTH characters. | ||
| * | ||
| * @param str The String to be validated. | ||
| * @returns Whether the String is valid and not empty. | ||
| */ | ||
| private _isValidAndNotEmpty; | ||
| } | ||
@@ -56,0 +39,0 @@ export declare const envDetector: EnvDetector; |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -30,8 +19,2 @@ import { diag } from '@opentelemetry/api'; | ||
| _LABEL_KEY_VALUE_SPLITTER = '='; | ||
| _ERROR_MESSAGE_INVALID_CHARS = 'should be a ASCII string with a length greater than 0 and not exceed ' + | ||
| this._MAX_LENGTH + | ||
| ' characters.'; | ||
| _ERROR_MESSAGE_INVALID_VALUE = 'should be a ASCII string with a length not exceed ' + | ||
| this._MAX_LENGTH + | ||
| ' characters.'; | ||
| /** | ||
@@ -54,3 +37,3 @@ * Returns a {@link Resource} populated with attributes from the | ||
| catch (e) { | ||
| diag.debug(`EnvDetector failed: ${e.message}`); | ||
| diag.debug(`EnvDetector failed: ${e instanceof Error ? e.message : e}`); | ||
| } | ||
@@ -67,11 +50,13 @@ } | ||
| * | ||
| * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes describing | ||
| * the source in more detail, e.g. “key1=val1,key2=val2”. Domain names and | ||
| * paths are accepted as attribute keys. Values may be quoted or unquoted in | ||
| * general. If a value contains whitespace, =, or " characters, it must | ||
| * always be quoted. | ||
| * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes in the | ||
| * format "key1=value1,key2=value2". The ',' and '=' characters in keys | ||
| * and values MUST be percent-encoded. Other characters MAY be percent-encoded. | ||
| * | ||
| * Per the spec, on any error (e.g., decoding failure), the entire environment | ||
| * variable value is discarded. | ||
| * | ||
| * @param rawEnvAttributes The resource attributes as a comma-separated list | ||
| * of key/value pairs. | ||
| * @returns The sanitized resource attributes. | ||
| * @returns The parsed resource attributes. | ||
| * @throws Error if parsing fails (caller handles by discarding all attributes) | ||
| */ | ||
@@ -82,54 +67,38 @@ _parseResourceAttributes(rawEnvAttributes) { | ||
| const attributes = {}; | ||
| const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR, -1); | ||
| const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR); | ||
| for (const rawAttribute of rawAttributes) { | ||
| const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER, -1); | ||
| const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER); | ||
| // Per spec: ',' and '=' MUST be percent-encoded in keys and values. | ||
| // If we get != 2 parts, there's an unencoded '=' which is an error. | ||
| if (keyValuePair.length !== 2) { | ||
| continue; | ||
| throw new Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${rawAttribute}". ` + | ||
| `Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`); | ||
| } | ||
| let [key, value] = keyValuePair; | ||
| // Leading and trailing whitespaces are trimmed. | ||
| key = key.trim(); | ||
| value = value.trim().split(/^"|"$/).join(''); | ||
| if (!this._isValidAndNotEmpty(key)) { | ||
| throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`); | ||
| const [rawKey, rawValue] = keyValuePair; | ||
| const key = rawKey.trim(); | ||
| const value = rawValue.trim(); | ||
| if (key.length === 0) { | ||
| throw new Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${rawAttribute}".`); | ||
| } | ||
| if (!this._isValid(value)) { | ||
| throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`); | ||
| let decodedKey; | ||
| let decodedValue; | ||
| try { | ||
| decodedKey = decodeURIComponent(key); | ||
| decodedValue = decodeURIComponent(value); | ||
| } | ||
| attributes[key] = decodeURIComponent(value); | ||
| catch (e) { | ||
| throw new Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${rawAttribute}": ${e instanceof Error ? e.message : e}`); | ||
| } | ||
| if (decodedKey.length > this._MAX_LENGTH) { | ||
| throw new Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${decodedKey}".`); | ||
| } | ||
| if (decodedValue.length > this._MAX_LENGTH) { | ||
| throw new Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${decodedKey}".`); | ||
| } | ||
| attributes[decodedKey] = decodedValue; | ||
| } | ||
| return attributes; | ||
| } | ||
| /** | ||
| * Determines whether the given String is a valid printable ASCII string with | ||
| * a length not exceed _MAX_LENGTH characters. | ||
| * | ||
| * @param str The String to be validated. | ||
| * @returns Whether the String is valid. | ||
| */ | ||
| _isValid(name) { | ||
| return name.length <= this._MAX_LENGTH && this._isBaggageOctetString(name); | ||
| } | ||
| // https://www.w3.org/TR/baggage/#definition | ||
| _isBaggageOctetString(str) { | ||
| for (let i = 0; i < str.length; i++) { | ||
| const ch = str.charCodeAt(i); | ||
| if (ch < 0x21 || ch === 0x2c || ch === 0x3b || ch === 0x5c || ch > 0x7e) { | ||
| return false; | ||
| } | ||
| } | ||
| return true; | ||
| } | ||
| /** | ||
| * Determines whether the given String is a valid printable ASCII string with | ||
| * a length greater than 0 and not exceed _MAX_LENGTH characters. | ||
| * | ||
| * @param str The String to be validated. | ||
| * @returns Whether the String is valid and not empty. | ||
| */ | ||
| _isValidAndNotEmpty(str) { | ||
| return str.length > 0 && this._isValid(str); | ||
| } | ||
| } | ||
| export const envDetector = new EnvDetector(); | ||
| //# sourceMappingURL=EnvDetector.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"EnvDetector.js","sourceRoot":"","sources":["../../../src/detect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,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACnC,MAAM,EAAE,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC7B,IAAI,EAAE,GAAG,IAAI,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,GAAG,IAAI,EAAE;gBACvE,OAAO,KAAK,CAAC;aACd;SACF;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACK,mBAAmB,CAAC,GAAW;QACrC,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC9C,CAAC;CACF;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC","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 { Attributes, diag } from '@opentelemetry/api';\nimport { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';\nimport { ResourceDetectionConfig } from '../config';\nimport { DetectedResource, ResourceDetector } from '../types';\nimport { getStringFromEnv } from '@opentelemetry/core';\n\n/**\n * EnvDetector can be used to detect the presence of and create a Resource\n * from the OTEL_RESOURCE_ATTRIBUTES environment variable.\n */\nclass EnvDetector implements ResourceDetector {\n // Type, attribute keys, and attribute values should not exceed 256 characters.\n private readonly _MAX_LENGTH = 255;\n\n // OTEL_RESOURCE_ATTRIBUTES is a comma-separated list of attributes.\n private readonly _COMMA_SEPARATOR = ',';\n\n // OTEL_RESOURCE_ATTRIBUTES contains key value pair separated by '='.\n private readonly _LABEL_KEY_VALUE_SPLITTER = '=';\n\n private readonly _ERROR_MESSAGE_INVALID_CHARS =\n 'should be a ASCII string with a length greater than 0 and not exceed ' +\n this._MAX_LENGTH +\n ' characters.';\n\n private readonly _ERROR_MESSAGE_INVALID_VALUE =\n 'should be a ASCII string with a length not exceed ' +\n this._MAX_LENGTH +\n ' characters.';\n\n /**\n * Returns a {@link Resource} populated with attributes from the\n * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async\n * function to conform to the Detector interface.\n *\n * @param config The resource detection config\n */\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n const attributes: Attributes = {};\n\n const rawAttributes = getStringFromEnv('OTEL_RESOURCE_ATTRIBUTES');\n const serviceName = getStringFromEnv('OTEL_SERVICE_NAME');\n\n if (rawAttributes) {\n try {\n const parsedAttributes = this._parseResourceAttributes(rawAttributes);\n Object.assign(attributes, parsedAttributes);\n } catch (e) {\n diag.debug(`EnvDetector failed: ${e.message}`);\n }\n }\n\n if (serviceName) {\n attributes[ATTR_SERVICE_NAME] = serviceName;\n }\n\n return { attributes };\n }\n\n /**\n * Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment\n * variable.\n *\n * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes describing\n * the source in more detail, e.g. “key1=val1,key2=val2”. Domain names and\n * paths are accepted as attribute keys. Values may be quoted or unquoted in\n * general. If a value contains whitespace, =, or \" characters, it must\n * always be quoted.\n *\n * @param rawEnvAttributes The resource attributes as a comma-separated list\n * of key/value pairs.\n * @returns The sanitized resource attributes.\n */\n private _parseResourceAttributes(rawEnvAttributes?: string): Attributes {\n if (!rawEnvAttributes) return {};\n\n const attributes: Attributes = {};\n const rawAttributes: string[] = rawEnvAttributes.split(\n this._COMMA_SEPARATOR,\n -1\n );\n for (const rawAttribute of rawAttributes) {\n const keyValuePair: string[] = rawAttribute.split(\n this._LABEL_KEY_VALUE_SPLITTER,\n -1\n );\n if (keyValuePair.length !== 2) {\n continue;\n }\n let [key, value] = keyValuePair;\n // Leading and trailing whitespaces are trimmed.\n key = key.trim();\n value = value.trim().split(/^\"|\"$/).join('');\n if (!this._isValidAndNotEmpty(key)) {\n throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);\n }\n if (!this._isValid(value)) {\n throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);\n }\n attributes[key] = decodeURIComponent(value);\n }\n return attributes;\n }\n\n /**\n * Determines whether the given String is a valid printable ASCII string with\n * a length not exceed _MAX_LENGTH characters.\n *\n * @param str The String to be validated.\n * @returns Whether the String is valid.\n */\n private _isValid(name: string): boolean {\n return name.length <= this._MAX_LENGTH && this._isBaggageOctetString(name);\n }\n\n // https://www.w3.org/TR/baggage/#definition\n private _isBaggageOctetString(str: string): boolean {\n for (let i = 0; i < str.length; i++) {\n const ch = str.charCodeAt(i);\n if (ch < 0x21 || ch === 0x2c || ch === 0x3b || ch === 0x5c || ch > 0x7e) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Determines whether the given String is a valid printable ASCII string with\n * a length greater than 0 and not exceed _MAX_LENGTH characters.\n *\n * @param str The String to be validated.\n * @returns Whether the String is valid and not empty.\n */\n private _isValidAndNotEmpty(str: string): boolean {\n return str.length > 0 && this._isValid(str);\n }\n}\n\nexport const envDetector = new EnvDetector();\n"]} | ||
| {"version":3,"file":"EnvDetector.js","sourceRoot":"","sources":["../../../src/detectors/EnvDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAc,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAGxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW;IACf,+EAA+E;IAC9D,WAAW,GAAG,GAAG,CAAC;IAEnC,oEAAoE;IACnD,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,oGAAoG,CACvG,CAAC;aACH;YAED,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,YAAY,CAAC;YACxC,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;YAC1B,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;YAE9B,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;gBACpB,MAAM,IAAI,KAAK,CACb,6DAA6D,YAAY,IAAI,CAC9E,CAAC;aACH;YAED,IAAI,UAAkB,CAAC;YACvB,IAAI,YAAoB,CAAC;YACzB,IAAI;gBACF,UAAU,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;gBACrC,YAAY,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;aAC1C;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,IAAI,KAAK,CACb,4DAA4D,YAAY,MAAM,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CACnH,CAAC;aACH;YAED,IAAI,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE;gBACxC,MAAM,IAAI,KAAK,CACb,+CAA+C,IAAI,CAAC,WAAW,iBAAiB,UAAU,IAAI,CAC/F,CAAC;aACH;YAED,IAAI,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE;gBAC1C,MAAM,IAAI,KAAK,CACb,iDAAiD,IAAI,CAAC,WAAW,wBAAwB,UAAU,IAAI,CACxG,CAAC;aACH;YAED,UAAU,CAAC,UAAU,CAAC,GAAG,YAAY,CAAC;SACvC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Attributes, diag } from '@opentelemetry/api';\nimport { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';\nimport { ResourceDetectionConfig } from '../config';\nimport { DetectedResource, ResourceDetector } from '../types';\nimport { getStringFromEnv } from '@opentelemetry/core';\n\n/**\n * EnvDetector can be used to detect the presence of and create a Resource\n * from the OTEL_RESOURCE_ATTRIBUTES environment variable.\n */\nclass EnvDetector implements ResourceDetector {\n // Type, attribute keys, and attribute values should not exceed 256 characters.\n private readonly _MAX_LENGTH = 255;\n\n // OTEL_RESOURCE_ATTRIBUTES is a comma-separated list of attributes.\n private readonly _COMMA_SEPARATOR = ',';\n\n // OTEL_RESOURCE_ATTRIBUTES contains key value pair separated by '='.\n private readonly _LABEL_KEY_VALUE_SPLITTER = '=';\n\n /**\n * Returns a {@link Resource} populated with attributes from the\n * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async\n * function to conform to the Detector interface.\n *\n * @param config The resource detection config\n */\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n const attributes: Attributes = {};\n\n const rawAttributes = getStringFromEnv('OTEL_RESOURCE_ATTRIBUTES');\n const serviceName = getStringFromEnv('OTEL_SERVICE_NAME');\n\n if (rawAttributes) {\n try {\n const parsedAttributes = this._parseResourceAttributes(rawAttributes);\n Object.assign(attributes, parsedAttributes);\n } catch (e) {\n diag.debug(`EnvDetector failed: ${e instanceof Error ? e.message : e}`);\n }\n }\n\n if (serviceName) {\n attributes[ATTR_SERVICE_NAME] = serviceName;\n }\n\n return { attributes };\n }\n\n /**\n * Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment\n * variable.\n *\n * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes in the\n * format \"key1=value1,key2=value2\". The ',' and '=' characters in keys\n * and values MUST be percent-encoded. Other characters MAY be percent-encoded.\n *\n * Per the spec, on any error (e.g., decoding failure), the entire environment\n * variable value is discarded.\n *\n * @param rawEnvAttributes The resource attributes as a comma-separated list\n * of key/value pairs.\n * @returns The parsed resource attributes.\n * @throws Error if parsing fails (caller handles by discarding all attributes)\n */\n private _parseResourceAttributes(rawEnvAttributes?: string): Attributes {\n if (!rawEnvAttributes) return {};\n\n const attributes: Attributes = {};\n const rawAttributes: string[] = rawEnvAttributes.split(\n this._COMMA_SEPARATOR\n );\n\n for (const rawAttribute of rawAttributes) {\n const keyValuePair: string[] = rawAttribute.split(\n this._LABEL_KEY_VALUE_SPLITTER\n );\n\n // Per spec: ',' and '=' MUST be percent-encoded in keys and values.\n // If we get != 2 parts, there's an unencoded '=' which is an error.\n if (keyValuePair.length !== 2) {\n throw new Error(\n `Invalid format for OTEL_RESOURCE_ATTRIBUTES: \"${rawAttribute}\". ` +\n `Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`\n );\n }\n\n const [rawKey, rawValue] = keyValuePair;\n const key = rawKey.trim();\n const value = rawValue.trim();\n\n if (key.length === 0) {\n throw new Error(\n `Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in \"${rawAttribute}\".`\n );\n }\n\n let decodedKey: string;\n let decodedValue: string;\n try {\n decodedKey = decodeURIComponent(key);\n decodedValue = decodeURIComponent(value);\n } catch (e) {\n throw new Error(\n `Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry \"${rawAttribute}\": ${e instanceof Error ? e.message : e}`\n );\n }\n\n if (decodedKey.length > this._MAX_LENGTH) {\n throw new Error(\n `Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: \"${decodedKey}\".`\n );\n }\n\n if (decodedValue.length > this._MAX_LENGTH) {\n throw new Error(\n `Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key \"${decodedKey}\".`\n );\n }\n\n attributes[decodedKey] = decodedValue;\n }\n\n return attributes;\n }\n}\n\nexport const envDetector = new EnvDetector();\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ export { envDetector } from './EnvDetector'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/detectors/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,YAAY,EACZ,UAAU,EACV,eAAe,EACf,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC","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\nexport { envDetector } from './EnvDetector';\nexport {\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './platform';\nexport { noopDetector } from './NoopDetector';\n"]} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/detectors/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,YAAY,EACZ,UAAU,EACV,eAAe,EACf,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { envDetector } from './EnvDetector';\nexport {\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './platform';\nexport { noopDetector } from './NoopDetector';\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ export class NoopDetector { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"NoopDetector.js","sourceRoot":"","sources":["../../../src/detectors/NoopDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,OAAO,YAAY;IACvB,MAAM;QACJ,OAAO;YACL,UAAU,EAAE,EAAE;SACf,CAAC;IACJ,CAAC;CACF;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC","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 { DetectedResource, ResourceDetector } from '../types';\n\nexport class NoopDetector implements ResourceDetector {\n detect(): DetectedResource {\n return {\n attributes: {},\n };\n }\n}\n\nexport const noopDetector = new NoopDetector();\n"]} | ||
| {"version":3,"file":"NoopDetector.js","sourceRoot":"","sources":["../../../src/detectors/NoopDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,OAAO,YAAY;IACvB,MAAM;QACJ,OAAO;YACL,UAAU,EAAE,EAAE;SACf,CAAC;IACJ,CAAC;CACF;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DetectedResource, ResourceDetector } from '../types';\n\nexport class NoopDetector implements ResourceDetector {\n detect(): DetectedResource {\n return {\n attributes: {},\n };\n }\n}\n\nexport const noopDetector = new NoopDetector();\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { noopDetector } from '../../NoopDetector'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"HostDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/HostDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CAAC","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 { noopDetector } from '../../NoopDetector';\n\nexport const hostDetector = noopDetector;\n"]} | ||
| {"version":3,"file":"HostDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/HostDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { noopDetector } from '../../NoopDetector';\n\nexport const hostDetector = noopDetector;\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ export { hostDetector } from './HostDetector'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC","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\nexport { hostDetector } from './HostDetector';\nexport { osDetector } from './OSDetector';\nexport { processDetector } from './ProcessDetector';\nexport { serviceInstanceIdDetector } from './ServiceInstanceIdDetector';\n"]} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { hostDetector } from './HostDetector';\nexport { osDetector } from './OSDetector';\nexport { processDetector } from './ProcessDetector';\nexport { serviceInstanceIdDetector } from './ServiceInstanceIdDetector';\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { noopDetector } from '../../NoopDetector'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"OSDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/OSDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC","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 { noopDetector } from '../../NoopDetector';\n\nexport const osDetector = noopDetector;\n"]} | ||
| {"version":3,"file":"OSDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/OSDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { noopDetector } from '../../NoopDetector';\n\nexport const osDetector = noopDetector;\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { noopDetector } from '../../NoopDetector'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ProcessDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/ProcessDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC","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 { noopDetector } from '../../NoopDetector';\n\nexport const processDetector = noopDetector;\n"]} | ||
| {"version":3,"file":"ProcessDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/ProcessDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { noopDetector } from '../../NoopDetector';\n\nexport const processDetector = noopDetector;\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { noopDetector } from '../../NoopDetector'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ServiceInstanceIdDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/ServiceInstanceIdDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,YAAY,CAAC","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 { noopDetector } from '../../NoopDetector';\n\n/**\n * @experimental\n */\nexport const serviceInstanceIdDetector = noopDetector;\n"]} | ||
| {"version":3,"file":"ServiceInstanceIdDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/ServiceInstanceIdDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,YAAY,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { noopDetector } from '../../NoopDetector';\n\n/**\n * @experimental\n */\nexport const serviceInstanceIdDetector = noopDetector;\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| export { hostDetector, osDetector, processDetector, serviceInstanceIdDetector, } from './node'; | ||
| //# sourceMappingURL=index.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/detectors/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,YAAY,EACZ,UAAU,EACV,eAAe,EACf,yBAAyB,GAC1B,MAAM,QAAQ,CAAC","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 */\nexport {\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './node';\n"]} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/detectors/platform/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,YAAY,EACZ,UAAU,EACV,eAAe,EACf,yBAAyB,GAC1B,MAAM,QAAQ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport {\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './node';\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { ATTR_HOST_ARCH, ATTR_HOST_ID, ATTR_HOST_NAME } from '../../../semconv'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"HostDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/HostDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAOpC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC;;;GAGG;AACH,MAAM,YAAY;IAChB,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAA+B;YAC7C,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE;YAC5B,CAAC,cAAc,CAAC,EAAE,aAAa,CAAC,IAAI,EAAE,CAAC;YACvC,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE;SAC/B,CAAC;QAEF,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC","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 { ATTR_HOST_ARCH, ATTR_HOST_ID, ATTR_HOST_NAME } from '../../../semconv';\nimport { arch, hostname } from 'os';\nimport { ResourceDetectionConfig } from '../../../config';\nimport {\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"]} | ||
| {"version":3,"file":"HostDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/HostDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAOpC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC;;;GAGG;AACH,MAAM,YAAY;IAChB,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAA+B;YAC7C,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE;YAC5B,CAAC,cAAc,CAAC,EAAE,aAAa,CAAC,IAAI,EAAE,CAAC;YACvC,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE;SAC/B,CAAC;QAEF,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,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 { ResourceDetectionConfig } from '../../../config';\nimport {\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"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ export { hostDetector } from './HostDetector'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC","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\nexport { hostDetector } from './HostDetector';\nexport { osDetector } from './OSDetector';\nexport { processDetector } from './ProcessDetector';\nexport { serviceInstanceIdDetector } from './ServiceInstanceIdDetector';\n"]} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { hostDetector } from './HostDetector';\nexport { osDetector } from './OSDetector';\nexport { processDetector } from './ProcessDetector';\nexport { serviceInstanceIdDetector } from './ServiceInstanceIdDetector';\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import * as child_process from 'child_process'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"execAsync.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/execAsync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,aAAa,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC","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 * as child_process from 'child_process';\nimport * as util from 'util';\n\nexport const execAsync = util.promisify(child_process.exec);\n"]} | ||
| {"version":3,"file":"execAsync.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/execAsync.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,aAAa,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport * as child_process from 'child_process';\nimport * as util from 'util';\n\nexport const execAsync = util.promisify(child_process.exec);\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { promises as fs } from 'fs'; |
@@ -1,1 +0,1 @@ | ||
| {"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,CAAC,KAAK,UAAU,YAAY;IAChC,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QACtE,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;KACtB;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,4BAA4B,CAAC,CAAC;QAC7D,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;KAC7B;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","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<string | undefined> {\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 undefined;\n}\n"]} | ||
| {"version":3,"file":"getMachineId-bsd.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-bsd.ts"],"names":[],"mappings":"AAAA;;;GAGG;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,CAAC,KAAK,UAAU,YAAY;IAChC,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QACtE,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;KACtB;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,4BAA4B,CAAC,CAAC;QAC7D,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;KAC7B;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { promises as fs } from 'fs';\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\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 undefined;\n}\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { execAsync } from './execAsync'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"getMachineId-darwin.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-darwin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,wCAAwC,CAAC,CAAC;QAEzE,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM;aACzB,KAAK,CAAC,IAAI,CAAC;aACX,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAEjD,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,SAAS,CAAC;SAClB;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;SAC9B;KACF;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","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 { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n try {\n const result = await execAsync('ioreg -rd1 -c \"IOPlatformExpertDevice\"');\n\n const idLine = result.stdout\n .split('\\n')\n .find(line => line.includes('IOPlatformUUID'));\n\n if (!idLine) {\n return undefined;\n }\n\n const parts = idLine.split('\" = \"');\n if (parts.length === 2) {\n return parts[1].slice(0, -1);\n }\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return undefined;\n}\n"]} | ||
| {"version":3,"file":"getMachineId-darwin.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-darwin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,wCAAwC,CAAC,CAAC;QAEzE,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM;aACzB,KAAK,CAAC,IAAI,CAAC;aACX,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAEjD,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,SAAS,CAAC;SAClB;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;SAC9B;KACF;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n try {\n const result = await execAsync('ioreg -rd1 -c \"IOPlatformExpertDevice\"');\n\n const idLine = result.stdout\n .split('\\n')\n .find(line => line.includes('IOPlatformUUID'));\n\n if (!idLine) {\n return undefined;\n }\n\n const parts = idLine.split('\" = \"');\n if (parts.length === 2) {\n return parts[1].slice(0, -1);\n }\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return undefined;\n}\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { promises as fs } from 'fs'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"getMachineId-linux.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-linux.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,KAAK,GAAG,CAAC,iBAAiB,EAAE,0BAA0B,CAAC,CAAC;IAE9D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;YAC7D,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;SACtB;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;SAC9C;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","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 */\nimport { promises as fs } from 'fs';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n const paths = ['/etc/machine-id', '/var/lib/dbus/machine-id'];\n\n for (const path of paths) {\n try {\n const result = await fs.readFile(path, { encoding: 'utf8' });\n return result.trim();\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n }\n\n return undefined;\n}\n"]} | ||
| {"version":3,"file":"getMachineId-linux.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-linux.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,KAAK,GAAG,CAAC,iBAAiB,EAAE,0BAA0B,CAAC,CAAC;IAE9D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;YAC7D,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;SACtB;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;SAC9C;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { promises as fs } from 'fs';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n const paths = ['/etc/machine-id', '/var/lib/dbus/machine-id'];\n\n for (const path of paths) {\n try {\n const result = await fs.readFile(path, { encoding: 'utf8' });\n return result.trim();\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n }\n\n return undefined;\n}\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { diag } from '@opentelemetry/api'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"getMachineId-unsupported.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-unsupported.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,IAAI,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;IAC9D,OAAO,SAAS,CAAC;AACnB,CAAC","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 { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n diag.debug('could not read machine-id: unsupported platform');\n return undefined;\n}\n"]} | ||
| {"version":3,"file":"getMachineId-unsupported.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-unsupported.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,IAAI,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;IAC9D,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n diag.debug('could not read machine-id: unsupported platform');\n return undefined;\n}\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import * as process from 'process'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"getMachineId-win.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-win.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,IAAI,GACR,4EAA4E,CAAC;IAC/E,IAAI,OAAO,GAAG,6BAA6B,CAAC;IAC5C,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,IAAI,wBAAwB,IAAI,OAAO,CAAC,GAAG,EAAE;QACtE,OAAO,GAAG,kCAAkC,GAAG,OAAO,CAAC;KACxD;IAED,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,GAAG,OAAO,IAAI,IAAI,EAAE,CAAC,CAAC;QACrD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACxB;KACF;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","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 * as process from 'process';\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n const args =\n 'QUERY HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Cryptography /v MachineGuid';\n let command = '%windir%\\\\System32\\\\REG.exe';\n if (process.arch === 'ia32' && 'PROCESSOR_ARCHITEW6432' in process.env) {\n command = '%windir%\\\\sysnative\\\\cmd.exe /c ' + command;\n }\n\n try {\n const result = await execAsync(`${command} ${args}`);\n const parts = result.stdout.split('REG_SZ');\n if (parts.length === 2) {\n return parts[1].trim();\n }\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return undefined;\n}\n"]} | ||
| {"version":3,"file":"getMachineId-win.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-win.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,IAAI,GACR,4EAA4E,CAAC;IAC/E,IAAI,OAAO,GAAG,6BAA6B,CAAC;IAC5C,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,IAAI,wBAAwB,IAAI,OAAO,CAAC,GAAG,EAAE;QACtE,OAAO,GAAG,kCAAkC,GAAG,OAAO,CAAC;KACxD;IAED,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,GAAG,OAAO,IAAI,IAAI,EAAE,CAAC,CAAC;QACrD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACxB;KACF;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport * as process from 'process';\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n const args =\n 'QUERY HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Cryptography /v MachineGuid';\n let command = '%windir%\\\\System32\\\\REG.exe';\n if (process.arch === 'ia32' && 'PROCESSOR_ARCHITEW6432' in process.env) {\n command = '%windir%\\\\sysnative\\\\cmd.exe /c ' + command;\n }\n\n try {\n const result = await execAsync(`${command} ${args}`);\n const parts = result.stdout.split('REG_SZ');\n if (parts.length === 2) {\n return parts[1].trim();\n }\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return undefined;\n}\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import * as process from 'process'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"getMachineId.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,IAAI,gBAAiE,CAAC;AAEtE,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,IAAI,CAAC,gBAAgB,EAAE;QACrB,QAAQ,OAAO,CAAC,QAAQ,EAAE;YACxB,KAAK,QAAQ;gBACX,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC;qBAC1D,YAAY,CAAC;gBAChB,MAAM;YACR,KAAK,OAAO;gBACV,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;qBACzD,YAAY,CAAC;gBAChB,MAAM;YACR,KAAK,SAAS;gBACZ,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,YAAY,CAAC;gBACxE,MAAM;YACR,KAAK,OAAO;gBACV,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,YAAY,CAAC;gBACxE,MAAM;YACR;gBACE,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,+BAA+B,CAAC,CAAC;qBAC/D,YAAY,CAAC;gBAChB,MAAM;SACT;KACF;IAED,OAAO,gBAAgB,EAAE,CAAC;AAC5B,CAAC","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 */\nimport * as process from 'process';\n\nlet getMachineIdImpl: undefined | (() => Promise<string | undefined>);\n\nexport async function getMachineId(): Promise<string | undefined> {\n if (!getMachineIdImpl) {\n switch (process.platform) {\n case 'darwin':\n getMachineIdImpl = (await import('./getMachineId-darwin.js'))\n .getMachineId;\n break;\n case 'linux':\n getMachineIdImpl = (await import('./getMachineId-linux.js'))\n .getMachineId;\n break;\n case 'freebsd':\n getMachineIdImpl = (await import('./getMachineId-bsd.js')).getMachineId;\n break;\n case 'win32':\n getMachineIdImpl = (await import('./getMachineId-win.js')).getMachineId;\n break;\n default:\n getMachineIdImpl = (await import('./getMachineId-unsupported.js'))\n .getMachineId;\n break;\n }\n }\n\n return getMachineIdImpl();\n}\n"]} | ||
| {"version":3,"file":"getMachineId.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,IAAI,gBAAiE,CAAC;AAEtE,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,IAAI,CAAC,gBAAgB,EAAE;QACrB,QAAQ,OAAO,CAAC,QAAQ,EAAE;YACxB,KAAK,QAAQ;gBACX,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC;qBAC1D,YAAY,CAAC;gBAChB,MAAM;YACR,KAAK,OAAO;gBACV,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;qBACzD,YAAY,CAAC;gBAChB,MAAM;YACR,KAAK,SAAS;gBACZ,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,YAAY,CAAC;gBACxE,MAAM;YACR,KAAK,OAAO;gBACV,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,YAAY,CAAC;gBACxE,MAAM;YACR;gBACE,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,+BAA+B,CAAC,CAAC;qBAC/D,YAAY,CAAC;gBAChB,MAAM;SACT;KACF;IAED,OAAO,gBAAgB,EAAE,CAAC;AAC5B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport * as process from 'process';\n\nlet getMachineIdImpl: undefined | (() => Promise<string | undefined>);\n\nexport async function getMachineId(): Promise<string | undefined> {\n if (!getMachineIdImpl) {\n switch (process.platform) {\n case 'darwin':\n getMachineIdImpl = (await import('./getMachineId-darwin.js'))\n .getMachineId;\n break;\n case 'linux':\n getMachineIdImpl = (await import('./getMachineId-linux.js'))\n .getMachineId;\n break;\n case 'freebsd':\n getMachineIdImpl = (await import('./getMachineId-bsd.js')).getMachineId;\n break;\n case 'win32':\n getMachineIdImpl = (await import('./getMachineId-win.js')).getMachineId;\n break;\n default:\n getMachineIdImpl = (await import('./getMachineId-unsupported.js'))\n .getMachineId;\n break;\n }\n }\n\n return getMachineIdImpl();\n}\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { ATTR_OS_TYPE, ATTR_OS_VERSION } from '../../../semconv'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"OSDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/OSDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAGvC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC;;;GAGG;AACH,MAAM,UAAU;IACd,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAe;YAC7B,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC;YACzC,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE;SAC7B,CAAC;QACF,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC","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 { Attributes } from '@opentelemetry/api';\nimport { ATTR_OS_TYPE, ATTR_OS_VERSION } from '../../../semconv';\nimport { platform, release } from 'os';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { DetectedResource, ResourceDetector } from '../../../types';\nimport { normalizeType } from './utils';\n\n/**\n * OSDetector detects the resources related to the operating system (OS) on\n * which the process represented by this resource is running.\n */\nclass OSDetector implements ResourceDetector {\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n const attributes: Attributes = {\n [ATTR_OS_TYPE]: normalizeType(platform()),\n [ATTR_OS_VERSION]: release(),\n };\n return { attributes };\n }\n}\n\nexport const osDetector = new OSDetector();\n"]} | ||
| {"version":3,"file":"OSDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/OSDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAGvC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC;;;GAGG;AACH,MAAM,UAAU;IACd,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAe;YAC7B,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC;YACzC,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE;SAC7B,CAAC;QACF,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Attributes } from '@opentelemetry/api';\nimport { ATTR_OS_TYPE, ATTR_OS_VERSION } from '../../../semconv';\nimport { platform, release } from 'os';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { DetectedResource, ResourceDetector } from '../../../types';\nimport { normalizeType } from './utils';\n\n/**\n * OSDetector detects the resources related to the operating system (OS) on\n * which the process represented by this resource is running.\n */\nclass OSDetector implements ResourceDetector {\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n const attributes: Attributes = {\n [ATTR_OS_TYPE]: normalizeType(platform()),\n [ATTR_OS_VERSION]: release(),\n };\n return { attributes };\n }\n}\n\nexport const osDetector = new OSDetector();\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { diag } from '@opentelemetry/api'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ProcessDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/ProcessDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAc,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,4BAA4B,EAC5B,4BAA4B,EAC5B,kBAAkB,EAClB,gBAAgB,EAChB,gCAAgC,EAChC,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAIzB;;;GAGG;AACH,MAAM,eAAe;IACnB,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAe;YAC7B,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,GAAG;YAC/B,CAAC,4BAA4B,CAAC,EAAE,OAAO,CAAC,KAAK;YAC7C,CAAC,4BAA4B,CAAC,EAAE,OAAO,CAAC,QAAQ;YAChD,CAAC,yBAAyB,CAAC,EAAE;gBAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;gBACf,GAAG,OAAO,CAAC,QAAQ;gBACnB,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;aACzB;YACD,CAAC,4BAA4B,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;YACrD,CAAC,yBAAyB,CAAC,EAAE,QAAQ;YACrC,CAAC,gCAAgC,CAAC,EAAE,SAAS;SAC9C,CAAC;QAEF,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3B,UAAU,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACpD;QAED,IAAI;YACF,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;YAC/B,UAAU,CAAC,kBAAkB,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC;SACpD;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,KAAK,CAAC,kCAAkC,CAAC,EAAE,CAAC,CAAC;SACnD;QAED,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC","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 { Attributes, diag } from '@opentelemetry/api';\nimport {\n ATTR_PROCESS_COMMAND,\n ATTR_PROCESS_COMMAND_ARGS,\n ATTR_PROCESS_EXECUTABLE_NAME,\n ATTR_PROCESS_EXECUTABLE_PATH,\n ATTR_PROCESS_OWNER,\n ATTR_PROCESS_PID,\n ATTR_PROCESS_RUNTIME_DESCRIPTION,\n ATTR_PROCESS_RUNTIME_NAME,\n ATTR_PROCESS_RUNTIME_VERSION,\n} from '../../../semconv';\nimport * as os from 'os';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { DetectedResource, ResourceDetector } from '../../../types';\n\n/**\n * ProcessDetector will be used to detect the resources related current process running\n * and being instrumented from the NodeJS Process module.\n */\nclass ProcessDetector implements ResourceDetector {\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n const attributes: Attributes = {\n [ATTR_PROCESS_PID]: process.pid,\n [ATTR_PROCESS_EXECUTABLE_NAME]: process.title,\n [ATTR_PROCESS_EXECUTABLE_PATH]: process.execPath,\n [ATTR_PROCESS_COMMAND_ARGS]: [\n process.argv[0],\n ...process.execArgv,\n ...process.argv.slice(1),\n ],\n [ATTR_PROCESS_RUNTIME_VERSION]: process.versions.node,\n [ATTR_PROCESS_RUNTIME_NAME]: 'nodejs',\n [ATTR_PROCESS_RUNTIME_DESCRIPTION]: 'Node.js',\n };\n\n if (process.argv.length > 1) {\n attributes[ATTR_PROCESS_COMMAND] = process.argv[1];\n }\n\n try {\n const userInfo = os.userInfo();\n attributes[ATTR_PROCESS_OWNER] = userInfo.username;\n } catch (e) {\n diag.debug(`error obtaining process owner: ${e}`);\n }\n\n return { attributes };\n }\n}\n\nexport const processDetector = new ProcessDetector();\n"]} | ||
| {"version":3,"file":"ProcessDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/ProcessDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAc,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,4BAA4B,EAC5B,4BAA4B,EAC5B,kBAAkB,EAClB,gBAAgB,EAChB,gCAAgC,EAChC,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAIzB;;;GAGG;AACH,MAAM,eAAe;IACnB,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAe;YAC7B,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,GAAG;YAC/B,CAAC,4BAA4B,CAAC,EAAE,OAAO,CAAC,KAAK;YAC7C,CAAC,4BAA4B,CAAC,EAAE,OAAO,CAAC,QAAQ;YAChD,CAAC,yBAAyB,CAAC,EAAE;gBAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;gBACf,GAAG,OAAO,CAAC,QAAQ;gBACnB,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;aACzB;YACD,CAAC,4BAA4B,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;YACrD,CAAC,yBAAyB,CAAC,EAAE,QAAQ;YACrC,CAAC,gCAAgC,CAAC,EAAE,SAAS;SAC9C,CAAC;QAEF,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3B,UAAU,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACpD;QAED,IAAI;YACF,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;YAC/B,UAAU,CAAC,kBAAkB,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC;SACpD;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,KAAK,CAAC,kCAAkC,CAAC,EAAE,CAAC,CAAC;SACnD;QAED,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Attributes, diag } from '@opentelemetry/api';\nimport {\n ATTR_PROCESS_COMMAND,\n ATTR_PROCESS_COMMAND_ARGS,\n ATTR_PROCESS_EXECUTABLE_NAME,\n ATTR_PROCESS_EXECUTABLE_PATH,\n ATTR_PROCESS_OWNER,\n ATTR_PROCESS_PID,\n ATTR_PROCESS_RUNTIME_DESCRIPTION,\n ATTR_PROCESS_RUNTIME_NAME,\n ATTR_PROCESS_RUNTIME_VERSION,\n} from '../../../semconv';\nimport * as os from 'os';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { DetectedResource, ResourceDetector } from '../../../types';\n\n/**\n * ProcessDetector will be used to detect the resources related current process running\n * and being instrumented from the NodeJS Process module.\n */\nclass ProcessDetector implements ResourceDetector {\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n const attributes: Attributes = {\n [ATTR_PROCESS_PID]: process.pid,\n [ATTR_PROCESS_EXECUTABLE_NAME]: process.title,\n [ATTR_PROCESS_EXECUTABLE_PATH]: process.execPath,\n [ATTR_PROCESS_COMMAND_ARGS]: [\n process.argv[0],\n ...process.execArgv,\n ...process.argv.slice(1),\n ],\n [ATTR_PROCESS_RUNTIME_VERSION]: process.versions.node,\n [ATTR_PROCESS_RUNTIME_NAME]: 'nodejs',\n [ATTR_PROCESS_RUNTIME_DESCRIPTION]: 'Node.js',\n };\n\n if (process.argv.length > 1) {\n attributes[ATTR_PROCESS_COMMAND] = process.argv[1];\n }\n\n try {\n const userInfo = os.userInfo();\n attributes[ATTR_PROCESS_OWNER] = userInfo.username;\n } catch (e) {\n diag.debug(`error obtaining process owner: ${e}`);\n }\n\n return { attributes };\n }\n}\n\nexport const processDetector = new ProcessDetector();\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { ATTR_SERVICE_INSTANCE_ID } from '../../../semconv'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ServiceInstanceIdDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/ServiceInstanceIdDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAIpC;;GAEG;AACH,MAAM,yBAAyB;IAC7B,MAAM,CAAC,OAAiC;QACtC,OAAO;YACL,UAAU,EAAE;gBACV,CAAC,wBAAwB,CAAC,EAAE,UAAU,EAAE;aACzC;SACF,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,yBAAyB,EAAE,CAAC","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 { ATTR_SERVICE_INSTANCE_ID } from '../../../semconv';\nimport { randomUUID } from 'crypto';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { DetectedResource, ResourceDetector } from '../../../types';\n\n/**\n * ServiceInstanceIdDetector detects the resources related to the service instance ID.\n */\nclass ServiceInstanceIdDetector implements ResourceDetector {\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n return {\n attributes: {\n [ATTR_SERVICE_INSTANCE_ID]: randomUUID(),\n },\n };\n }\n}\n\n/**\n * @experimental\n */\nexport const serviceInstanceIdDetector = new ServiceInstanceIdDetector();\n"]} | ||
| {"version":3,"file":"ServiceInstanceIdDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/ServiceInstanceIdDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAIpC;;GAEG;AACH,MAAM,yBAAyB;IAC7B,MAAM,CAAC,OAAiC;QACtC,OAAO;YACL,UAAU,EAAE;gBACV,CAAC,wBAAwB,CAAC,EAAE,UAAU,EAAE;aACzC;SACF,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,yBAAyB,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ATTR_SERVICE_INSTANCE_ID } from '../../../semconv';\nimport { randomUUID } from 'crypto';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { DetectedResource, ResourceDetector } from '../../../types';\n\n/**\n * ServiceInstanceIdDetector detects the resources related to the service instance ID.\n */\nclass ServiceInstanceIdDetector implements ResourceDetector {\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n return {\n attributes: {\n [ATTR_SERVICE_INSTANCE_ID]: randomUUID(),\n },\n };\n }\n}\n\n/**\n * @experimental\n */\nexport const serviceInstanceIdDetector = new ServiceInstanceIdDetector();\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ export const normalizeArch = (nodeArchString) => { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,cAAsB,EAAU,EAAE;IAC9D,0EAA0E;IAC1E,8HAA8H;IAC9H,QAAQ,cAAc,EAAE;QACtB,KAAK,KAAK;YACR,OAAO,OAAO,CAAC;QACjB,KAAK,KAAK;YACR,OAAO,OAAO,CAAC;QACjB,KAAK,KAAK;YACR,OAAO,OAAO,CAAC;QACjB;YACE,OAAO,cAAc,CAAC;KACzB;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,YAAoB,EAAU,EAAE;IAC5D,8EAA8E;IAC9E,4HAA4H;IAC5H,QAAQ,YAAY,EAAE;QACpB,KAAK,OAAO;YACV,OAAO,SAAS,CAAC;QACnB,KAAK,OAAO;YACV,OAAO,SAAS,CAAC;QACnB;YACE,OAAO,YAAY,CAAC;KACvB;AACH,CAAC,CAAC","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 */\nexport const normalizeArch = (nodeArchString: string): string => {\n // Maps from https://nodejs.org/api/os.html#osarch to arch values in spec:\n // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/host.md\n switch (nodeArchString) {\n case 'arm':\n return 'arm32';\n case 'ppc':\n return 'ppc32';\n case 'x64':\n return 'amd64';\n default:\n return nodeArchString;\n }\n};\n\nexport const normalizeType = (nodePlatform: string): string => {\n // Maps from https://nodejs.org/api/os.html#osplatform to arch values in spec:\n // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/os.md\n switch (nodePlatform) {\n case 'sunos':\n return 'solaris';\n case 'win32':\n return 'windows';\n default:\n return nodePlatform;\n }\n};\n"]} | ||
| {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,cAAsB,EAAU,EAAE;IAC9D,0EAA0E;IAC1E,8HAA8H;IAC9H,QAAQ,cAAc,EAAE;QACtB,KAAK,KAAK;YACR,OAAO,OAAO,CAAC;QACjB,KAAK,KAAK;YACR,OAAO,OAAO,CAAC;QACjB,KAAK,KAAK;YACR,OAAO,OAAO,CAAC;QACjB;YACE,OAAO,cAAc,CAAC;KACzB;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,YAAoB,EAAU,EAAE;IAC5D,8EAA8E;IAC9E,4HAA4H;IAC5H,QAAQ,YAAY,EAAE;QACpB,KAAK,OAAO;YACV,OAAO,SAAS,CAAC;QACnB,KAAK,OAAO;YACV,OAAO,SAAS,CAAC;QACnB;YACE,OAAO,YAAY,CAAC;KACvB;AACH,CAAC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport const normalizeArch = (nodeArchString: string): string => {\n // Maps from https://nodejs.org/api/os.html#osarch to arch values in spec:\n // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/host.md\n switch (nodeArchString) {\n case 'arm':\n return 'arm32';\n case 'ppc':\n return 'ppc32';\n case 'x64':\n return 'amd64';\n default:\n return nodeArchString;\n }\n};\n\nexport const normalizeType = (nodePlatform: string): string => {\n // Maps from https://nodejs.org/api/os.html#osplatform to arch values in spec:\n // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/os.md\n switch (nodePlatform) {\n case 'sunos':\n return 'solaris';\n case 'win32':\n return 'windows';\n default:\n return nodePlatform;\n }\n};\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ export { detectResources } from './detect-resources'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,eAAe,EACf,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC","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\nexport type { ResourceDetectionConfig } from './config';\nexport { detectResources } from './detect-resources';\nexport {\n envDetector,\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './detectors';\nexport type { Resource } from './Resource';\nexport {\n resourceFromAttributes,\n defaultResource,\n emptyResource,\n} from './ResourceImpl';\nexport { defaultServiceName } from './default-service-name';\nexport type {\n ResourceDetector,\n DetectedResource,\n DetectedResourceAttributes,\n RawResourceAttribute,\n MaybePromise,\n} from './types';\n"]} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,eAAe,EACf,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport type { ResourceDetectionConfig } from './config';\nexport { detectResources } from './detect-resources';\nexport {\n envDetector,\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './detectors';\nexport type { Resource } from './Resource';\nexport {\n resourceFromAttributes,\n defaultResource,\n emptyResource,\n} from './ResourceImpl';\nexport { defaultServiceName } from './default-service-name';\nexport type {\n ResourceDetector,\n DetectedResource,\n DetectedResourceAttributes,\n RawResourceAttribute,\n MaybePromise,\n} from './types';\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| export {}; | ||
| //# sourceMappingURL=Resource.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"Resource.js","sourceRoot":"","sources":["../../src/Resource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","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 { Attributes } from '@opentelemetry/api';\nimport { RawResourceAttribute } from './types';\n\n/**\n * An interface that represents a resource. A Resource describes the entity for which signals (metrics or trace) are\n * collected.\n *\n * This interface is NOT user-implementable. Valid ways to obtain a {@link Resource} are by using either of these functions\n * - {@link resourceFromAttributes}\n * - {@link emptyResource}\n * - {@link defaultResource}\n * - {@link detectResources}\n */\nexport interface Resource {\n /**\n * Check if async attributes have resolved. This is useful to avoid awaiting\n * waitForAsyncAttributes (which will introduce asynchronous behavior) when not necessary.\n *\n * @returns true if the resource \"attributes\" property is not yet settled to its final value\n */\n readonly asyncAttributesPending?: boolean;\n\n /**\n * @returns the Resource's attributes.\n */\n readonly attributes: Attributes;\n\n /**\n * @returns the Resource's schema URL or undefined if not set.\n */\n readonly schemaUrl?: string;\n\n /**\n * Returns a promise that will never be rejected. Resolves when all async attributes have finished being added to\n * this Resource's attributes. This is useful in exporters to block until resource detection\n * has finished.\n */\n waitForAsyncAttributes?(): Promise<void>;\n\n /**\n * Returns a new, merged {@link Resource} by merging the current Resource\n * with the other Resource. In case of a collision, other Resource takes\n * precedence.\n *\n * @param other the Resource that will be merged with this.\n * @returns the newly merged Resource.\n */\n merge(other: Resource | null): Resource;\n\n getRawAttributes(): RawResourceAttribute[];\n}\n"]} | ||
| {"version":3,"file":"Resource.js","sourceRoot":"","sources":["../../src/Resource.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Attributes } from '@opentelemetry/api';\nimport { RawResourceAttribute } from './types';\n\n/**\n * An interface that represents a resource. A Resource describes the entity for which signals (metrics or trace) are\n * collected.\n *\n * This interface is NOT user-implementable. Valid ways to obtain a {@link Resource} are by using either of these functions\n * - {@link resourceFromAttributes}\n * - {@link emptyResource}\n * - {@link defaultResource}\n * - {@link detectResources}\n */\nexport interface Resource {\n /**\n * Check if async attributes have resolved. This is useful to avoid awaiting\n * waitForAsyncAttributes (which will introduce asynchronous behavior) when not necessary.\n *\n * @returns true if the resource \"attributes\" property is not yet settled to its final value\n */\n readonly asyncAttributesPending?: boolean;\n\n /**\n * @returns the Resource's attributes.\n */\n readonly attributes: Attributes;\n\n /**\n * @returns the Resource's schema URL or undefined if not set.\n */\n readonly schemaUrl?: string;\n\n /**\n * Returns a promise that will never be rejected. Resolves when all async attributes have finished being added to\n * this Resource's attributes. This is useful in exporters to block until resource detection\n * has finished.\n */\n waitForAsyncAttributes?(): Promise<void>;\n\n /**\n * Returns a new, merged {@link Resource} by merging the current Resource\n * with the other Resource. In case of a collision, other Resource takes\n * precedence.\n *\n * @param other the Resource that will be merged with this.\n * @returns the newly merged Resource.\n */\n merge(other: Resource | null): Resource;\n\n getRawAttributes(): RawResourceAttribute[];\n}\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ import { diag } from '@opentelemetry/api'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ResourceImpl.js","sourceRoot":"","sources":["../../src/ResourceImpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAA8B,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAQ5D,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,YAAY;IACR,cAAc,CAAyB;IACvC,uBAAuB,GAAG,KAAK,CAAC;IAChC,UAAU,CAAU;IAEpB,mBAAmB,CAAc;IAEzC,MAAM,CAAC,iBAAiB,CACtB,UAAgE,EAChE,OAAyB;QAEzB,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAC1C,GAAG,CAAC,cAAc,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;QACtD,GAAG,CAAC,uBAAuB;YACzB,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE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,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,SAAS,EAAE;QAC5D,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,CAAC,IAAI,CACP,6EAA6E,EAC7E,SAAS,CACV,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,cAAc,CACrB,GAAa,EACb,QAAyB;IAEzB,MAAM,YAAY,GAAG,GAAG,EAAE,SAAS,CAAC;IACpC,MAAM,iBAAiB,GAAG,QAAQ,EAAE,SAAS,CAAC;IAE9C,MAAM,UAAU,GAAG,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,EAAE,CAAC;IACrE,MAAM,eAAe,GACnB,iBAAiB,KAAK,SAAS,IAAI,iBAAiB,KAAK,EAAE,CAAC;IAE9D,IAAI,UAAU,EAAE;QACd,OAAO,iBAAiB,CAAC;KAC1B;IAED,IAAI,eAAe,EAAE;QACnB,OAAO,YAAY,CAAC;KACrB;IAED,IAAI,YAAY,KAAK,iBAAiB,EAAE;QACtC,OAAO,YAAY,CAAC;KACrB;IAED,IAAI,CAAC,IAAI,CACP,kIAAkI,EAClI,YAAY,EACZ,iBAAiB,CAClB,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC","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 { Attributes, AttributeValue, diag } from '@opentelemetry/api';\nimport { SDK_INFO } from '@opentelemetry/core';\nimport {\n ATTR_SERVICE_NAME,\n ATTR_TELEMETRY_SDK_LANGUAGE,\n ATTR_TELEMETRY_SDK_NAME,\n ATTR_TELEMETRY_SDK_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { Resource } from './Resource';\nimport { defaultServiceName } from './default-service-name';\nimport {\n DetectedResource,\n DetectedResourceAttributes,\n MaybePromise,\n RawResourceAttribute,\n ResourceOptions,\n} from './types';\nimport { isPromiseLike } from './utils';\n\nclass ResourceImpl implements Resource {\n private _rawAttributes: RawResourceAttribute[];\n private _asyncAttributesPending = false;\n private _schemaUrl?: string;\n\n private _memoizedAttributes?: Attributes;\n\n static FromAttributeList(\n attributes: [string, MaybePromise<AttributeValue | undefined>][],\n options?: ResourceOptions\n ): Resource {\n const res = new ResourceImpl({}, options);\n res._rawAttributes = guardedRawAttributes(attributes);\n res._asyncAttributesPending =\n attributes.filter(([_, val]) => isPromiseLike(val)).length > 0;\n return res;\n }\n\n constructor(\n /**\n * A dictionary of attributes with string keys and values that provide\n * information about the entity as numbers, strings or booleans\n * TODO: Consider to add check/validation on attributes.\n */\n resource: DetectedResource,\n options?: ResourceOptions\n ) {\n const attributes = resource.attributes ?? {};\n this._rawAttributes = Object.entries(attributes).map(([k, v]) => {\n if (isPromiseLike(v)) {\n // side-effect\n this._asyncAttributesPending = true;\n }\n\n return [k, v];\n });\n\n this._rawAttributes = guardedRawAttributes(this._rawAttributes);\n this._schemaUrl = validateSchemaUrl(options?.schemaUrl);\n }\n\n public get asyncAttributesPending(): boolean {\n return this._asyncAttributesPending;\n }\n\n public async waitForAsyncAttributes(): Promise<void> {\n if (!this.asyncAttributesPending) {\n return;\n }\n\n for (let i = 0; i < this._rawAttributes.length; i++) {\n const [k, v] = this._rawAttributes[i];\n this._rawAttributes[i] = [k, isPromiseLike(v) ? await v : v];\n }\n\n this._asyncAttributesPending = false;\n }\n\n public get attributes(): Attributes {\n if (this.asyncAttributesPending) {\n diag.error(\n 'Accessing resource attributes before async attributes settled'\n );\n }\n\n if (this._memoizedAttributes) {\n return this._memoizedAttributes;\n }\n\n const attrs: Attributes = {};\n for (const [k, v] of this._rawAttributes) {\n if (isPromiseLike(v)) {\n diag.debug(`Unsettled resource attribute ${k} skipped`);\n continue;\n }\n if (v != null) {\n attrs[k] ??= v;\n }\n }\n\n // only memoize output if all attributes are settled\n if (!this._asyncAttributesPending) {\n this._memoizedAttributes = attrs;\n }\n\n return attrs;\n }\n\n public getRawAttributes(): RawResourceAttribute[] {\n return this._rawAttributes;\n }\n\n public get schemaUrl(): string | undefined {\n return this._schemaUrl;\n }\n\n public merge(resource: Resource | null): Resource {\n if (resource == null) return this;\n\n // Order is important\n // Spec states incoming attributes override existing attributes\n const mergedSchemaUrl = mergeSchemaUrl(this, resource);\n const mergedOptions: ResourceOptions | undefined = mergedSchemaUrl\n ? { schemaUrl: mergedSchemaUrl }\n : undefined;\n\n return ResourceImpl.FromAttributeList(\n [...resource.getRawAttributes(), ...this.getRawAttributes()],\n mergedOptions\n );\n }\n}\n\nexport function resourceFromAttributes(\n attributes: DetectedResourceAttributes,\n options?: ResourceOptions\n): Resource {\n return ResourceImpl.FromAttributeList(Object.entries(attributes), options);\n}\n\nexport function resourceFromDetectedResource(\n detectedResource: DetectedResource,\n options?: ResourceOptions\n): Resource {\n return new ResourceImpl(detectedResource, options);\n}\n\nexport function emptyResource(): Resource {\n return resourceFromAttributes({});\n}\n\nexport function defaultResource(): Resource {\n return resourceFromAttributes({\n [ATTR_SERVICE_NAME]: defaultServiceName(),\n [ATTR_TELEMETRY_SDK_LANGUAGE]: SDK_INFO[ATTR_TELEMETRY_SDK_LANGUAGE],\n [ATTR_TELEMETRY_SDK_NAME]: SDK_INFO[ATTR_TELEMETRY_SDK_NAME],\n [ATTR_TELEMETRY_SDK_VERSION]: SDK_INFO[ATTR_TELEMETRY_SDK_VERSION],\n });\n}\n\nfunction guardedRawAttributes(\n attributes: RawResourceAttribute[]\n): RawResourceAttribute[] {\n return attributes.map(([k, v]) => {\n if (isPromiseLike(v)) {\n return [\n k,\n v.catch(err => {\n diag.debug(\n 'promise rejection for resource attribute: %s - %s',\n k,\n err\n );\n return undefined;\n }),\n ];\n }\n return [k, v];\n });\n}\n\nfunction validateSchemaUrl(schemaUrl?: string): string | undefined {\n if (typeof schemaUrl === 'string' || schemaUrl === undefined) {\n return schemaUrl;\n }\n\n diag.warn(\n 'Schema URL must be string or undefined, got %s. Schema URL will be ignored.',\n schemaUrl\n );\n\n return undefined;\n}\n\nfunction mergeSchemaUrl(\n old: Resource,\n updating: Resource | null\n): string | undefined {\n const oldSchemaUrl = old?.schemaUrl;\n const updatingSchemaUrl = updating?.schemaUrl;\n\n const isOldEmpty = oldSchemaUrl === undefined || oldSchemaUrl === '';\n const isUpdatingEmpty =\n updatingSchemaUrl === undefined || updatingSchemaUrl === '';\n\n if (isOldEmpty) {\n return updatingSchemaUrl;\n }\n\n if (isUpdatingEmpty) {\n return oldSchemaUrl;\n }\n\n if (oldSchemaUrl === updatingSchemaUrl) {\n return oldSchemaUrl;\n }\n\n diag.warn(\n 'Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.',\n oldSchemaUrl,\n updatingSchemaUrl\n );\n\n return undefined;\n}\n"]} | ||
| {"version":3,"file":"ResourceImpl.js","sourceRoot":"","sources":["../../src/ResourceImpl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAA8B,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAQ5D,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,YAAY;IACR,cAAc,CAAyB;IACvC,uBAAuB,GAAG,KAAK,CAAC;IAChC,UAAU,CAAU;IAEpB,mBAAmB,CAAc;IAEzC,MAAM,CAAC,iBAAiB,CACtB,UAAgE,EAChE,OAAyB;QAEzB,M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EACnD,CAAC,EACD,GAAG,CACJ,CAAC;oBACF,OAAO,SAAS,CAAC;gBACnB,CAAC,CAAC;aACH,CAAC;SACH;QACD,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,iBAAiB,CAAC,SAAkB;IAC3C,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,SAAS,EAAE;QAC5D,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,CAAC,IAAI,CACP,6EAA6E,EAC7E,SAAS,CACV,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,cAAc,CACrB,GAAa,EACb,QAAyB;IAEzB,MAAM,YAAY,GAAG,GAAG,EAAE,SAAS,CAAC;IACpC,MAAM,iBAAiB,GAAG,QAAQ,EAAE,SAAS,CAAC;IAE9C,MAAM,UAAU,GAAG,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,EAAE,CAAC;IACrE,MAAM,eAAe,GACnB,iBAAiB,KAAK,SAAS,IAAI,iBAAiB,KAAK,EAAE,CAAC;IAE9D,IAAI,UAAU,EAAE;QACd,OAAO,iBAAiB,CAAC;KAC1B;IAED,IAAI,eAAe,EAAE;QACnB,OAAO,YAAY,CAAC;KACrB;IAED,IAAI,YAAY,KAAK,iBAAiB,EAAE;QACtC,OAAO,YAAY,CAAC;KACrB;IAED,IAAI,CAAC,IAAI,CACP,kIAAkI,EAClI,YAAY,EACZ,iBAAiB,CAClB,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Attributes, AttributeValue, diag } from '@opentelemetry/api';\nimport { SDK_INFO } from '@opentelemetry/core';\nimport {\n ATTR_SERVICE_NAME,\n ATTR_TELEMETRY_SDK_LANGUAGE,\n ATTR_TELEMETRY_SDK_NAME,\n ATTR_TELEMETRY_SDK_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { Resource } from './Resource';\nimport { defaultServiceName } from './default-service-name';\nimport {\n DetectedResource,\n DetectedResourceAttributes,\n MaybePromise,\n RawResourceAttribute,\n ResourceOptions,\n} from './types';\nimport { isPromiseLike } from './utils';\n\nclass ResourceImpl implements Resource {\n private _rawAttributes: RawResourceAttribute[];\n private _asyncAttributesPending = false;\n private _schemaUrl?: string;\n\n private _memoizedAttributes?: Attributes;\n\n static FromAttributeList(\n attributes: [string, MaybePromise<AttributeValue | undefined>][],\n options?: ResourceOptions\n ): Resource {\n const res = new ResourceImpl({}, options);\n res._rawAttributes = guardedRawAttributes(attributes);\n res._asyncAttributesPending =\n attributes.filter(([_, val]) => isPromiseLike(val)).length > 0;\n return res;\n }\n\n constructor(\n /**\n * A dictionary of attributes with string keys and values that provide\n * information about the entity as numbers, strings or booleans\n * TODO: Consider to add check/validation on attributes.\n */\n resource: DetectedResource,\n options?: ResourceOptions\n ) {\n const attributes = resource.attributes ?? {};\n this._rawAttributes = Object.entries(attributes).map(([k, v]) => {\n if (isPromiseLike(v)) {\n // side-effect\n this._asyncAttributesPending = true;\n }\n\n return [k, v];\n });\n\n this._rawAttributes = guardedRawAttributes(this._rawAttributes);\n this._schemaUrl = validateSchemaUrl(options?.schemaUrl);\n }\n\n public get asyncAttributesPending(): boolean {\n return this._asyncAttributesPending;\n }\n\n public async waitForAsyncAttributes(): Promise<void> {\n if (!this.asyncAttributesPending) {\n return;\n }\n\n for (let i = 0; i < this._rawAttributes.length; i++) {\n const [k, v] = this._rawAttributes[i];\n this._rawAttributes[i] = [k, isPromiseLike(v) ? await v : v];\n }\n\n this._asyncAttributesPending = false;\n }\n\n public get attributes(): Attributes {\n if (this.asyncAttributesPending) {\n diag.error(\n 'Accessing resource attributes before async attributes settled'\n );\n }\n\n if (this._memoizedAttributes) {\n return this._memoizedAttributes;\n }\n\n const attrs: Attributes = {};\n for (const [k, v] of this._rawAttributes) {\n if (isPromiseLike(v)) {\n diag.debug(`Unsettled resource attribute ${k} skipped`);\n continue;\n }\n if (v != null) {\n attrs[k] ??= v;\n }\n }\n\n // only memoize output if all attributes are settled\n if (!this._asyncAttributesPending) {\n this._memoizedAttributes = attrs;\n }\n\n return attrs;\n }\n\n public getRawAttributes(): RawResourceAttribute[] {\n return this._rawAttributes;\n }\n\n public get schemaUrl(): string | undefined {\n return this._schemaUrl;\n }\n\n public merge(resource: Resource | null): Resource {\n if (resource == null) return this;\n\n // Order is important\n // Spec states incoming attributes override existing attributes\n const mergedSchemaUrl = mergeSchemaUrl(this, resource);\n const mergedOptions: ResourceOptions | undefined = mergedSchemaUrl\n ? { schemaUrl: mergedSchemaUrl }\n : undefined;\n\n return ResourceImpl.FromAttributeList(\n [...resource.getRawAttributes(), ...this.getRawAttributes()],\n mergedOptions\n );\n }\n}\n\nexport function resourceFromAttributes(\n attributes: DetectedResourceAttributes,\n options?: ResourceOptions\n): Resource {\n return ResourceImpl.FromAttributeList(Object.entries(attributes), options);\n}\n\nexport function resourceFromDetectedResource(\n detectedResource: DetectedResource,\n options?: ResourceOptions\n): Resource {\n return new ResourceImpl(detectedResource, options);\n}\n\nexport function emptyResource(): Resource {\n return resourceFromAttributes({});\n}\n\nexport function defaultResource(): Resource {\n return resourceFromAttributes({\n [ATTR_SERVICE_NAME]: defaultServiceName(),\n [ATTR_TELEMETRY_SDK_LANGUAGE]: SDK_INFO[ATTR_TELEMETRY_SDK_LANGUAGE],\n [ATTR_TELEMETRY_SDK_NAME]: SDK_INFO[ATTR_TELEMETRY_SDK_NAME],\n [ATTR_TELEMETRY_SDK_VERSION]: SDK_INFO[ATTR_TELEMETRY_SDK_VERSION],\n });\n}\n\nfunction guardedRawAttributes(\n attributes: RawResourceAttribute[]\n): RawResourceAttribute[] {\n return attributes.map(([k, v]) => {\n if (isPromiseLike(v)) {\n return [\n k,\n v.catch(err => {\n diag.debug(\n 'promise rejection for resource attribute: %s - %s',\n k,\n err\n );\n return undefined;\n }),\n ];\n }\n return [k, v];\n });\n}\n\nfunction validateSchemaUrl(schemaUrl?: string): string | undefined {\n if (typeof schemaUrl === 'string' || schemaUrl === undefined) {\n return schemaUrl;\n }\n\n diag.warn(\n 'Schema URL must be string or undefined, got %s. Schema URL will be ignored.',\n schemaUrl\n );\n\n return undefined;\n}\n\nfunction mergeSchemaUrl(\n old: Resource,\n updating: Resource | null\n): string | undefined {\n const oldSchemaUrl = old?.schemaUrl;\n const updatingSchemaUrl = updating?.schemaUrl;\n\n const isOldEmpty = oldSchemaUrl === undefined || oldSchemaUrl === '';\n const isUpdatingEmpty =\n updatingSchemaUrl === undefined || updatingSchemaUrl === '';\n\n if (isOldEmpty) {\n return updatingSchemaUrl;\n }\n\n if (isUpdatingEmpty) {\n return oldSchemaUrl;\n }\n\n if (oldSchemaUrl === updatingSchemaUrl) {\n return oldSchemaUrl;\n }\n\n diag.warn(\n 'Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.',\n oldSchemaUrl,\n updatingSchemaUrl\n );\n\n return undefined;\n}\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ /* |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qB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right 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\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * The cloud account ID the resource is assigned to.\n *\n * @example 111111111111\n * @example opentelemetry\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_ACCOUNT_ID = 'cloud.account.id' as const;\n\n/**\n * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.\n *\n * @example us-east-1c\n *\n * @note Availability zones are called \"zones\" on Alibaba Cloud and Google Cloud.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_AVAILABILITY_ZONE = 'cloud.availability_zone' as const;\n\n/**\n * Name of the cloud provider.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_PROVIDER = 'cloud.provider' as const;\n\n/**\n * The geographical region the resource is running.\n *\n * @example us-central1\n * @example us-east-1\n *\n * @note Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091).\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_REGION = 'cloud.region' as const;\n\n/**\n * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated.\n *\n * @example a3bf90e006b2\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_ID = 'container.id' as const;\n\n/**\n * Name of the image the container was built on.\n *\n * @example gcr.io/opentelemetry/operator\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_IMAGE_NAME = 'container.image.name' as const;\n\n/**\n * Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `<tag>` section of the full name for example from `registry.example.com/my-org/my-image:<tag>`.\n *\n * @example [\"v1.27.1\", \"3.5.7-0\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_IMAGE_TAGS = 'container.image.tags' as const;\n\n/**\n * Container name used by container runtime.\n *\n * @example opentelemetry-autoconf\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_NAME = 'container.name' as const;\n\n/**\n * The CPU architecture the host system is running on.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_ARCH = 'host.arch' as const;\n\n/**\n * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system.\n *\n * @example fdbf79e8af94cb7f9e8df36789187052\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_ID = 'host.id' as const;\n\n/**\n * VM image ID or host OS image ID. For Cloud, this value is from the provider.\n *\n * @example ami-07b06b442921831e5\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_IMAGE_ID = 'host.image.id' as const;\n\n/**\n * Name of the VM image or OS install the host was instantiated from.\n *\n * @example infra-ami-eks-worker-node-7d4ec78312\n * @example CentOS-8-x86_64-1905\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_IMAGE_NAME = 'host.image.name' as const;\n\n/**\n * The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes).\n *\n * @example 0.1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_IMAGE_VERSION = 'host.image.version' as const;\n\n/**\n * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user.\n *\n * @example opentelemetry-test\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_NAME = 'host.name' as const;\n\n/**\n * Type of host. For Cloud, this must be the machine type.\n *\n * @example n1-standard-1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_TYPE = 'host.type' as const;\n\n/**\n * The name of the cluster.\n *\n * @example opentelemetry-cluster\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_CLUSTER_NAME = 'k8s.cluster.name' as const;\n\n/**\n * The name of the Deployment.\n *\n * @example opentelemetry\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_DEPLOYMENT_NAME = 'k8s.deployment.name' as const;\n\n/**\n * The name of the namespace that the pod is running in.\n *\n * @example default\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_NAMESPACE_NAME = 'k8s.namespace.name' as const;\n\n/**\n * The name of the Pod.\n *\n * @example opentelemetry-pod-autoconf\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_POD_NAME = 'k8s.pod.name' as const;\n\n/**\n * The operating system type.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OS_TYPE = 'os.type' as const;\n\n/**\n * The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes).\n *\n * @example 14.2.1\n * @example 18.04.1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OS_VERSION = 'os.version' as const;\n\n/**\n * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`.\n *\n * @example cmd/otelcol\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_COMMAND = 'process.command' as const;\n\n/**\n * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`.\n *\n * @example [\"cmd/otecol\", \"--config=config.yaml\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_COMMAND_ARGS = 'process.command_args' as const;\n\n/**\n * The name of the process executable. On Linux based systems, this **SHOULD** be set to the base name of the target of `/proc/[pid]/exe`. On Windows, this **SHOULD** be set to the base name of `GetProcessImageFileNameW`.\n *\n * @example otelcol\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_EXECUTABLE_NAME = 'process.executable.name' as const;\n\n/**\n * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`.\n *\n * @example /usr/bin/cmd/otelcol\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_EXECUTABLE_PATH = 'process.executable.path' as const;\n\n/**\n * The username of the user that owns the process.\n *\n * @example root\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_OWNER = 'process.owner' as const;\n\n/**\n * Process identifier (PID).\n *\n * @example 1234\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_PID = 'process.pid' as const;\n\n/**\n * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment.\n *\n * @example \"Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_DESCRIPTION =\n 'process.runtime.description' as const;\n\n/**\n * The name of the runtime of this process.\n *\n * @example OpenJDK Runtime Environment\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_NAME = 'process.runtime.name' as const;\n\n/**\n * The version of the runtime of this process, as returned by the runtime without modification.\n *\n * @example \"14.0.2\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_VERSION = 'process.runtime.version' as const;\n\n/**\n * The string ID of the service instance.\n *\n * @example 627cc493-f310-47de-96bd-71410b7dec09\n *\n * @note **MUST** be unique for each instance of the same `service.namespace,service.name` pair (in other words\n * `service.namespace,service.name,service.instance.id` triplet **MUST** be globally unique). The ID helps to\n * distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled\n * service).\n *\n * Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC\n * 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of\n * this value if stability is desirable. In that case, the ID **SHOULD** be used as source of a UUID Version 5 and\n * **SHOULD** use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`.\n *\n * UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is\n * needed. Similar to what can be seen in the man page for the\n * [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/latest/machine-id.html) file, the underlying\n * data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it\n * or not via another resource attribute.\n *\n * For applications running behind an application server (like unicorn), we do not recommend using one identifier\n * for all processes participating in the application. Instead, it's recommended each division (e.g. a worker\n * thread in unicorn) to have its own instance.id.\n *\n * It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the\n * service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will\n * likely be wrong, as the Collector might not know from which container within that pod the telemetry originated.\n * However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance\n * for that telemetry. This is typically the case for scraping receivers, as they know the target address and\n * port.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_SERVICE_INSTANCE_ID = 'service.instance.id' as const;\n\n/**\n * A namespace for `service.name`.\n *\n * @example Shop\n *\n * @note A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_SERVICE_NAMESPACE = 'service.namespace' as const;\n\n/**\n * Additional description of the web engine (e.g. detailed version and edition information).\n *\n * @example WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_WEBENGINE_DESCRIPTION = 'webengine.description' as const;\n\n/**\n * The name of the web engine.\n *\n * @example WildFly\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_WEBENGINE_NAME = 'webengine.name' as const;\n\n/**\n * The version of the web engine.\n *\n * @example 21.0.0\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_WEBENGINE_VERSION = 'webengine.version' as const;\n"]} | ||
| {"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAA2B,CAAC;AAEjE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,yBAAkC,CAAC;AAE/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAuB,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAuB,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,sBAA+B,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,sBAA+B,CAAC;AAEzE;;;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CAAC;AAE/E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAwB,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAsB,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAC3C,6BAAsC,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,sBAA+B,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,yBAAkC,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAA8B,CAAC;AAEvE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAA4B,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,uBAAgC,CAAC;AAE3E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAA4B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * The cloud account ID the resource is assigned to.\n *\n * @example 111111111111\n * @example opentelemetry\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_ACCOUNT_ID = 'cloud.account.id' as const;\n\n/**\n * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.\n *\n * @example us-east-1c\n *\n * @note Availability zones are called \"zones\" on Alibaba Cloud and Google Cloud.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_AVAILABILITY_ZONE = 'cloud.availability_zone' as const;\n\n/**\n * Name of the cloud provider.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_PROVIDER = 'cloud.provider' as const;\n\n/**\n * The geographical region the resource is running.\n *\n * @example us-central1\n * @example us-east-1\n *\n * @note Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091).\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_REGION = 'cloud.region' as const;\n\n/**\n * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated.\n *\n * @example a3bf90e006b2\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_ID = 'container.id' as const;\n\n/**\n * Name of the image the container was built on.\n *\n * @example gcr.io/opentelemetry/operator\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_IMAGE_NAME = 'container.image.name' as const;\n\n/**\n * Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `<tag>` section of the full name for example from `registry.example.com/my-org/my-image:<tag>`.\n *\n * @example [\"v1.27.1\", \"3.5.7-0\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_IMAGE_TAGS = 'container.image.tags' as const;\n\n/**\n * Container name used by container runtime.\n *\n * @example opentelemetry-autoconf\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_NAME = 'container.name' as const;\n\n/**\n * The CPU architecture the host system is running on.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_ARCH = 'host.arch' as const;\n\n/**\n * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system.\n *\n * @example fdbf79e8af94cb7f9e8df36789187052\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_ID = 'host.id' as const;\n\n/**\n * VM image ID or host OS image ID. For Cloud, this value is from the provider.\n *\n * @example ami-07b06b442921831e5\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_IMAGE_ID = 'host.image.id' as const;\n\n/**\n * Name of the VM image or OS install the host was instantiated from.\n *\n * @example infra-ami-eks-worker-node-7d4ec78312\n * @example CentOS-8-x86_64-1905\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_IMAGE_NAME = 'host.image.name' as const;\n\n/**\n * The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes).\n *\n * @example 0.1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_IMAGE_VERSION = 'host.image.version' as const;\n\n/**\n * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user.\n *\n * @example opentelemetry-test\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_NAME = 'host.name' as const;\n\n/**\n * Type of host. For Cloud, this must be the machine type.\n *\n * @example n1-standard-1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_TYPE = 'host.type' as const;\n\n/**\n * The name of the cluster.\n *\n * @example opentelemetry-cluster\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_CLUSTER_NAME = 'k8s.cluster.name' as const;\n\n/**\n * The name of the Deployment.\n *\n * @example opentelemetry\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_DEPLOYMENT_NAME = 'k8s.deployment.name' as const;\n\n/**\n * The name of the namespace that the pod is running in.\n *\n * @example default\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_NAMESPACE_NAME = 'k8s.namespace.name' as const;\n\n/**\n * The name of the Pod.\n *\n * @example opentelemetry-pod-autoconf\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_POD_NAME = 'k8s.pod.name' as const;\n\n/**\n * The operating system type.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OS_TYPE = 'os.type' as const;\n\n/**\n * The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes).\n *\n * @example 14.2.1\n * @example 18.04.1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OS_VERSION = 'os.version' as const;\n\n/**\n * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`.\n *\n * @example cmd/otelcol\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_COMMAND = 'process.command' as const;\n\n/**\n * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`.\n *\n * @example [\"cmd/otecol\", \"--config=config.yaml\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_COMMAND_ARGS = 'process.command_args' as const;\n\n/**\n * The name of the process executable. On Linux based systems, this **SHOULD** be set to the base name of the target of `/proc/[pid]/exe`. On Windows, this **SHOULD** be set to the base name of `GetProcessImageFileNameW`.\n *\n * @example otelcol\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_EXECUTABLE_NAME = 'process.executable.name' as const;\n\n/**\n * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`.\n *\n * @example /usr/bin/cmd/otelcol\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_EXECUTABLE_PATH = 'process.executable.path' as const;\n\n/**\n * The username of the user that owns the process.\n *\n * @example root\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_OWNER = 'process.owner' as const;\n\n/**\n * Process identifier (PID).\n *\n * @example 1234\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_PID = 'process.pid' as const;\n\n/**\n * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment.\n *\n * @example \"Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_DESCRIPTION =\n 'process.runtime.description' as const;\n\n/**\n * The name of the runtime of this process.\n *\n * @example OpenJDK Runtime Environment\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_NAME = 'process.runtime.name' as const;\n\n/**\n * The version of the runtime of this process, as returned by the runtime without modification.\n *\n * @example \"14.0.2\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_VERSION = 'process.runtime.version' as const;\n\n/**\n * The string ID of the service instance.\n *\n * @example 627cc493-f310-47de-96bd-71410b7dec09\n *\n * @note **MUST** be unique for each instance of the same `service.namespace,service.name` pair (in other words\n * `service.namespace,service.name,service.instance.id` triplet **MUST** be globally unique). The ID helps to\n * distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled\n * service).\n *\n * Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC\n * 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of\n * this value if stability is desirable. In that case, the ID **SHOULD** be used as source of a UUID Version 5 and\n * **SHOULD** use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`.\n *\n * UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is\n * needed. Similar to what can be seen in the man page for the\n * [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/latest/machine-id.html) file, the underlying\n * data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it\n * or not via another resource attribute.\n *\n * For applications running behind an application server (like unicorn), we do not recommend using one identifier\n * for all processes participating in the application. Instead, it's recommended each division (e.g. a worker\n * thread in unicorn) to have its own instance.id.\n *\n * It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the\n * service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will\n * likely be wrong, as the Collector might not know from which container within that pod the telemetry originated.\n * However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance\n * for that telemetry. This is typically the case for scraping receivers, as they know the target address and\n * port.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_SERVICE_INSTANCE_ID = 'service.instance.id' as const;\n\n/**\n * A namespace for `service.name`.\n *\n * @example Shop\n *\n * @note A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_SERVICE_NAMESPACE = 'service.namespace' as const;\n\n/**\n * Additional description of the web engine (e.g. detailed version and edition information).\n *\n * @example WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_WEBENGINE_DESCRIPTION = 'webengine.description' as const;\n\n/**\n * The name of the web engine.\n *\n * @example WildFly\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_WEBENGINE_NAME = 'webengine.name' as const;\n\n/**\n * The version of the web engine.\n *\n * @example 21.0.0\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_WEBENGINE_VERSION = 'webengine.version' as const;\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| export {}; | ||
| //# sourceMappingURL=types.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","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 { AttributeValue } from '@opentelemetry/api';\nimport { ResourceDetectionConfig } from './config';\n\n/**\n * Interface for a Resource Detector.\n * A resource detector returns a set of detected resource attributes.\n * A detected resource attribute may be an {@link AttributeValue} or a Promise of an AttributeValue.\n */\nexport interface ResourceDetector {\n /**\n * Detect resource attributes.\n *\n * @returns a {@link DetectedResource} object containing detected resource attributes\n */\n detect(config?: ResourceDetectionConfig): DetectedResource;\n}\n\nexport type DetectedResource = {\n /**\n * Detected resource attributes.\n */\n attributes?: DetectedResourceAttributes;\n};\n\n/**\n * An object representing detected resource attributes.\n * Value may be {@link AttributeValue}s, a promise to an {@link AttributeValue}, or undefined.\n */\ntype DetectedResourceAttributeValue = MaybePromise<AttributeValue | undefined>;\n\n/**\n * An object representing detected resource attributes.\n * Values may be {@link AttributeValue}s or a promise to an {@link AttributeValue}.\n */\nexport type DetectedResourceAttributes = Record<\n string,\n DetectedResourceAttributeValue\n>;\n\nexport type MaybePromise<T> = T | Promise<T>;\n\nexport type RawResourceAttribute = [\n string,\n MaybePromise<AttributeValue | undefined>,\n];\n\n/**\n * Options for creating a {@link Resource}.\n */\nexport type ResourceOptions = {\n schemaUrl?: string;\n};\n"]} | ||
| {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { AttributeValue } from '@opentelemetry/api';\nimport { ResourceDetectionConfig } from './config';\n\n/**\n * Interface for a Resource Detector.\n * A resource detector returns a set of detected resource attributes.\n * A detected resource attribute may be an {@link AttributeValue} or a Promise of an AttributeValue.\n */\nexport interface ResourceDetector {\n /**\n * Detect resource attributes.\n *\n * @returns a {@link DetectedResource} object containing detected resource attributes\n */\n detect(config?: ResourceDetectionConfig): DetectedResource;\n}\n\nexport type DetectedResource = {\n /**\n * Detected resource attributes.\n */\n attributes?: DetectedResourceAttributes;\n};\n\n/**\n * An object representing detected resource attributes.\n * Value may be {@link AttributeValue}s, a promise to an {@link AttributeValue}, or undefined.\n */\ntype DetectedResourceAttributeValue = MaybePromise<AttributeValue | undefined>;\n\n/**\n * An object representing detected resource attributes.\n * Values may be {@link AttributeValue}s or a promise to an {@link AttributeValue}.\n */\nexport type DetectedResourceAttributes = Record<\n string,\n DetectedResourceAttributeValue\n>;\n\nexport type MaybePromise<T> = T | Promise<T>;\n\nexport type RawResourceAttribute = [\n string,\n MaybePromise<AttributeValue | undefined>,\n];\n\n/**\n * Options for creating a {@link Resource}.\n */\nexport type ResourceOptions = {\n schemaUrl?: string;\n};\n"]} |
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -16,0 +5,0 @@ export const isPromiseLike = (val) => { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAI,GAAY,EAAyB,EAAE;IACtE,OAAO,CACL,GAAG,KAAK,IAAI;QACZ,OAAO,GAAG,KAAK,QAAQ;QACvB,OAAQ,GAA+B,CAAC,IAAI,KAAK,UAAU,CAC5D,CAAC;AACJ,CAAC,CAAC","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\nexport const isPromiseLike = <R>(val: unknown): val is PromiseLike<R> => {\n return (\n val !== null &&\n typeof val === 'object' &&\n typeof (val as Partial<PromiseLike<R>>).then === 'function'\n );\n};\n"]} | ||
| {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAI,GAAY,EAAyB,EAAE;IACtE,OAAO,CACL,GAAG,KAAK,IAAI;QACZ,OAAO,GAAG,KAAK,QAAQ;QACvB,OAAQ,GAA+B,CAAC,IAAI,KAAK,UAAU,CAC5D,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport const isPromiseLike = <R>(val: unknown): val is PromiseLike<R> => {\n return (\n val !== null &&\n typeof val === 'object' &&\n typeof (val as Partial<PromiseLike<R>>).then === 'function'\n );\n};\n"]} |
@@ -1,2 +0,2 @@ | ||
| export declare const VERSION = "2.5.1"; | ||
| export declare const VERSION = "2.6.0"; | ||
| //# sourceMappingURL=version.d.ts.map |
@@ -17,3 +17,3 @@ /* | ||
| // this is autogenerated file, see scripts/version-update.js | ||
| export const VERSION = '2.5.1'; | ||
| export const VERSION = '2.6.0'; | ||
| //# sourceMappingURL=version.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC","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\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '2.5.1';\n"]} | ||
| {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC","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\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '2.6.0';\n"]} |
+1
-12
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| //# sourceMappingURL=config.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","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 type { ResourceDetector } from './types';\n\n/**\n * ResourceDetectionConfig provides an interface for configuring resource auto-detection.\n */\nexport interface ResourceDetectionConfig {\n detectors?: Array<ResourceDetector>;\n}\n"]} | ||
| {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ResourceDetector } from './types';\n\n/**\n * ResourceDetectionConfig provides an interface for configuring resource auto-detection.\n */\nexport interface ResourceDetectionConfig {\n detectors?: Array<ResourceDetector>;\n}\n"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"default-service-name.js","sourceRoot":"","sources":["../../src/default-service-name.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,IAAI,WAA+B,CAAC;AAEpC;;;;GAIG;AACH,SAAgB,kBAAkB;IAChC,IAAI,WAAW,KAAK,SAAS,EAAE;QAC7B,IAAI;YACF,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC;YACvC,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,mBAAmB,KAAK,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC;SACtE;QAAC,MAAM;YACN,WAAW,GAAG,iBAAiB,CAAC;SACjC;KACF;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAVD,gDAUC;AAED,0CAA0C;AAC1C,SAAgB,6BAA6B;IAC3C,WAAW,GAAG,SAAS,CAAC;AAC1B,CAAC;AAFD,sEAEC","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\nlet serviceName: string | undefined;\n\n/**\n * Returns the default service name for OpenTelemetry resources.\n * In Node.js environments, returns \"unknown_service:<process.argv0>\".\n * In browser/edge environments, returns \"unknown_service\".\n */\nexport function defaultServiceName(): string {\n if (serviceName === undefined) {\n try {\n const argv0 = globalThis.process.argv0;\n serviceName = argv0 ? `unknown_service:${argv0}` : 'unknown_service';\n } catch {\n serviceName = 'unknown_service';\n }\n }\n return serviceName;\n}\n\n/** @internal For testing purposes only */\nexport function _clearDefaultServiceNameCache(): void {\n serviceName = undefined;\n}\n"]} | ||
| {"version":3,"file":"default-service-name.js","sourceRoot":"","sources":["../../src/default-service-name.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,IAAI,WAA+B,CAAC;AAEpC;;;;GAIG;AACH,SAAgB,kBAAkB;IAChC,IAAI,WAAW,KAAK,SAAS,EAAE;QAC7B,IAAI;YACF,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC;YACvC,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,mBAAmB,KAAK,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC;SACtE;QAAC,MAAM;YACN,WAAW,GAAG,iBAAiB,CAAC;SACjC;KACF;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAVD,gDAUC;AAED,0CAA0C;AAC1C,SAAgB,6BAA6B;IAC3C,WAAW,GAAG,SAAS,CAAC;AAC1B,CAAC;AAFD,sEAEC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nlet serviceName: string | undefined;\n\n/**\n * Returns the default service name for OpenTelemetry resources.\n * In Node.js environments, returns \"unknown_service:<process.argv0>\".\n * In browser/edge environments, returns \"unknown_service\".\n */\nexport function defaultServiceName(): string {\n if (serviceName === undefined) {\n try {\n const argv0 = globalThis.process.argv0;\n serviceName = argv0 ? `unknown_service:${argv0}` : 'unknown_service';\n } catch {\n serviceName = 'unknown_service';\n }\n }\n return serviceName;\n}\n\n/** @internal For testing purposes only */\nexport function _clearDefaultServiceNameCache(): void {\n serviceName = undefined;\n}\n"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"detect-resources.js","sourceRoot":"","sources":["../../src/detect-resources.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAA0C;AAE1C,iDAA6E;AAG7E;;;;GAIG;AACI,MAAM,eAAe,GAAG,CAC7B,SAAkC,EAAE,EAC1B,EAAE;IACZ,MAAM,SAAS,GAAe,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;QAC7D,IAAI;YACF,MAAM,QAAQ,GAAG,IAAA,2CAA4B,EAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;YAChE,UAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,kBAAkB,EAAE,QAAQ,CAAC,CAAC;YAC9D,OAAO,QAAQ,CAAC;SACjB;QAAC,OAAO,CAAC,EAAE;YACV,UAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YACzD,OAAO,IAAA,4BAAa,GAAE,CAAC;SACxB;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC,MAAM,CACrB,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,EACtC,IAAA,4BAAa,GAAE,CAChB,CAAC;AACJ,CAAC,CAAC;AAlBW,QAAA,eAAe,mBAkB1B","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 { diag } from '@opentelemetry/api';\nimport { Resource } from './Resource';\nimport { emptyResource, resourceFromDetectedResource } from './ResourceImpl';\nimport { ResourceDetectionConfig } from './config';\n\n/**\n * Runs all resource detectors and returns the results merged into a single Resource.\n *\n * @param config Configuration for resource detection\n */\nexport const detectResources = (\n config: ResourceDetectionConfig = {}\n): Resource => {\n const resources: Resource[] = (config.detectors || []).map(d => {\n try {\n const resource = resourceFromDetectedResource(d.detect(config));\n diag.debug(`${d.constructor.name} found resource.`, resource);\n return resource;\n } catch (e) {\n diag.debug(`${d.constructor.name} failed: ${e.message}`);\n return emptyResource();\n }\n });\n\n return resources.reduce(\n (acc, resource) => acc.merge(resource),\n emptyResource()\n );\n};\n"]} | ||
| {"version":3,"file":"detect-resources.js","sourceRoot":"","sources":["../../src/detect-resources.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4CAA0C;AAE1C,iDAA6E;AAG7E;;;;GAIG;AACI,MAAM,eAAe,GAAG,CAC7B,SAAkC,EAAE,EAC1B,EAAE;IACZ,MAAM,SAAS,GAAe,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;QAC7D,IAAI;YACF,MAAM,QAAQ,GAAG,IAAA,2CAA4B,EAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;YAChE,UAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,kBAAkB,EAAE,QAAQ,CAAC,CAAC;YAC9D,OAAO,QAAQ,CAAC;SACjB;QAAC,OAAO,CAAC,EAAE;YACV,UAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YACzD,OAAO,IAAA,4BAAa,GAAE,CAAC;SACxB;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC,MAAM,CACrB,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,EACtC,IAAA,4BAAa,GAAE,CAChB,CAAC;AACJ,CAAC,CAAC;AAlBW,QAAA,eAAe,mBAkB1B","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { diag } from '@opentelemetry/api';\nimport { Resource } from './Resource';\nimport { emptyResource, resourceFromDetectedResource } from './ResourceImpl';\nimport { ResourceDetectionConfig } from './config';\n\n/**\n * Runs all resource detectors and returns the results merged into a single Resource.\n *\n * @param config Configuration for resource detection\n */\nexport const detectResources = (\n config: ResourceDetectionConfig = {}\n): Resource => {\n const resources: Resource[] = (config.detectors || []).map(d => {\n try {\n const resource = resourceFromDetectedResource(d.detect(config));\n diag.debug(`${d.constructor.name} found resource.`, resource);\n return resource;\n } catch (e) {\n diag.debug(`${d.constructor.name} failed: ${e.message}`);\n return emptyResource();\n }\n });\n\n return resources.reduce(\n (acc, resource) => acc.merge(resource),\n emptyResource()\n );\n};\n"]} |
@@ -11,4 +11,2 @@ import { ResourceDetectionConfig } from '../config'; | ||
| private readonly _LABEL_KEY_VALUE_SPLITTER; | ||
| private readonly _ERROR_MESSAGE_INVALID_CHARS; | ||
| private readonly _ERROR_MESSAGE_INVALID_VALUE; | ||
| /** | ||
@@ -26,30 +24,15 @@ * Returns a {@link Resource} populated with attributes from the | ||
| * | ||
| * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes describing | ||
| * the source in more detail, e.g. “key1=val1,key2=val2”. Domain names and | ||
| * paths are accepted as attribute keys. Values may be quoted or unquoted in | ||
| * general. If a value contains whitespace, =, or " characters, it must | ||
| * always be quoted. | ||
| * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes in the | ||
| * format "key1=value1,key2=value2". The ',' and '=' characters in keys | ||
| * and values MUST be percent-encoded. Other characters MAY be percent-encoded. | ||
| * | ||
| * Per the spec, on any error (e.g., decoding failure), the entire environment | ||
| * variable value is discarded. | ||
| * | ||
| * @param rawEnvAttributes The resource attributes as a comma-separated list | ||
| * of key/value pairs. | ||
| * @returns The sanitized resource attributes. | ||
| * @returns The parsed resource attributes. | ||
| * @throws Error if parsing fails (caller handles by discarding all attributes) | ||
| */ | ||
| private _parseResourceAttributes; | ||
| /** | ||
| * Determines whether the given String is a valid printable ASCII string with | ||
| * a length not exceed _MAX_LENGTH characters. | ||
| * | ||
| * @param str The String to be validated. | ||
| * @returns Whether the String is valid. | ||
| */ | ||
| private _isValid; | ||
| private _isBaggageOctetString; | ||
| /** | ||
| * Determines whether the given String is a valid printable ASCII string with | ||
| * a length greater than 0 and not exceed _MAX_LENGTH characters. | ||
| * | ||
| * @param str The String to be validated. | ||
| * @returns Whether the String is valid and not empty. | ||
| */ | ||
| private _isValidAndNotEmpty; | ||
| } | ||
@@ -56,0 +39,0 @@ export declare const envDetector: EnvDetector; |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -33,8 +22,2 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
| _LABEL_KEY_VALUE_SPLITTER = '='; | ||
| _ERROR_MESSAGE_INVALID_CHARS = 'should be a ASCII string with a length greater than 0 and not exceed ' + | ||
| this._MAX_LENGTH + | ||
| ' characters.'; | ||
| _ERROR_MESSAGE_INVALID_VALUE = 'should be a ASCII string with a length not exceed ' + | ||
| this._MAX_LENGTH + | ||
| ' characters.'; | ||
| /** | ||
@@ -57,3 +40,3 @@ * Returns a {@link Resource} populated with attributes from the | ||
| catch (e) { | ||
| api_1.diag.debug(`EnvDetector failed: ${e.message}`); | ||
| api_1.diag.debug(`EnvDetector failed: ${e instanceof Error ? e.message : e}`); | ||
| } | ||
@@ -70,11 +53,13 @@ } | ||
| * | ||
| * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes describing | ||
| * the source in more detail, e.g. “key1=val1,key2=val2”. Domain names and | ||
| * paths are accepted as attribute keys. Values may be quoted or unquoted in | ||
| * general. If a value contains whitespace, =, or " characters, it must | ||
| * always be quoted. | ||
| * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes in the | ||
| * format "key1=value1,key2=value2". The ',' and '=' characters in keys | ||
| * and values MUST be percent-encoded. Other characters MAY be percent-encoded. | ||
| * | ||
| * Per the spec, on any error (e.g., decoding failure), the entire environment | ||
| * variable value is discarded. | ||
| * | ||
| * @param rawEnvAttributes The resource attributes as a comma-separated list | ||
| * of key/value pairs. | ||
| * @returns The sanitized resource attributes. | ||
| * @returns The parsed resource attributes. | ||
| * @throws Error if parsing fails (caller handles by discarding all attributes) | ||
| */ | ||
@@ -85,54 +70,38 @@ _parseResourceAttributes(rawEnvAttributes) { | ||
| const attributes = {}; | ||
| const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR, -1); | ||
| const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR); | ||
| for (const rawAttribute of rawAttributes) { | ||
| const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER, -1); | ||
| const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER); | ||
| // Per spec: ',' and '=' MUST be percent-encoded in keys and values. | ||
| // If we get != 2 parts, there's an unencoded '=' which is an error. | ||
| if (keyValuePair.length !== 2) { | ||
| continue; | ||
| throw new Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${rawAttribute}". ` + | ||
| `Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`); | ||
| } | ||
| let [key, value] = keyValuePair; | ||
| // Leading and trailing whitespaces are trimmed. | ||
| key = key.trim(); | ||
| value = value.trim().split(/^"|"$/).join(''); | ||
| if (!this._isValidAndNotEmpty(key)) { | ||
| throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`); | ||
| const [rawKey, rawValue] = keyValuePair; | ||
| const key = rawKey.trim(); | ||
| const value = rawValue.trim(); | ||
| if (key.length === 0) { | ||
| throw new Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${rawAttribute}".`); | ||
| } | ||
| if (!this._isValid(value)) { | ||
| throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`); | ||
| let decodedKey; | ||
| let decodedValue; | ||
| try { | ||
| decodedKey = decodeURIComponent(key); | ||
| decodedValue = decodeURIComponent(value); | ||
| } | ||
| attributes[key] = decodeURIComponent(value); | ||
| catch (e) { | ||
| throw new Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${rawAttribute}": ${e instanceof Error ? e.message : e}`); | ||
| } | ||
| if (decodedKey.length > this._MAX_LENGTH) { | ||
| throw new Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${decodedKey}".`); | ||
| } | ||
| if (decodedValue.length > this._MAX_LENGTH) { | ||
| throw new Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${decodedKey}".`); | ||
| } | ||
| attributes[decodedKey] = decodedValue; | ||
| } | ||
| return attributes; | ||
| } | ||
| /** | ||
| * Determines whether the given String is a valid printable ASCII string with | ||
| * a length not exceed _MAX_LENGTH characters. | ||
| * | ||
| * @param str The String to be validated. | ||
| * @returns Whether the String is valid. | ||
| */ | ||
| _isValid(name) { | ||
| return name.length <= this._MAX_LENGTH && this._isBaggageOctetString(name); | ||
| } | ||
| // https://www.w3.org/TR/baggage/#definition | ||
| _isBaggageOctetString(str) { | ||
| for (let i = 0; i < str.length; i++) { | ||
| const ch = str.charCodeAt(i); | ||
| if (ch < 0x21 || ch === 0x2c || ch === 0x3b || ch === 0x5c || ch > 0x7e) { | ||
| return false; | ||
| } | ||
| } | ||
| return true; | ||
| } | ||
| /** | ||
| * Determines whether the given String is a valid printable ASCII string with | ||
| * a length greater than 0 and not exceed _MAX_LENGTH characters. | ||
| * | ||
| * @param str The String to be validated. | ||
| * @returns Whether the String is valid and not empty. | ||
| */ | ||
| _isValidAndNotEmpty(str) { | ||
| return str.length > 0 && this._isValid(str); | ||
| } | ||
| } | ||
| exports.envDetector = new EnvDetector(); | ||
| //# sourceMappingURL=EnvDetector.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"EnvDetector.js","sourceRoot":"","sources":["../../../src/detectors/EnvDetector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAAsD;AACtD,8EAAwE;AAGxE,8CAAuD;AAEvD;;;GAGG;AACH,MAAM,WAAW;IACf,+EAA+E;IAC9D,WAAW,GAAG,GAAG,CAAC;IAEnC,oEAAoE;IACnD,gBAAgB,GAAG,GAAG,CAAC;IAExC,qEAAqE;IACpD,yBAAyB,GAAG,GAAG,CAAC;IAEhC,4BAA4B,GAC3C,uEAAuE;QACvE,IAAI,CAAC,WAAW;QAChB,cAAc,CAAC;IAEA,4BAA4B,GAC3C,oDAAoD;QACpD,IAAI,CAAC,WAAW;QAChB,cAAc,CAAC;IAEjB;;;;;;OAMG;IACH,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAe,EAAE,CAAC;QAElC,MAAM,aAAa,GAAG,IAAA,uBAAgB,EAAC,0BAA0B,CAAC,CAAC;QACnE,MAAM,WAAW,GAAG,IAAA,uBAAgB,EAAC,mBAAmB,CAAC,CAAC;QAE1D,IAAI,aAAa,EAAE;YACjB,IAAI;gBACF,MAAM,gBAAgB,GAAG,IAAI,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC;gBACtE,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;aAC7C;YAAC,OAAO,CAAC,EAAE;gBACV,UAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;aAChD;SACF;QAED,IAAI,WAAW,EAAE;YACf,UAAU,CAAC,wCAAiB,CAAC,GAAG,WAAW,CAAC;SAC7C;QAED,OAAO,EAAE,UAAU,EA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AI,CAAC,CAAC;IAC7E,CAAC;IAED,4CAA4C;IACpC,qBAAqB,CAAC,GAAW;QACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACnC,MAAM,EAAE,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC7B,IAAI,EAAE,GAAG,IAAI,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,GAAG,IAAI,EAAE;gBACvE,OAAO,KAAK,CAAC;aACd;SACF;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACK,mBAAmB,CAAC,GAAW;QACrC,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC9C,CAAC;CACF;AAEY,QAAA,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC","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 { Attributes, diag } from '@opentelemetry/api';\nimport { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';\nimport { ResourceDetectionConfig } from '../config';\nimport { DetectedResource, ResourceDetector } from '../types';\nimport { getStringFromEnv } from '@opentelemetry/core';\n\n/**\n * EnvDetector can be used to detect the presence of and create a Resource\n * from the OTEL_RESOURCE_ATTRIBUTES environment variable.\n */\nclass EnvDetector implements ResourceDetector {\n // Type, attribute keys, and attribute values should not exceed 256 characters.\n private readonly _MAX_LENGTH = 255;\n\n // OTEL_RESOURCE_ATTRIBUTES is a comma-separated list of attributes.\n private readonly _COMMA_SEPARATOR = ',';\n\n // OTEL_RESOURCE_ATTRIBUTES contains key value pair separated by '='.\n private readonly _LABEL_KEY_VALUE_SPLITTER = '=';\n\n private readonly _ERROR_MESSAGE_INVALID_CHARS =\n 'should be a ASCII string with a length greater than 0 and not exceed ' +\n this._MAX_LENGTH +\n ' characters.';\n\n private readonly _ERROR_MESSAGE_INVALID_VALUE =\n 'should be a ASCII string with a length not exceed ' +\n this._MAX_LENGTH +\n ' characters.';\n\n /**\n * Returns a {@link Resource} populated with attributes from the\n * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async\n * function to conform to the Detector interface.\n *\n * @param config The resource detection config\n */\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n const attributes: Attributes = {};\n\n const rawAttributes = getStringFromEnv('OTEL_RESOURCE_ATTRIBUTES');\n const serviceName = getStringFromEnv('OTEL_SERVICE_NAME');\n\n if (rawAttributes) {\n try {\n const parsedAttributes = this._parseResourceAttributes(rawAttributes);\n Object.assign(attributes, parsedAttributes);\n } catch (e) {\n diag.debug(`EnvDetector failed: ${e.message}`);\n }\n }\n\n if (serviceName) {\n attributes[ATTR_SERVICE_NAME] = serviceName;\n }\n\n return { attributes };\n }\n\n /**\n * Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment\n * variable.\n *\n * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes describing\n * the source in more detail, e.g. “key1=val1,key2=val2”. Domain names and\n * paths are accepted as attribute keys. Values may be quoted or unquoted in\n * general. If a value contains whitespace, =, or \" characters, it must\n * always be quoted.\n *\n * @param rawEnvAttributes The resource attributes as a comma-separated list\n * of key/value pairs.\n * @returns The sanitized resource attributes.\n */\n private _parseResourceAttributes(rawEnvAttributes?: string): Attributes {\n if (!rawEnvAttributes) return {};\n\n const attributes: Attributes = {};\n const rawAttributes: string[] = rawEnvAttributes.split(\n this._COMMA_SEPARATOR,\n -1\n );\n for (const rawAttribute of rawAttributes) {\n const keyValuePair: string[] = rawAttribute.split(\n this._LABEL_KEY_VALUE_SPLITTER,\n -1\n );\n if (keyValuePair.length !== 2) {\n continue;\n }\n let [key, value] = keyValuePair;\n // Leading and trailing whitespaces are trimmed.\n key = key.trim();\n value = value.trim().split(/^\"|\"$/).join('');\n if (!this._isValidAndNotEmpty(key)) {\n throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);\n }\n if (!this._isValid(value)) {\n throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);\n }\n attributes[key] = decodeURIComponent(value);\n }\n return attributes;\n }\n\n /**\n * Determines whether the given String is a valid printable ASCII string with\n * a length not exceed _MAX_LENGTH characters.\n *\n * @param str The String to be validated.\n * @returns Whether the String is valid.\n */\n private _isValid(name: string): boolean {\n return name.length <= this._MAX_LENGTH && this._isBaggageOctetString(name);\n }\n\n // https://www.w3.org/TR/baggage/#definition\n private _isBaggageOctetString(str: string): boolean {\n for (let i = 0; i < str.length; i++) {\n const ch = str.charCodeAt(i);\n if (ch < 0x21 || ch === 0x2c || ch === 0x3b || ch === 0x5c || ch > 0x7e) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Determines whether the given String is a valid printable ASCII string with\n * a length greater than 0 and not exceed _MAX_LENGTH characters.\n *\n * @param str The String to be validated.\n * @returns Whether the String is valid and not empty.\n */\n private _isValidAndNotEmpty(str: string): boolean {\n return str.length > 0 && this._isValid(str);\n }\n}\n\nexport const envDetector = new EnvDetector();\n"]} | ||
| {"version":3,"file":"EnvDetector.js","sourceRoot":"","sources":["../../../src/detectors/EnvDetector.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4CAAsD;AACtD,8EAAwE;AAGxE,8CAAuD;AAEvD;;;GAGG;AACH,MAAM,WAAW;IACf,+EAA+E;IAC9D,WAAW,GAAG,GAAG,CAAC;IAEnC,oEAAoE;IACnD,gBAAgB,GAA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,oGAAoG,CACvG,CAAC;aACH;YAED,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,YAAY,CAAC;YACxC,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;YAC1B,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;YAE9B,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;gBACpB,MAAM,IAAI,KAAK,CACb,6DAA6D,YAAY,IAAI,CAC9E,CAAC;aACH;YAED,IAAI,UAAkB,CAAC;YACvB,IAAI,YAAoB,CAAC;YACzB,IAAI;gBACF,UAAU,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;gBACrC,YAAY,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;aAC1C;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,IAAI,KAAK,CACb,4DAA4D,YAAY,MAAM,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CACnH,CAAC;aACH;YAED,IAAI,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE;gBACxC,MAAM,IAAI,KAAK,CACb,+CAA+C,IAAI,CAAC,WAAW,iBAAiB,UAAU,IAAI,CAC/F,CAAC;aACH;YAED,IAAI,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE;gBAC1C,MAAM,IAAI,KAAK,CACb,iDAAiD,IAAI,CAAC,WAAW,wBAAwB,UAAU,IAAI,CACxG,CAAC;aACH;YAED,UAAU,CAAC,UAAU,CAAC,GAAG,YAAY,CAAC;SACvC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AAEY,QAAA,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Attributes, diag } from '@opentelemetry/api';\nimport { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';\nimport { ResourceDetectionConfig } from '../config';\nimport { DetectedResource, ResourceDetector } from '../types';\nimport { getStringFromEnv } from '@opentelemetry/core';\n\n/**\n * EnvDetector can be used to detect the presence of and create a Resource\n * from the OTEL_RESOURCE_ATTRIBUTES environment variable.\n */\nclass EnvDetector implements ResourceDetector {\n // Type, attribute keys, and attribute values should not exceed 256 characters.\n private readonly _MAX_LENGTH = 255;\n\n // OTEL_RESOURCE_ATTRIBUTES is a comma-separated list of attributes.\n private readonly _COMMA_SEPARATOR = ',';\n\n // OTEL_RESOURCE_ATTRIBUTES contains key value pair separated by '='.\n private readonly _LABEL_KEY_VALUE_SPLITTER = '=';\n\n /**\n * Returns a {@link Resource} populated with attributes from the\n * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async\n * function to conform to the Detector interface.\n *\n * @param config The resource detection config\n */\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n const attributes: Attributes = {};\n\n const rawAttributes = getStringFromEnv('OTEL_RESOURCE_ATTRIBUTES');\n const serviceName = getStringFromEnv('OTEL_SERVICE_NAME');\n\n if (rawAttributes) {\n try {\n const parsedAttributes = this._parseResourceAttributes(rawAttributes);\n Object.assign(attributes, parsedAttributes);\n } catch (e) {\n diag.debug(`EnvDetector failed: ${e instanceof Error ? e.message : e}`);\n }\n }\n\n if (serviceName) {\n attributes[ATTR_SERVICE_NAME] = serviceName;\n }\n\n return { attributes };\n }\n\n /**\n * Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment\n * variable.\n *\n * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes in the\n * format \"key1=value1,key2=value2\". The ',' and '=' characters in keys\n * and values MUST be percent-encoded. Other characters MAY be percent-encoded.\n *\n * Per the spec, on any error (e.g., decoding failure), the entire environment\n * variable value is discarded.\n *\n * @param rawEnvAttributes The resource attributes as a comma-separated list\n * of key/value pairs.\n * @returns The parsed resource attributes.\n * @throws Error if parsing fails (caller handles by discarding all attributes)\n */\n private _parseResourceAttributes(rawEnvAttributes?: string): Attributes {\n if (!rawEnvAttributes) return {};\n\n const attributes: Attributes = {};\n const rawAttributes: string[] = rawEnvAttributes.split(\n this._COMMA_SEPARATOR\n );\n\n for (const rawAttribute of rawAttributes) {\n const keyValuePair: string[] = rawAttribute.split(\n this._LABEL_KEY_VALUE_SPLITTER\n );\n\n // Per spec: ',' and '=' MUST be percent-encoded in keys and values.\n // If we get != 2 parts, there's an unencoded '=' which is an error.\n if (keyValuePair.length !== 2) {\n throw new Error(\n `Invalid format for OTEL_RESOURCE_ATTRIBUTES: \"${rawAttribute}\". ` +\n `Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`\n );\n }\n\n const [rawKey, rawValue] = keyValuePair;\n const key = rawKey.trim();\n const value = rawValue.trim();\n\n if (key.length === 0) {\n throw new Error(\n `Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in \"${rawAttribute}\".`\n );\n }\n\n let decodedKey: string;\n let decodedValue: string;\n try {\n decodedKey = decodeURIComponent(key);\n decodedValue = decodeURIComponent(value);\n } catch (e) {\n throw new Error(\n `Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry \"${rawAttribute}\": ${e instanceof Error ? e.message : e}`\n );\n }\n\n if (decodedKey.length > this._MAX_LENGTH) {\n throw new Error(\n `Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: \"${decodedKey}\".`\n );\n }\n\n if (decodedValue.length > this._MAX_LENGTH) {\n throw new Error(\n `Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key \"${decodedKey}\".`\n );\n }\n\n attributes[decodedKey] = decodedValue;\n }\n\n return attributes;\n }\n}\n\nexport const envDetector = new EnvDetector();\n"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/detectors/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,uCAKoB;AAJlB,wGAAA,YAAY,OAAA;AACZ,sGAAA,UAAU,OAAA;AACV,2GAAA,eAAe,OAAA;AACf,qHAAA,yBAAyB,OAAA;AAE3B,+CAA8C;AAArC,4GAAA,YAAY,OAAA","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\nexport { envDetector } from './EnvDetector';\nexport {\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './platform';\nexport { noopDetector } from './NoopDetector';\n"]} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/detectors/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,uCAKoB;AAJlB,wGAAA,YAAY,OAAA;AACZ,sGAAA,UAAU,OAAA;AACV,2GAAA,eAAe,OAAA;AACf,qHAAA,yBAAyB,OAAA;AAE3B,+CAA8C;AAArC,4GAAA,YAAY,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { envDetector } from './EnvDetector';\nexport {\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './platform';\nexport { noopDetector } from './NoopDetector';\n"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"NoopDetector.js","sourceRoot":"","sources":["../../../src/detectors/NoopDetector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,MAAa,YAAY;IACvB,MAAM;QACJ,OAAO;YACL,UAAU,EAAE,EAAE;SACf,CAAC;IACJ,CAAC;CACF;AAND,oCAMC;AAEY,QAAA,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC","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 { DetectedResource, ResourceDetector } from '../types';\n\nexport class NoopDetector implements ResourceDetector {\n detect(): DetectedResource {\n return {\n attributes: {},\n };\n }\n}\n\nexport const noopDetector = new NoopDetector();\n"]} | ||
| {"version":3,"file":"NoopDetector.js","sourceRoot":"","sources":["../../../src/detectors/NoopDetector.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,MAAa,YAAY;IACvB,MAAM;QACJ,OAAO;YACL,UAAU,EAAE,EAAE;SACf,CAAC;IACJ,CAAC;CACF;AAND,oCAMC;AAEY,QAAA,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DetectedResource, ResourceDetector } from '../types';\n\nexport class NoopDetector implements ResourceDetector {\n detect(): DetectedResource {\n return {\n attributes: {},\n };\n }\n}\n\nexport const noopDetector = new NoopDetector();\n"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"HostDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/HostDetector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,qDAAkD;AAErC,QAAA,YAAY,GAAG,2BAAY,CAAC","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 { noopDetector } from '../../NoopDetector';\n\nexport const hostDetector = noopDetector;\n"]} | ||
| {"version":3,"file":"HostDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/HostDetector.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qDAAkD;AAErC,QAAA,YAAY,GAAG,2BAAY,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { noopDetector } from '../../NoopDetector';\n\nexport const hostDetector = noopDetector;\n"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,yEAAwE;AAA/D,sIAAA,yBAAyB,OAAA","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\nexport { hostDetector } from './HostDetector';\nexport { osDetector } from './OSDetector';\nexport { processDetector } from './ProcessDetector';\nexport { serviceInstanceIdDetector } from './ServiceInstanceIdDetector';\n"]} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,yEAAwE;AAA/D,sIAAA,yBAAyB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { hostDetector } from './HostDetector';\nexport { osDetector } from './OSDetector';\nexport { processDetector } from './ProcessDetector';\nexport { serviceInstanceIdDetector } from './ServiceInstanceIdDetector';\n"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"OSDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/OSDetector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,qDAAkD;AAErC,QAAA,UAAU,GAAG,2BAAY,CAAC","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 { noopDetector } from '../../NoopDetector';\n\nexport const osDetector = noopDetector;\n"]} | ||
| {"version":3,"file":"OSDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/OSDetector.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qDAAkD;AAErC,QAAA,UAAU,GAAG,2BAAY,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { noopDetector } from '../../NoopDetector';\n\nexport const osDetector = noopDetector;\n"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ProcessDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/ProcessDetector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,qDAAkD;AAErC,QAAA,eAAe,GAAG,2BAAY,CAAC","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 { noopDetector } from '../../NoopDetector';\n\nexport const processDetector = noopDetector;\n"]} | ||
| {"version":3,"file":"ProcessDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/ProcessDetector.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qDAAkD;AAErC,QAAA,eAAe,GAAG,2BAAY,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { noopDetector } from '../../NoopDetector';\n\nexport const processDetector = noopDetector;\n"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ServiceInstanceIdDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/ServiceInstanceIdDetector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,qDAAkD;AAElD;;GAEG;AACU,QAAA,yBAAyB,GAAG,2BAAY,CAAC","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 { noopDetector } from '../../NoopDetector';\n\n/**\n * @experimental\n */\nexport const serviceInstanceIdDetector = noopDetector;\n"]} | ||
| {"version":3,"file":"ServiceInstanceIdDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/ServiceInstanceIdDetector.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qDAAkD;AAElD;;GAEG;AACU,QAAA,yBAAyB,GAAG,2BAAY,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { noopDetector } from '../../NoopDetector';\n\n/**\n * @experimental\n */\nexport const serviceInstanceIdDetector = noopDetector;\n"]} |
@@ -6,14 +6,3 @@ "use strict"; | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -20,0 +9,0 @@ var node_1 = require("./node"); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/detectors/platform/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,+BAKgB;AAJd,oGAAA,YAAY,OAAA;AACZ,kGAAA,UAAU,OAAA;AACV,uGAAA,eAAe,OAAA;AACf,iHAAA,yBAAyB,OAAA","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 */\nexport {\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './node';\n"]} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/detectors/platform/index.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,+BAKgB;AAJd,oGAAA,YAAY,OAAA;AACZ,kGAAA,UAAU,OAAA;AACV,uGAAA,eAAe,OAAA;AACf,iHAAA,yBAAyB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport {\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './node';\n"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"HostDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/HostDetector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;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 *\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 { ATTR_HOST_ARCH, ATTR_HOST_ID, ATTR_HOST_NAME } from '../../../semconv';\nimport { arch, hostname } from 'os';\nimport { ResourceDetectionConfig } from '../../../config';\nimport {\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"]} | ||
| {"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 { ResourceDetectionConfig } from '../../../config';\nimport {\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"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,yEAAwE;AAA/D,sIAAA,yBAAyB,OAAA","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\nexport { hostDetector } from './HostDetector';\nexport { osDetector } from './OSDetector';\nexport { processDetector } from './ProcessDetector';\nexport { serviceInstanceIdDetector } from './ServiceInstanceIdDetector';\n"]} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,yEAAwE;AAA/D,sIAAA,yBAAyB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { hostDetector } from './HostDetector';\nexport { osDetector } from './OSDetector';\nexport { processDetector } from './ProcessDetector';\nexport { serviceInstanceIdDetector } from './ServiceInstanceIdDetector';\n"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"execAsync.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/execAsync.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,+CAA+C;AAC/C,6BAA6B;AAEhB,QAAA,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC","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 * as child_process from 'child_process';\nimport * as util from 'util';\n\nexport const execAsync = util.promisify(child_process.exec);\n"]} | ||
| {"version":3,"file":"execAsync.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/execAsync.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA+C;AAC/C,6BAA6B;AAEhB,QAAA,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport * as child_process from 'child_process';\nimport * as util from 'util';\n\nexport const execAsync = util.promisify(child_process.exec);\n"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"getMachineId-bsd.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-bsd.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,2BAAoC;AACpC,2CAAwC;AACxC,4CAA0C;AAEnC,KAAK,UAAU,YAAY;IAChC,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,aAAE,CAAC,QAAQ,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QACtE,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;KACtB;IAAC,OAAO,CAAC,EAAE;QACV,UAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAS,EAAC,4BAA4B,CAAC,CAAC;QAC7D,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;KAC7B;IAAC,OAAO,CAAC,EAAE;QACV,UAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAhBD,oCAgBC","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<string | undefined> {\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 undefined;\n}\n"]} | ||
| {"version":3,"file":"getMachineId-bsd.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-bsd.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2BAAoC;AACpC,2CAAwC;AACxC,4CAA0C;AAEnC,KAAK,UAAU,YAAY;IAChC,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,aAAE,CAAC,QAAQ,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QACtE,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;KACtB;IAAC,OAAO,CAAC,EAAE;QACV,UAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAS,EAAC,4BAA4B,CAAC,CAAC;QAC7D,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;KAC7B;IAAC,OAAO,CAAC,EAAE;QACV,UAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAhBD,oCAgBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { promises as fs } from 'fs';\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\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 undefined;\n}\n"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"getMachineId-darwin.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-darwin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,2CAAwC;AACxC,4CAA0C;AAEnC,KAAK,UAAU,YAAY;IAChC,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAS,EAAC,wCAAwC,CAAC,CAAC;QAEzE,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM;aACzB,KAAK,CAAC,IAAI,CAAC;aACX,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAEjD,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,SAAS,CAAC;SAClB;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;SAC9B;KACF;IAAC,OAAO,CAAC,EAAE;QACV,UAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AArBD,oCAqBC","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 { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n try {\n const result = await execAsync('ioreg -rd1 -c \"IOPlatformExpertDevice\"');\n\n const idLine = result.stdout\n .split('\\n')\n .find(line => line.includes('IOPlatformUUID'));\n\n if (!idLine) {\n return undefined;\n }\n\n const parts = idLine.split('\" = \"');\n if (parts.length === 2) {\n return parts[1].slice(0, -1);\n }\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return undefined;\n}\n"]} | ||
| {"version":3,"file":"getMachineId-darwin.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-darwin.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2CAAwC;AACxC,4CAA0C;AAEnC,KAAK,UAAU,YAAY;IAChC,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAS,EAAC,wCAAwC,CAAC,CAAC;QAEzE,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM;aACzB,KAAK,CAAC,IAAI,CAAC;aACX,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAEjD,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,SAAS,CAAC;SAClB;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;SAC9B;KACF;IAAC,OAAO,CAAC,EAAE;QACV,UAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AArBD,oCAqBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n try {\n const result = await execAsync('ioreg -rd1 -c \"IOPlatformExpertDevice\"');\n\n const idLine = result.stdout\n .split('\\n')\n .find(line => line.includes('IOPlatformUUID'));\n\n if (!idLine) {\n return undefined;\n }\n\n const parts = idLine.split('\" = \"');\n if (parts.length === 2) {\n return parts[1].slice(0, -1);\n }\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return undefined;\n}\n"]} |
@@ -6,14 +6,3 @@ "use strict"; | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -20,0 +9,0 @@ const fs_1 = require("fs"); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"getMachineId-linux.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-linux.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,2BAAoC;AACpC,4CAA0C;AAEnC,KAAK,UAAU,YAAY;IAChC,MAAM,KAAK,GAAG,CAAC,iBAAiB,EAAE,0BAA0B,CAAC,CAAC;IAE9D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,aAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;YAC7D,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;SACtB;QAAC,OAAO,CAAC,EAAE;YACV,UAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;SAC9C;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAbD,oCAaC","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 */\nimport { promises as fs } from 'fs';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n const paths = ['/etc/machine-id', '/var/lib/dbus/machine-id'];\n\n for (const path of paths) {\n try {\n const result = await fs.readFile(path, { encoding: 'utf8' });\n return result.trim();\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n }\n\n return undefined;\n}\n"]} | ||
| {"version":3,"file":"getMachineId-linux.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-linux.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,2BAAoC;AACpC,4CAA0C;AAEnC,KAAK,UAAU,YAAY;IAChC,MAAM,KAAK,GAAG,CAAC,iBAAiB,EAAE,0BAA0B,CAAC,CAAC;IAE9D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,aAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;YAC7D,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;SACtB;QAAC,OAAO,CAAC,EAAE;YACV,UAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;SAC9C;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAbD,oCAaC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { promises as fs } from 'fs';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n const paths = ['/etc/machine-id', '/var/lib/dbus/machine-id'];\n\n for (const path of paths) {\n try {\n const result = await fs.readFile(path, { encoding: 'utf8' });\n return result.trim();\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n }\n\n return undefined;\n}\n"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"getMachineId-unsupported.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-unsupported.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAA0C;AAEnC,KAAK,UAAU,YAAY;IAChC,UAAI,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;IAC9D,OAAO,SAAS,CAAC;AACnB,CAAC;AAHD,oCAGC","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 { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n diag.debug('could not read machine-id: unsupported platform');\n return undefined;\n}\n"]} | ||
| {"version":3,"file":"getMachineId-unsupported.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-unsupported.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4CAA0C;AAEnC,KAAK,UAAU,YAAY;IAChC,UAAI,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;IAC9D,OAAO,SAAS,CAAC;AACnB,CAAC;AAHD,oCAGC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n diag.debug('could not read machine-id: unsupported platform');\n return undefined;\n}\n"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"getMachineId-win.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-win.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,mCAAmC;AACnC,2CAAwC;AACxC,4CAA0C;AAEnC,KAAK,UAAU,YAAY;IAChC,MAAM,IAAI,GACR,4EAA4E,CAAC;IAC/E,IAAI,OAAO,GAAG,6BAA6B,CAAC;IAC5C,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,IAAI,wBAAwB,IAAI,OAAO,CAAC,GAAG,EAAE;QACtE,OAAO,GAAG,kCAAkC,GAAG,OAAO,CAAC;KACxD;IAED,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAS,EAAC,GAAG,OAAO,IAAI,IAAI,EAAE,CAAC,CAAC;QACrD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACxB;KACF;IAAC,OAAO,CAAC,EAAE;QACV,UAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAnBD,oCAmBC","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 * as process from 'process';\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n const args =\n 'QUERY HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Cryptography /v MachineGuid';\n let command = '%windir%\\\\System32\\\\REG.exe';\n if (process.arch === 'ia32' && 'PROCESSOR_ARCHITEW6432' in process.env) {\n command = '%windir%\\\\sysnative\\\\cmd.exe /c ' + command;\n }\n\n try {\n const result = await execAsync(`${command} ${args}`);\n const parts = result.stdout.split('REG_SZ');\n if (parts.length === 2) {\n return parts[1].trim();\n }\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return undefined;\n}\n"]} | ||
| {"version":3,"file":"getMachineId-win.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-win.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,mCAAmC;AACnC,2CAAwC;AACxC,4CAA0C;AAEnC,KAAK,UAAU,YAAY;IAChC,MAAM,IAAI,GACR,4EAA4E,CAAC;IAC/E,IAAI,OAAO,GAAG,6BAA6B,CAAC;IAC5C,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,IAAI,wBAAwB,IAAI,OAAO,CAAC,GAAG,EAAE;QACtE,OAAO,GAAG,kCAAkC,GAAG,OAAO,CAAC;KACxD;IAED,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAS,EAAC,GAAG,OAAO,IAAI,IAAI,EAAE,CAAC,CAAC;QACrD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACxB;KACF;IAAC,OAAO,CAAC,EAAE;QACV,UAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAnBD,oCAmBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport * as process from 'process';\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n const args =\n 'QUERY HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Cryptography /v MachineGuid';\n let command = '%windir%\\\\System32\\\\REG.exe';\n if (process.arch === 'ia32' && 'PROCESSOR_ARCHITEW6432' in process.env) {\n command = '%windir%\\\\sysnative\\\\cmd.exe /c ' + command;\n }\n\n try {\n const result = await execAsync(`${command} ${args}`);\n const parts = result.stdout.split('REG_SZ');\n if (parts.length === 2) {\n return parts[1].trim();\n }\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return undefined;\n}\n"]} |
@@ -6,14 +6,3 @@ "use strict"; | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -20,0 +9,0 @@ const process = require("process"); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"getMachineId.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,mCAAmC;AAEnC,IAAI,gBAAiE,CAAC;AAE/D,KAAK,UAAU,YAAY;IAChC,IAAI,CAAC,gBAAgB,EAAE;QACrB,QAAQ,OAAO,CAAC,QAAQ,EAAE;YACxB,KAAK,QAAQ;gBACX,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC;qBAC1D,YAAY,CAAC;gBAChB,MAAM;YACR,KAAK,OAAO;gBACV,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;qBACzD,YAAY,CAAC;gBAChB,MAAM;YACR,KAAK,SAAS;gBACZ,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,YAAY,CAAC;gBACxE,MAAM;YACR,KAAK,OAAO;gBACV,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,YAAY,CAAC;gBACxE,MAAM;YACR;gBACE,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,+BAA+B,CAAC,CAAC;qBAC/D,YAAY,CAAC;gBAChB,MAAM;SACT;KACF;IAED,OAAO,gBAAgB,EAAE,CAAC;AAC5B,CAAC;AAzBD,oCAyBC","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 */\nimport * as process from 'process';\n\nlet getMachineIdImpl: undefined | (() => Promise<string | undefined>);\n\nexport async function getMachineId(): Promise<string | undefined> {\n if (!getMachineIdImpl) {\n switch (process.platform) {\n case 'darwin':\n getMachineIdImpl = (await import('./getMachineId-darwin.js'))\n .getMachineId;\n break;\n case 'linux':\n getMachineIdImpl = (await import('./getMachineId-linux.js'))\n .getMachineId;\n break;\n case 'freebsd':\n getMachineIdImpl = (await import('./getMachineId-bsd.js')).getMachineId;\n break;\n case 'win32':\n getMachineIdImpl = (await import('./getMachineId-win.js')).getMachineId;\n break;\n default:\n getMachineIdImpl = (await import('./getMachineId-unsupported.js'))\n .getMachineId;\n break;\n }\n }\n\n return getMachineIdImpl();\n}\n"]} | ||
| {"version":3,"file":"getMachineId.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,mCAAmC;AAEnC,IAAI,gBAAiE,CAAC;AAE/D,KAAK,UAAU,YAAY;IAChC,IAAI,CAAC,gBAAgB,EAAE;QACrB,QAAQ,OAAO,CAAC,QAAQ,EAAE;YACxB,KAAK,QAAQ;gBACX,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC;qBAC1D,YAAY,CAAC;gBAChB,MAAM;YACR,KAAK,OAAO;gBACV,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;qBACzD,YAAY,CAAC;gBAChB,MAAM;YACR,KAAK,SAAS;gBACZ,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,YAAY,CAAC;gBACxE,MAAM;YACR,KAAK,OAAO;gBACV,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,YAAY,CAAC;gBACxE,MAAM;YACR;gBACE,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,+BAA+B,CAAC,CAAC;qBAC/D,YAAY,CAAC;gBAChB,MAAM;SACT;KACF;IAED,OAAO,gBAAgB,EAAE,CAAC;AAC5B,CAAC;AAzBD,oCAyBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport * as process from 'process';\n\nlet getMachineIdImpl: undefined | (() => Promise<string | undefined>);\n\nexport async function getMachineId(): Promise<string | undefined> {\n if (!getMachineIdImpl) {\n switch (process.platform) {\n case 'darwin':\n getMachineIdImpl = (await import('./getMachineId-darwin.js'))\n .getMachineId;\n break;\n case 'linux':\n getMachineIdImpl = (await import('./getMachineId-linux.js'))\n .getMachineId;\n break;\n case 'freebsd':\n getMachineIdImpl = (await import('./getMachineId-bsd.js')).getMachineId;\n break;\n case 'win32':\n getMachineIdImpl = (await import('./getMachineId-win.js')).getMachineId;\n break;\n default:\n getMachineIdImpl = (await import('./getMachineId-unsupported.js'))\n .getMachineId;\n break;\n }\n }\n\n return getMachineIdImpl();\n}\n"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"OSDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/OSDetector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,8CAAiE;AACjE,2BAAuC;AAGvC,mCAAwC;AAExC;;;GAGG;AACH,MAAM,UAAU;IACd,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAe;YAC7B,CAAC,sBAAY,CAAC,EAAE,IAAA,qBAAa,EAAC,IAAA,aAAQ,GAAE,CAAC;YACzC,CAAC,yBAAe,CAAC,EAAE,IAAA,YAAO,GAAE;SAC7B,CAAC;QACF,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAEY,QAAA,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC","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 { Attributes } from '@opentelemetry/api';\nimport { ATTR_OS_TYPE, ATTR_OS_VERSION } from '../../../semconv';\nimport { platform, release } from 'os';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { DetectedResource, ResourceDetector } from '../../../types';\nimport { normalizeType } from './utils';\n\n/**\n * OSDetector detects the resources related to the operating system (OS) on\n * which the process represented by this resource is running.\n */\nclass OSDetector implements ResourceDetector {\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n const attributes: Attributes = {\n [ATTR_OS_TYPE]: normalizeType(platform()),\n [ATTR_OS_VERSION]: release(),\n };\n return { attributes };\n }\n}\n\nexport const osDetector = new OSDetector();\n"]} | ||
| {"version":3,"file":"OSDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/OSDetector.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,8CAAiE;AACjE,2BAAuC;AAGvC,mCAAwC;AAExC;;;GAGG;AACH,MAAM,UAAU;IACd,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAe;YAC7B,CAAC,sBAAY,CAAC,EAAE,IAAA,qBAAa,EAAC,IAAA,aAAQ,GAAE,CAAC;YACzC,CAAC,yBAAe,CAAC,EAAE,IAAA,YAAO,GAAE;SAC7B,CAAC;QACF,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAEY,QAAA,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Attributes } from '@opentelemetry/api';\nimport { ATTR_OS_TYPE, ATTR_OS_VERSION } from '../../../semconv';\nimport { platform, release } from 'os';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { DetectedResource, ResourceDetector } from '../../../types';\nimport { normalizeType } from './utils';\n\n/**\n * OSDetector detects the resources related to the operating system (OS) on\n * which the process represented by this resource is running.\n */\nclass OSDetector implements ResourceDetector {\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n const attributes: Attributes = {\n [ATTR_OS_TYPE]: normalizeType(platform()),\n [ATTR_OS_VERSION]: release(),\n };\n return { attributes };\n }\n}\n\nexport const osDetector = new OSDetector();\n"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ProcessDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/ProcessDetector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAAsD;AACtD,8CAU0B;AAC1B,yBAAyB;AAIzB;;;GAGG;AACH,MAAM,eAAe;IACnB,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAe;YAC7B,CAAC,0BAAgB,CAAC,EAAE,OAAO,CAAC,GAAG;YAC/B,CAAC,sCAA4B,CAAC,EAAE,OAAO,CAAC,KAAK;YAC7C,CAAC,sCAA4B,CAAC,EAAE,OAAO,CAAC,QAAQ;YAChD,CAAC,mCAAyB,CAAC,EAAE;gBAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;gBACf,GAAG,OAAO,CAAC,QAAQ;gBACnB,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;aACzB;YACD,CAAC,sCAA4B,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;YACrD,CAAC,mCAAyB,CAAC,EAAE,QAAQ;YACrC,CAAC,0CAAgC,CAAC,EAAE,SAAS;SAC9C,CAAC;QAEF,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3B,UAAU,CAAC,8BAAoB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACpD;QAED,IAAI;YACF,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;YAC/B,UAAU,CAAC,4BAAkB,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC;SACpD;QAAC,OAAO,CAAC,EAAE;YACV,UAAI,CAAC,KAAK,CAAC,kCAAkC,CAAC,EAAE,CAAC,CAAC;SACnD;QAED,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAEY,QAAA,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC","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 { Attributes, diag } from '@opentelemetry/api';\nimport {\n ATTR_PROCESS_COMMAND,\n ATTR_PROCESS_COMMAND_ARGS,\n ATTR_PROCESS_EXECUTABLE_NAME,\n ATTR_PROCESS_EXECUTABLE_PATH,\n ATTR_PROCESS_OWNER,\n ATTR_PROCESS_PID,\n ATTR_PROCESS_RUNTIME_DESCRIPTION,\n ATTR_PROCESS_RUNTIME_NAME,\n ATTR_PROCESS_RUNTIME_VERSION,\n} from '../../../semconv';\nimport * as os from 'os';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { DetectedResource, ResourceDetector } from '../../../types';\n\n/**\n * ProcessDetector will be used to detect the resources related current process running\n * and being instrumented from the NodeJS Process module.\n */\nclass ProcessDetector implements ResourceDetector {\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n const attributes: Attributes = {\n [ATTR_PROCESS_PID]: process.pid,\n [ATTR_PROCESS_EXECUTABLE_NAME]: process.title,\n [ATTR_PROCESS_EXECUTABLE_PATH]: process.execPath,\n [ATTR_PROCESS_COMMAND_ARGS]: [\n process.argv[0],\n ...process.execArgv,\n ...process.argv.slice(1),\n ],\n [ATTR_PROCESS_RUNTIME_VERSION]: process.versions.node,\n [ATTR_PROCESS_RUNTIME_NAME]: 'nodejs',\n [ATTR_PROCESS_RUNTIME_DESCRIPTION]: 'Node.js',\n };\n\n if (process.argv.length > 1) {\n attributes[ATTR_PROCESS_COMMAND] = process.argv[1];\n }\n\n try {\n const userInfo = os.userInfo();\n attributes[ATTR_PROCESS_OWNER] = userInfo.username;\n } catch (e) {\n diag.debug(`error obtaining process owner: ${e}`);\n }\n\n return { attributes };\n }\n}\n\nexport const processDetector = new ProcessDetector();\n"]} | ||
| {"version":3,"file":"ProcessDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/ProcessDetector.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4CAAsD;AACtD,8CAU0B;AAC1B,yBAAyB;AAIzB;;;GAGG;AACH,MAAM,eAAe;IACnB,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAe;YAC7B,CAAC,0BAAgB,CAAC,EAAE,OAAO,CAAC,GAAG;YAC/B,CAAC,sCAA4B,CAAC,EAAE,OAAO,CAAC,KAAK;YAC7C,CAAC,sCAA4B,CAAC,EAAE,OAAO,CAAC,QAAQ;YAChD,CAAC,mCAAyB,CAAC,EAAE;gBAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;gBACf,GAAG,OAAO,CAAC,QAAQ;gBACnB,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;aACzB;YACD,CAAC,sCAA4B,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;YACrD,CAAC,mCAAyB,CAAC,EAAE,QAAQ;YACrC,CAAC,0CAAgC,CAAC,EAAE,SAAS;SAC9C,CAAC;QAEF,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3B,UAAU,CAAC,8BAAoB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACpD;QAED,IAAI;YACF,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;YAC/B,UAAU,CAAC,4BAAkB,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC;SACpD;QAAC,OAAO,CAAC,EAAE;YACV,UAAI,CAAC,KAAK,CAAC,kCAAkC,CAAC,EAAE,CAAC,CAAC;SACnD;QAED,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAEY,QAAA,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Attributes, diag } from '@opentelemetry/api';\nimport {\n ATTR_PROCESS_COMMAND,\n ATTR_PROCESS_COMMAND_ARGS,\n ATTR_PROCESS_EXECUTABLE_NAME,\n ATTR_PROCESS_EXECUTABLE_PATH,\n ATTR_PROCESS_OWNER,\n ATTR_PROCESS_PID,\n ATTR_PROCESS_RUNTIME_DESCRIPTION,\n ATTR_PROCESS_RUNTIME_NAME,\n ATTR_PROCESS_RUNTIME_VERSION,\n} from '../../../semconv';\nimport * as os from 'os';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { DetectedResource, ResourceDetector } from '../../../types';\n\n/**\n * ProcessDetector will be used to detect the resources related current process running\n * and being instrumented from the NodeJS Process module.\n */\nclass ProcessDetector implements ResourceDetector {\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n const attributes: Attributes = {\n [ATTR_PROCESS_PID]: process.pid,\n [ATTR_PROCESS_EXECUTABLE_NAME]: process.title,\n [ATTR_PROCESS_EXECUTABLE_PATH]: process.execPath,\n [ATTR_PROCESS_COMMAND_ARGS]: [\n process.argv[0],\n ...process.execArgv,\n ...process.argv.slice(1),\n ],\n [ATTR_PROCESS_RUNTIME_VERSION]: process.versions.node,\n [ATTR_PROCESS_RUNTIME_NAME]: 'nodejs',\n [ATTR_PROCESS_RUNTIME_DESCRIPTION]: 'Node.js',\n };\n\n if (process.argv.length > 1) {\n attributes[ATTR_PROCESS_COMMAND] = process.argv[1];\n }\n\n try {\n const userInfo = os.userInfo();\n attributes[ATTR_PROCESS_OWNER] = userInfo.username;\n } catch (e) {\n diag.debug(`error obtaining process owner: ${e}`);\n }\n\n return { attributes };\n }\n}\n\nexport const processDetector = new ProcessDetector();\n"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ServiceInstanceIdDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/ServiceInstanceIdDetector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,8CAA4D;AAC5D,mCAAoC;AAIpC;;GAEG;AACH,MAAM,yBAAyB;IAC7B,MAAM,CAAC,OAAiC;QACtC,OAAO;YACL,UAAU,EAAE;gBACV,CAAC,kCAAwB,CAAC,EAAE,IAAA,mBAAU,GAAE;aACzC;SACF,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACU,QAAA,yBAAyB,GAAG,IAAI,yBAAyB,EAAE,CAAC","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 { ATTR_SERVICE_INSTANCE_ID } from '../../../semconv';\nimport { randomUUID } from 'crypto';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { DetectedResource, ResourceDetector } from '../../../types';\n\n/**\n * ServiceInstanceIdDetector detects the resources related to the service instance ID.\n */\nclass ServiceInstanceIdDetector implements ResourceDetector {\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n return {\n attributes: {\n [ATTR_SERVICE_INSTANCE_ID]: randomUUID(),\n },\n };\n }\n}\n\n/**\n * @experimental\n */\nexport const serviceInstanceIdDetector = new ServiceInstanceIdDetector();\n"]} | ||
| {"version":3,"file":"ServiceInstanceIdDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/ServiceInstanceIdDetector.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,8CAA4D;AAC5D,mCAAoC;AAIpC;;GAEG;AACH,MAAM,yBAAyB;IAC7B,MAAM,CAAC,OAAiC;QACtC,OAAO;YACL,UAAU,EAAE;gBACV,CAAC,kCAAwB,CAAC,EAAE,IAAA,mBAAU,GAAE;aACzC;SACF,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACU,QAAA,yBAAyB,GAAG,IAAI,yBAAyB,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ATTR_SERVICE_INSTANCE_ID } from '../../../semconv';\nimport { randomUUID } from 'crypto';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { DetectedResource, ResourceDetector } from '../../../types';\n\n/**\n * ServiceInstanceIdDetector detects the resources related to the service instance ID.\n */\nclass ServiceInstanceIdDetector implements ResourceDetector {\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n return {\n attributes: {\n [ATTR_SERVICE_INSTANCE_ID]: randomUUID(),\n },\n };\n }\n}\n\n/**\n * @experimental\n */\nexport const serviceInstanceIdDetector = new ServiceInstanceIdDetector();\n"]} |
@@ -6,14 +6,3 @@ "use strict"; | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -20,0 +9,0 @@ const normalizeArch = (nodeArchString) => { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/utils.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACI,MAAM,aAAa,GAAG,CAAC,cAAsB,EAAU,EAAE;IAC9D,0EAA0E;IAC1E,8HAA8H;IAC9H,QAAQ,cAAc,EAAE;QACtB,KAAK,KAAK;YACR,OAAO,OAAO,CAAC;QACjB,KAAK,KAAK;YACR,OAAO,OAAO,CAAC;QACjB,KAAK,KAAK;YACR,OAAO,OAAO,CAAC;QACjB;YACE,OAAO,cAAc,CAAC;KACzB;AACH,CAAC,CAAC;AAbW,QAAA,aAAa,iBAaxB;AAEK,MAAM,aAAa,GAAG,CAAC,YAAoB,EAAU,EAAE;IAC5D,8EAA8E;IAC9E,4HAA4H;IAC5H,QAAQ,YAAY,EAAE;QACpB,KAAK,OAAO;YACV,OAAO,SAAS,CAAC;QACnB,KAAK,OAAO;YACV,OAAO,SAAS,CAAC;QACnB;YACE,OAAO,YAAY,CAAC;KACvB;AACH,CAAC,CAAC;AAXW,QAAA,aAAa,iBAWxB","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 */\nexport const normalizeArch = (nodeArchString: string): string => {\n // Maps from https://nodejs.org/api/os.html#osarch to arch values in spec:\n // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/host.md\n switch (nodeArchString) {\n case 'arm':\n return 'arm32';\n case 'ppc':\n return 'ppc32';\n case 'x64':\n return 'amd64';\n default:\n return nodeArchString;\n }\n};\n\nexport const normalizeType = (nodePlatform: string): string => {\n // Maps from https://nodejs.org/api/os.html#osplatform to arch values in spec:\n // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/os.md\n switch (nodePlatform) {\n case 'sunos':\n return 'solaris';\n case 'win32':\n return 'windows';\n default:\n return nodePlatform;\n }\n};\n"]} | ||
| {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/utils.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACI,MAAM,aAAa,GAAG,CAAC,cAAsB,EAAU,EAAE;IAC9D,0EAA0E;IAC1E,8HAA8H;IAC9H,QAAQ,cAAc,EAAE;QACtB,KAAK,KAAK;YACR,OAAO,OAAO,CAAC;QACjB,KAAK,KAAK;YACR,OAAO,OAAO,CAAC;QACjB,KAAK,KAAK;YACR,OAAO,OAAO,CAAC;QACjB;YACE,OAAO,cAAc,CAAC;KACzB;AACH,CAAC,CAAC;AAbW,QAAA,aAAa,iBAaxB;AAEK,MAAM,aAAa,GAAG,CAAC,YAAoB,EAAU,EAAE;IAC5D,8EAA8E;IAC9E,4HAA4H;IAC5H,QAAQ,YAAY,EAAE;QACpB,KAAK,OAAO;YACV,OAAO,SAAS,CAAC;QACnB,KAAK,OAAO;YACV,OAAO,SAAS,CAAC;QACnB;YACE,OAAO,YAAY,CAAC;KACvB;AACH,CAAC,CAAC;AAXW,QAAA,aAAa,iBAWxB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport const normalizeArch = (nodeArchString: string): string => {\n // Maps from https://nodejs.org/api/os.html#osarch to arch values in spec:\n // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/host.md\n switch (nodeArchString) {\n case 'arm':\n return 'arm32';\n case 'ppc':\n return 'ppc32';\n case 'x64':\n return 'amd64';\n default:\n return nodeArchString;\n }\n};\n\nexport const normalizeType = (nodePlatform: string): string => {\n // Maps from https://nodejs.org/api/os.html#osplatform to arch values in spec:\n // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/os.md\n switch (nodePlatform) {\n case 'sunos':\n return 'solaris';\n case 'win32':\n return 'windows';\n default:\n return nodePlatform;\n }\n};\n"]} |
+1
-12
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,uDAAqD;AAA5C,mHAAA,eAAe,OAAA;AACxB,yCAMqB;AALnB,wGAAA,WAAW,OAAA;AACX,yGAAA,YAAY,OAAA;AACZ,uGAAA,UAAU,OAAA;AACV,4GAAA,eAAe,OAAA;AACf,sHAAA,yBAAyB,OAAA;AAG3B,+CAIwB;AAHtB,sHAAA,sBAAsB,OAAA;AACtB,+GAAA,eAAe,OAAA;AACf,6GAAA,aAAa,OAAA;AAEf,+DAA4D;AAAnD,0HAAA,kBAAkB,OAAA","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\nexport type { ResourceDetectionConfig } from './config';\nexport { detectResources } from './detect-resources';\nexport {\n envDetector,\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './detectors';\nexport type { Resource } from './Resource';\nexport {\n resourceFromAttributes,\n defaultResource,\n emptyResource,\n} from './ResourceImpl';\nexport { defaultServiceName } from './default-service-name';\nexport type {\n ResourceDetector,\n DetectedResource,\n DetectedResourceAttributes,\n RawResourceAttribute,\n MaybePromise,\n} from './types';\n"]} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,uDAAqD;AAA5C,mHAAA,eAAe,OAAA;AACxB,yCAMqB;AALnB,wGAAA,WAAW,OAAA;AACX,yGAAA,YAAY,OAAA;AACZ,uGAAA,UAAU,OAAA;AACV,4GAAA,eAAe,OAAA;AACf,sHAAA,yBAAyB,OAAA;AAG3B,+CAIwB;AAHtB,sHAAA,sBAAsB,OAAA;AACtB,+GAAA,eAAe,OAAA;AACf,6GAAA,aAAa,OAAA;AAEf,+DAA4D;AAAnD,0HAAA,kBAAkB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport type { ResourceDetectionConfig } from './config';\nexport { detectResources } from './detect-resources';\nexport {\n envDetector,\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './detectors';\nexport type { Resource } from './Resource';\nexport {\n resourceFromAttributes,\n defaultResource,\n emptyResource,\n} from './ResourceImpl';\nexport { defaultServiceName } from './default-service-name';\nexport type {\n ResourceDetector,\n DetectedResource,\n DetectedResourceAttributes,\n RawResourceAttribute,\n MaybePromise,\n} from './types';\n"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| //# sourceMappingURL=Resource.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"Resource.js","sourceRoot":"","sources":["../../src/Resource.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","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 { Attributes } from '@opentelemetry/api';\nimport { RawResourceAttribute } from './types';\n\n/**\n * An interface that represents a resource. A Resource describes the entity for which signals (metrics or trace) are\n * collected.\n *\n * This interface is NOT user-implementable. Valid ways to obtain a {@link Resource} are by using either of these functions\n * - {@link resourceFromAttributes}\n * - {@link emptyResource}\n * - {@link defaultResource}\n * - {@link detectResources}\n */\nexport interface Resource {\n /**\n * Check if async attributes have resolved. This is useful to avoid awaiting\n * waitForAsyncAttributes (which will introduce asynchronous behavior) when not necessary.\n *\n * @returns true if the resource \"attributes\" property is not yet settled to its final value\n */\n readonly asyncAttributesPending?: boolean;\n\n /**\n * @returns the Resource's attributes.\n */\n readonly attributes: Attributes;\n\n /**\n * @returns the Resource's schema URL or undefined if not set.\n */\n readonly schemaUrl?: string;\n\n /**\n * Returns a promise that will never be rejected. Resolves when all async attributes have finished being added to\n * this Resource's attributes. This is useful in exporters to block until resource detection\n * has finished.\n */\n waitForAsyncAttributes?(): Promise<void>;\n\n /**\n * Returns a new, merged {@link Resource} by merging the current Resource\n * with the other Resource. In case of a collision, other Resource takes\n * precedence.\n *\n * @param other the Resource that will be merged with this.\n * @returns the newly merged Resource.\n */\n merge(other: Resource | null): Resource;\n\n getRawAttributes(): RawResourceAttribute[];\n}\n"]} | ||
| {"version":3,"file":"Resource.js","sourceRoot":"","sources":["../../src/Resource.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Attributes } from '@opentelemetry/api';\nimport { RawResourceAttribute } from './types';\n\n/**\n * An interface that represents a resource. A Resource describes the entity for which signals (metrics or trace) are\n * collected.\n *\n * This interface is NOT user-implementable. Valid ways to obtain a {@link Resource} are by using either of these functions\n * - {@link resourceFromAttributes}\n * - {@link emptyResource}\n * - {@link defaultResource}\n * - {@link detectResources}\n */\nexport interface Resource {\n /**\n * Check if async attributes have resolved. This is useful to avoid awaiting\n * waitForAsyncAttributes (which will introduce asynchronous behavior) when not necessary.\n *\n * @returns true if the resource \"attributes\" property is not yet settled to its final value\n */\n readonly asyncAttributesPending?: boolean;\n\n /**\n * @returns the Resource's attributes.\n */\n readonly attributes: Attributes;\n\n /**\n * @returns the Resource's schema URL or undefined if not set.\n */\n readonly schemaUrl?: string;\n\n /**\n * Returns a promise that will never be rejected. Resolves when all async attributes have finished being added to\n * this Resource's attributes. This is useful in exporters to block until resource detection\n * has finished.\n */\n waitForAsyncAttributes?(): Promise<void>;\n\n /**\n * Returns a new, merged {@link Resource} by merging the current Resource\n * with the other Resource. In case of a collision, other Resource takes\n * precedence.\n *\n * @param other the Resource that will be merged with this.\n * @returns the newly merged Resource.\n */\n merge(other: Resource | null): Resource;\n\n getRawAttributes(): RawResourceAttribute[];\n}\n"]} |
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ResourceImpl.js","sourceRoot":"","sources":["../../src/ResourceImpl.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAAsE;AACtE,8CAA+C;AAC/C,8EAK6C;AAE7C,iEAA4D;AAQ5D,mCAAwC;AAExC,MAAM,YAAY;IACR,cAAc,CAAy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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 { Attributes, AttributeValue, diag } from '@opentelemetry/api';\nimport { SDK_INFO } from '@opentelemetry/core';\nimport {\n ATTR_SERVICE_NAME,\n ATTR_TELEMETRY_SDK_LANGUAGE,\n ATTR_TELEMETRY_SDK_NAME,\n ATTR_TELEMETRY_SDK_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { Resource } from './Resource';\nimport { defaultServiceName } from './default-service-name';\nimport {\n DetectedResource,\n DetectedResourceAttributes,\n MaybePromise,\n RawResourceAttribute,\n ResourceOptions,\n} from './types';\nimport { isPromiseLike } from './utils';\n\nclass ResourceImpl implements Resource {\n private _rawAttributes: RawResourceAttribute[];\n private _asyncAttributesPending = false;\n private _schemaUrl?: string;\n\n private _memoizedAttributes?: Attributes;\n\n static FromAttributeList(\n attributes: [string, MaybePromise<AttributeValue | undefined>][],\n options?: ResourceOptions\n ): Resource {\n const res = new ResourceImpl({}, options);\n res._rawAttributes = guardedRawAttributes(attributes);\n res._asyncAttributesPending =\n attributes.filter(([_, val]) => isPromiseLike(val)).length > 0;\n return res;\n }\n\n constructor(\n /**\n * A dictionary of attributes with string keys and values that provide\n * information about the entity as numbers, strings or booleans\n * TODO: Consider to add check/validation on attributes.\n */\n resource: DetectedResource,\n options?: ResourceOptions\n ) {\n const attributes = resource.attributes ?? {};\n this._rawAttributes = Object.entries(attributes).map(([k, v]) => {\n if (isPromiseLike(v)) {\n // side-effect\n this._asyncAttributesPending = true;\n }\n\n return [k, v];\n });\n\n this._rawAttributes = guardedRawAttributes(this._rawAttributes);\n this._schemaUrl = validateSchemaUrl(options?.schemaUrl);\n }\n\n public get asyncAttributesPending(): boolean {\n return this._asyncAttributesPending;\n }\n\n public async waitForAsyncAttributes(): Promise<void> {\n if (!this.asyncAttributesPending) {\n return;\n }\n\n for (let i = 0; i < this._rawAttributes.length; i++) {\n const [k, v] = this._rawAttributes[i];\n this._rawAttributes[i] = [k, isPromiseLike(v) ? await v : v];\n }\n\n this._asyncAttributesPending = false;\n }\n\n public get attributes(): Attributes {\n if (this.asyncAttributesPending) {\n diag.error(\n 'Accessing resource attributes before async attributes settled'\n );\n }\n\n if (this._memoizedAttributes) {\n return this._memoizedAttributes;\n }\n\n const attrs: Attributes = {};\n for (const [k, v] of this._rawAttributes) {\n if (isPromiseLike(v)) {\n diag.debug(`Unsettled resource attribute ${k} skipped`);\n continue;\n }\n if (v != null) {\n attrs[k] ??= v;\n }\n }\n\n // only memoize output if all attributes are settled\n if (!this._asyncAttributesPending) {\n this._memoizedAttributes = attrs;\n }\n\n return attrs;\n }\n\n public getRawAttributes(): RawResourceAttribute[] {\n return this._rawAttributes;\n }\n\n public get schemaUrl(): string | undefined {\n return this._schemaUrl;\n }\n\n public merge(resource: Resource | null): Resource {\n if (resource == null) return this;\n\n // Order is important\n // Spec states incoming attributes override existing attributes\n const mergedSchemaUrl = mergeSchemaUrl(this, resource);\n const mergedOptions: ResourceOptions | undefined = mergedSchemaUrl\n ? { schemaUrl: mergedSchemaUrl }\n : undefined;\n\n return ResourceImpl.FromAttributeList(\n [...resource.getRawAttributes(), ...this.getRawAttributes()],\n mergedOptions\n );\n }\n}\n\nexport function resourceFromAttributes(\n attributes: DetectedResourceAttributes,\n options?: ResourceOptions\n): Resource {\n return ResourceImpl.FromAttributeList(Object.entries(attributes), options);\n}\n\nexport function resourceFromDetectedResource(\n detectedResource: DetectedResource,\n options?: ResourceOptions\n): Resource {\n return new ResourceImpl(detectedResource, options);\n}\n\nexport function emptyResource(): Resource {\n return resourceFromAttributes({});\n}\n\nexport function defaultResource(): Resource {\n return resourceFromAttributes({\n [ATTR_SERVICE_NAME]: defaultServiceName(),\n [ATTR_TELEMETRY_SDK_LANGUAGE]: SDK_INFO[ATTR_TELEMETRY_SDK_LANGUAGE],\n [ATTR_TELEMETRY_SDK_NAME]: SDK_INFO[ATTR_TELEMETRY_SDK_NAME],\n [ATTR_TELEMETRY_SDK_VERSION]: SDK_INFO[ATTR_TELEMETRY_SDK_VERSION],\n });\n}\n\nfunction guardedRawAttributes(\n attributes: RawResourceAttribute[]\n): RawResourceAttribute[] {\n return attributes.map(([k, v]) => {\n if (isPromiseLike(v)) {\n return [\n k,\n v.catch(err => {\n diag.debug(\n 'promise rejection for resource attribute: %s - %s',\n k,\n err\n );\n return undefined;\n }),\n ];\n }\n return [k, v];\n });\n}\n\nfunction validateSchemaUrl(schemaUrl?: string): string | undefined {\n if (typeof schemaUrl === 'string' || schemaUrl === undefined) {\n return schemaUrl;\n }\n\n diag.warn(\n 'Schema URL must be string or undefined, got %s. Schema URL will be ignored.',\n schemaUrl\n );\n\n return undefined;\n}\n\nfunction mergeSchemaUrl(\n old: Resource,\n updating: Resource | null\n): string | undefined {\n const oldSchemaUrl = old?.schemaUrl;\n const updatingSchemaUrl = updating?.schemaUrl;\n\n const isOldEmpty = oldSchemaUrl === undefined || oldSchemaUrl === '';\n const isUpdatingEmpty =\n updatingSchemaUrl === undefined || updatingSchemaUrl === '';\n\n if (isOldEmpty) {\n return updatingSchemaUrl;\n }\n\n if (isUpdatingEmpty) {\n return oldSchemaUrl;\n }\n\n if (oldSchemaUrl === updatingSchemaUrl) {\n return oldSchemaUrl;\n }\n\n diag.warn(\n 'Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.',\n oldSchemaUrl,\n updatingSchemaUrl\n );\n\n return undefined;\n}\n"]} | ||
| {"version":3,"file":"ResourceImpl.js","sourceRoot":"","sources":["../../src/ResourceImpl.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4CAAsE;AACtE,8CAA+C;AAC/C,8E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IAEF,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Attributes, AttributeValue, diag } from '@opentelemetry/api';\nimport { SDK_INFO } from '@opentelemetry/core';\nimport {\n ATTR_SERVICE_NAME,\n ATTR_TELEMETRY_SDK_LANGUAGE,\n ATTR_TELEMETRY_SDK_NAME,\n ATTR_TELEMETRY_SDK_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { Resource } from './Resource';\nimport { defaultServiceName } from './default-service-name';\nimport {\n DetectedResource,\n DetectedResourceAttributes,\n MaybePromise,\n RawResourceAttribute,\n ResourceOptions,\n} from './types';\nimport { isPromiseLike } from './utils';\n\nclass ResourceImpl implements Resource {\n private _rawAttributes: RawResourceAttribute[];\n private _asyncAttributesPending = false;\n private _schemaUrl?: string;\n\n private _memoizedAttributes?: Attributes;\n\n static FromAttributeList(\n attributes: [string, MaybePromise<AttributeValue | undefined>][],\n options?: ResourceOptions\n ): Resource {\n const res = new ResourceImpl({}, options);\n res._rawAttributes = guardedRawAttributes(attributes);\n res._asyncAttributesPending =\n attributes.filter(([_, val]) => isPromiseLike(val)).length > 0;\n return res;\n }\n\n constructor(\n /**\n * A dictionary of attributes with string keys and values that provide\n * information about the entity as numbers, strings or booleans\n * TODO: Consider to add check/validation on attributes.\n */\n resource: DetectedResource,\n options?: ResourceOptions\n ) {\n const attributes = resource.attributes ?? {};\n this._rawAttributes = Object.entries(attributes).map(([k, v]) => {\n if (isPromiseLike(v)) {\n // side-effect\n this._asyncAttributesPending = true;\n }\n\n return [k, v];\n });\n\n this._rawAttributes = guardedRawAttributes(this._rawAttributes);\n this._schemaUrl = validateSchemaUrl(options?.schemaUrl);\n }\n\n public get asyncAttributesPending(): boolean {\n return this._asyncAttributesPending;\n }\n\n public async waitForAsyncAttributes(): Promise<void> {\n if (!this.asyncAttributesPending) {\n return;\n }\n\n for (let i = 0; i < this._rawAttributes.length; i++) {\n const [k, v] = this._rawAttributes[i];\n this._rawAttributes[i] = [k, isPromiseLike(v) ? await v : v];\n }\n\n this._asyncAttributesPending = false;\n }\n\n public get attributes(): Attributes {\n if (this.asyncAttributesPending) {\n diag.error(\n 'Accessing resource attributes before async attributes settled'\n );\n }\n\n if (this._memoizedAttributes) {\n return this._memoizedAttributes;\n }\n\n const attrs: Attributes = {};\n for (const [k, v] of this._rawAttributes) {\n if (isPromiseLike(v)) {\n diag.debug(`Unsettled resource attribute ${k} skipped`);\n continue;\n }\n if (v != null) {\n attrs[k] ??= v;\n }\n }\n\n // only memoize output if all attributes are settled\n if (!this._asyncAttributesPending) {\n this._memoizedAttributes = attrs;\n }\n\n return attrs;\n }\n\n public getRawAttributes(): RawResourceAttribute[] {\n return this._rawAttributes;\n }\n\n public get schemaUrl(): string | undefined {\n return this._schemaUrl;\n }\n\n public merge(resource: Resource | null): Resource {\n if (resource == null) return this;\n\n // Order is important\n // Spec states incoming attributes override existing attributes\n const mergedSchemaUrl = mergeSchemaUrl(this, resource);\n const mergedOptions: ResourceOptions | undefined = mergedSchemaUrl\n ? { schemaUrl: mergedSchemaUrl }\n : undefined;\n\n return ResourceImpl.FromAttributeList(\n [...resource.getRawAttributes(), ...this.getRawAttributes()],\n mergedOptions\n );\n }\n}\n\nexport function resourceFromAttributes(\n attributes: DetectedResourceAttributes,\n options?: ResourceOptions\n): Resource {\n return ResourceImpl.FromAttributeList(Object.entries(attributes), options);\n}\n\nexport function resourceFromDetectedResource(\n detectedResource: DetectedResource,\n options?: ResourceOptions\n): Resource {\n return new ResourceImpl(detectedResource, options);\n}\n\nexport function emptyResource(): Resource {\n return resourceFromAttributes({});\n}\n\nexport function defaultResource(): Resource {\n return resourceFromAttributes({\n [ATTR_SERVICE_NAME]: defaultServiceName(),\n [ATTR_TELEMETRY_SDK_LANGUAGE]: SDK_INFO[ATTR_TELEMETRY_SDK_LANGUAGE],\n [ATTR_TELEMETRY_SDK_NAME]: SDK_INFO[ATTR_TELEMETRY_SDK_NAME],\n [ATTR_TELEMETRY_SDK_VERSION]: SDK_INFO[ATTR_TELEMETRY_SDK_VERSION],\n });\n}\n\nfunction guardedRawAttributes(\n attributes: RawResourceAttribute[]\n): RawResourceAttribute[] {\n return attributes.map(([k, v]) => {\n if (isPromiseLike(v)) {\n return [\n k,\n v.catch(err => {\n diag.debug(\n 'promise rejection for resource attribute: %s - %s',\n k,\n err\n );\n return undefined;\n }),\n ];\n }\n return [k, v];\n });\n}\n\nfunction validateSchemaUrl(schemaUrl?: string): string | undefined {\n if (typeof schemaUrl === 'string' || schemaUrl === undefined) {\n return schemaUrl;\n }\n\n diag.warn(\n 'Schema URL must be string or undefined, got %s. Schema URL will be ignored.',\n schemaUrl\n );\n\n return undefined;\n}\n\nfunction mergeSchemaUrl(\n old: Resource,\n updating: Resource | null\n): string | undefined {\n const oldSchemaUrl = old?.schemaUrl;\n const updatingSchemaUrl = updating?.schemaUrl;\n\n const isOldEmpty = oldSchemaUrl === undefined || oldSchemaUrl === '';\n const isUpdatingEmpty =\n updatingSchemaUrl === undefined || updatingSchemaUrl === '';\n\n if (isOldEmpty) {\n return updatingSchemaUrl;\n }\n\n if (isUpdatingEmpty) {\n return oldSchemaUrl;\n }\n\n if (oldSchemaUrl === updatingSchemaUrl) {\n return oldSchemaUrl;\n }\n\n diag.warn(\n 'Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.',\n oldSchemaUrl,\n updatingSchemaUrl\n );\n\n return undefined;\n}\n"]} |
+1
-12
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;GAIG;AAEH;;;;;;;GAOG;AACU,QAAA,qBAAqB,GAAG,kBAA2B,CAAC;AAEjE;;;;;;;;GAQG;AACU,QAAA,4BAA4B,GAAG,yBAAkC,CAAC;AAE/E;;;;GAIG;AACU,QAAA,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;;;;GASG;AACU,QAAA,iBAAiB,GAAG,cAAuB,CAAC;AAEzD;;;;;;GAMG;AACU,QAAA,iBAAiB,GAAG,cAAuB,CAAC;AAEzD;;;;;;GAMG;AACU,QAAA,yBAAyB,GAAG,sBAA+B,CAAC;AAEzE;;;;;;GAMG;AACU,QAAA,yBAAyB,GAAG,sBAA+B,CAAC;AAEzE;;;;;;GAMG;AACU,QAAA,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;GAIG;AACU,QAAA,cAAc,GAAG,WAAoB,CAAC;AAEnD;;;;;;GAMG;AACU,QAAA,YAAY,GAAG,SAAkB,CAAC;AAE/C;;;;;;GAMG;AACU,QAAA,kBAAkB,GAAG,eAAwB,CAAC;AAE3D;;;;;;;GAOG;AACU,QAAA,oBAAoB,GAAG,iBAA0B,CAAC;AAE/D;;;;;;GAMG;AACU,QAAA,uBAAuB,GAAG,oBAA6B,CAAC;AAErE;;;;;;GAMG;AACU,QAAA,cAAc,GAAG,WAAoB,CAAC;AAEnD;;;;;;GAMG;AACU,QAAA,cAAc,GAAG,WAAoB,CAAC;AAEnD;;;;;;GAMG;AACU,QAAA,qBAAqB,GAAG,kBAA2B,CAAC;AAEjE;;;;;;GAMG;AACU,QAAA,wBAAwB,GAAG,qBAA8B,CAAC;AAEvE;;;;;;GAMG;AACU,QAAA,uBAAuB,GAAG,oBAA6B,CAAC;AAErE;;;;;;GAMG;AACU,QAAA,iBAAiB,GAAG,cAAuB,CAAC;AAEzD;;;;GAIG;AACU,QAAA,YAAY,GAAG,SAAkB,CAAC;AAE/C;;;;;;;GAOG;AACU,QAAA,eAAe,GAAG,YAAqB,CAAC;AAErD;;;;;;GAMG;AACU,QAAA,oBAAoB,GAAG,iBAA0B,CAAC;AAE/D;;;;;;GAMG;AACU,QAAA,yBAAyB,GAAG,sBAA+B,CAAC;AAEzE;;;;;;GAMG;AACU,QAAA,4BAA4B,GAAG,yBAAkC,CAAC;AAE/E;;;;;;GAMG;AACU,QAAA,4BAA4B,GAAG,yBAAkC,CAAC;AAE/E;;;;;;GAMG;AACU,QAAA,kBAAkB,GAAG,eAAwB,CAAC;AAE3D;;;;;;GAMG;AACU,QAAA,gBAAgB,GAAG,aAAsB,CAAC;AAEvD;;;;;;GAMG;AACU,QAAA,gCAAgC,GAC3C,6BAAsC,CAAC;AAEzC;;;;;;GAMG;AACU,QAAA,yBAAyB,GAAG,sBAA+B,CAAC;AAEzE;;;;;;GAMG;AACU,QAAA,4BAA4B,GAAG,yBAAkC,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACU,QAAA,wBAAwB,GAAG,qBAA8B,CAAC;AAEvE;;;;;;;;GAQG;AACU,QAAA,sBAAsB,GAAG,mBAA4B,CAAC;AAEnE;;;;;;GAMG;AACU,QAAA,0BAA0B,GAAG,uBAAgC,CAAC;AAE3E;;;;;;GAMG;AACU,QAAA,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;GAMG;AACU,QAAA,sBAAsB,GAAG,mBAA4B,CAAC","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\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * The cloud account ID the resource is assigned to.\n *\n * @example 111111111111\n * @example opentelemetry\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_ACCOUNT_ID = 'cloud.account.id' as const;\n\n/**\n * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.\n *\n * @example us-east-1c\n *\n * @note Availability zones are called \"zones\" on Alibaba Cloud and Google Cloud.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_AVAILABILITY_ZONE = 'cloud.availability_zone' as const;\n\n/**\n * Name of the cloud provider.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_PROVIDER = 'cloud.provider' as const;\n\n/**\n * The geographical region the resource is running.\n *\n * @example us-central1\n * @example us-east-1\n *\n * @note Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091).\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_REGION = 'cloud.region' as const;\n\n/**\n * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated.\n *\n * @example a3bf90e006b2\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_ID = 'container.id' as const;\n\n/**\n * Name of the image the container was built on.\n *\n * @example gcr.io/opentelemetry/operator\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_IMAGE_NAME = 'container.image.name' as const;\n\n/**\n * Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `<tag>` section of the full name for example from `registry.example.com/my-org/my-image:<tag>`.\n *\n * @example [\"v1.27.1\", \"3.5.7-0\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_IMAGE_TAGS = 'container.image.tags' as const;\n\n/**\n * Container name used by container runtime.\n *\n * @example opentelemetry-autoconf\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_NAME = 'container.name' as const;\n\n/**\n * The CPU architecture the host system is running on.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_ARCH = 'host.arch' as const;\n\n/**\n * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system.\n *\n * @example fdbf79e8af94cb7f9e8df36789187052\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_ID = 'host.id' as const;\n\n/**\n * VM image ID or host OS image ID. For Cloud, this value is from the provider.\n *\n * @example ami-07b06b442921831e5\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_IMAGE_ID = 'host.image.id' as const;\n\n/**\n * Name of the VM image or OS install the host was instantiated from.\n *\n * @example infra-ami-eks-worker-node-7d4ec78312\n * @example CentOS-8-x86_64-1905\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_IMAGE_NAME = 'host.image.name' as const;\n\n/**\n * The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes).\n *\n * @example 0.1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_IMAGE_VERSION = 'host.image.version' as const;\n\n/**\n * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user.\n *\n * @example opentelemetry-test\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_NAME = 'host.name' as const;\n\n/**\n * Type of host. For Cloud, this must be the machine type.\n *\n * @example n1-standard-1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_TYPE = 'host.type' as const;\n\n/**\n * The name of the cluster.\n *\n * @example opentelemetry-cluster\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_CLUSTER_NAME = 'k8s.cluster.name' as const;\n\n/**\n * The name of the Deployment.\n *\n * @example opentelemetry\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_DEPLOYMENT_NAME = 'k8s.deployment.name' as const;\n\n/**\n * The name of the namespace that the pod is running in.\n *\n * @example default\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_NAMESPACE_NAME = 'k8s.namespace.name' as const;\n\n/**\n * The name of the Pod.\n *\n * @example opentelemetry-pod-autoconf\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_POD_NAME = 'k8s.pod.name' as const;\n\n/**\n * The operating system type.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OS_TYPE = 'os.type' as const;\n\n/**\n * The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes).\n *\n * @example 14.2.1\n * @example 18.04.1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OS_VERSION = 'os.version' as const;\n\n/**\n * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`.\n *\n * @example cmd/otelcol\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_COMMAND = 'process.command' as const;\n\n/**\n * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`.\n *\n * @example [\"cmd/otecol\", \"--config=config.yaml\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_COMMAND_ARGS = 'process.command_args' as const;\n\n/**\n * The name of the process executable. On Linux based systems, this **SHOULD** be set to the base name of the target of `/proc/[pid]/exe`. On Windows, this **SHOULD** be set to the base name of `GetProcessImageFileNameW`.\n *\n * @example otelcol\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_EXECUTABLE_NAME = 'process.executable.name' as const;\n\n/**\n * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`.\n *\n * @example /usr/bin/cmd/otelcol\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_EXECUTABLE_PATH = 'process.executable.path' as const;\n\n/**\n * The username of the user that owns the process.\n *\n * @example root\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_OWNER = 'process.owner' as const;\n\n/**\n * Process identifier (PID).\n *\n * @example 1234\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_PID = 'process.pid' as const;\n\n/**\n * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment.\n *\n * @example \"Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_DESCRIPTION =\n 'process.runtime.description' as const;\n\n/**\n * The name of the runtime of this process.\n *\n * @example OpenJDK Runtime Environment\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_NAME = 'process.runtime.name' as const;\n\n/**\n * The version of the runtime of this process, as returned by the runtime without modification.\n *\n * @example \"14.0.2\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_VERSION = 'process.runtime.version' as const;\n\n/**\n * The string ID of the service instance.\n *\n * @example 627cc493-f310-47de-96bd-71410b7dec09\n *\n * @note **MUST** be unique for each instance of the same `service.namespace,service.name` pair (in other words\n * `service.namespace,service.name,service.instance.id` triplet **MUST** be globally unique). The ID helps to\n * distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled\n * service).\n *\n * Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC\n * 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of\n * this value if stability is desirable. In that case, the ID **SHOULD** be used as source of a UUID Version 5 and\n * **SHOULD** use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`.\n *\n * UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is\n * needed. Similar to what can be seen in the man page for the\n * [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/latest/machine-id.html) file, the underlying\n * data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it\n * or not via another resource attribute.\n *\n * For applications running behind an application server (like unicorn), we do not recommend using one identifier\n * for all processes participating in the application. Instead, it's recommended each division (e.g. a worker\n * thread in unicorn) to have its own instance.id.\n *\n * It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the\n * service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will\n * likely be wrong, as the Collector might not know from which container within that pod the telemetry originated.\n * However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance\n * for that telemetry. This is typically the case for scraping receivers, as they know the target address and\n * port.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_SERVICE_INSTANCE_ID = 'service.instance.id' as const;\n\n/**\n * A namespace for `service.name`.\n *\n * @example Shop\n *\n * @note A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_SERVICE_NAMESPACE = 'service.namespace' as const;\n\n/**\n * Additional description of the web engine (e.g. detailed version and edition information).\n *\n * @example WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_WEBENGINE_DESCRIPTION = 'webengine.description' as const;\n\n/**\n * The name of the web engine.\n *\n * @example WildFly\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_WEBENGINE_NAME = 'webengine.name' as const;\n\n/**\n * The version of the web engine.\n *\n * @example 21.0.0\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_WEBENGINE_VERSION = 'webengine.version' as const;\n"]} | ||
| {"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;GAIG;AAEH;;;;;;;GAOG;AACU,QAAA,qBAAqB,GAAG,kBAA2B,CAAC;AAEjE;;;;;;;;GAQG;AACU,QAAA,4BAA4B,GAAG,yBAAkC,CAAC;AAE/E;;;;GAIG;AACU,QAAA,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;;;;GASG;AACU,QAAA,iBAAiB,GAAG,cAAuB,CAAC;AAEzD;;;;;;GAMG;AACU,QAAA,iBAAiB,GAAG,cAAuB,CAAC;AAEzD;;;;;;GAMG;AACU,QAAA,yBAAyB,GAAG,sBAA+B,CAAC;AAEzE;;;;;;GAMG;AACU,QAAA,yBAAyB,GAAG,sBAA+B,CAAC;AAEzE;;;;;;GAMG;AACU,QAAA,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;GAIG;AACU,QAAA,cAAc,GAAG,WAAoB,CAAC;AAEnD;;;;;;GAMG;AACU,QAAA,YAAY,GAAG,SAAkB,CAAC;AAE/C;;;;;;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AAC;AAEvE;;;;;;;;GAQG;AACU,QAAA,sBAAsB,GAAG,mBAA4B,CAAC;AAEnE;;;;;;GAMG;AACU,QAAA,0BAA0B,GAAG,uBAAgC,CAAC;AAE3E;;;;;;GAMG;AACU,QAAA,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;GAMG;AACU,QAAA,sBAAsB,GAAG,mBAA4B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * The cloud account ID the resource is assigned to.\n *\n * @example 111111111111\n * @example opentelemetry\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_ACCOUNT_ID = 'cloud.account.id' as const;\n\n/**\n * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.\n *\n * @example us-east-1c\n *\n * @note Availability zones are called \"zones\" on Alibaba Cloud and Google Cloud.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_AVAILABILITY_ZONE = 'cloud.availability_zone' as const;\n\n/**\n * Name of the cloud provider.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_PROVIDER = 'cloud.provider' as const;\n\n/**\n * The geographical region the resource is running.\n *\n * @example us-central1\n * @example us-east-1\n *\n * @note Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091).\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_REGION = 'cloud.region' as const;\n\n/**\n * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated.\n *\n * @example a3bf90e006b2\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_ID = 'container.id' as const;\n\n/**\n * Name of the image the container was built on.\n *\n * @example gcr.io/opentelemetry/operator\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_IMAGE_NAME = 'container.image.name' as const;\n\n/**\n * Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `<tag>` section of the full name for example from `registry.example.com/my-org/my-image:<tag>`.\n *\n * @example [\"v1.27.1\", \"3.5.7-0\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_IMAGE_TAGS = 'container.image.tags' as const;\n\n/**\n * Container name used by container runtime.\n *\n * @example opentelemetry-autoconf\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CONTAINER_NAME = 'container.name' as const;\n\n/**\n * The CPU architecture the host system is running on.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_ARCH = 'host.arch' as const;\n\n/**\n * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system.\n *\n * @example fdbf79e8af94cb7f9e8df36789187052\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_ID = 'host.id' as const;\n\n/**\n * VM image ID or host OS image ID. For Cloud, this value is from the provider.\n *\n * @example ami-07b06b442921831e5\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_IMAGE_ID = 'host.image.id' as const;\n\n/**\n * Name of the VM image or OS install the host was instantiated from.\n *\n * @example infra-ami-eks-worker-node-7d4ec78312\n * @example CentOS-8-x86_64-1905\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_IMAGE_NAME = 'host.image.name' as const;\n\n/**\n * The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes).\n *\n * @example 0.1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_IMAGE_VERSION = 'host.image.version' as const;\n\n/**\n * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user.\n *\n * @example opentelemetry-test\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_NAME = 'host.name' as const;\n\n/**\n * Type of host. For Cloud, this must be the machine type.\n *\n * @example n1-standard-1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_TYPE = 'host.type' as const;\n\n/**\n * The name of the cluster.\n *\n * @example opentelemetry-cluster\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_CLUSTER_NAME = 'k8s.cluster.name' as const;\n\n/**\n * The name of the Deployment.\n *\n * @example opentelemetry\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_DEPLOYMENT_NAME = 'k8s.deployment.name' as const;\n\n/**\n * The name of the namespace that the pod is running in.\n *\n * @example default\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_NAMESPACE_NAME = 'k8s.namespace.name' as const;\n\n/**\n * The name of the Pod.\n *\n * @example opentelemetry-pod-autoconf\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_POD_NAME = 'k8s.pod.name' as const;\n\n/**\n * The operating system type.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OS_TYPE = 'os.type' as const;\n\n/**\n * The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes).\n *\n * @example 14.2.1\n * @example 18.04.1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OS_VERSION = 'os.version' as const;\n\n/**\n * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`.\n *\n * @example cmd/otelcol\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_COMMAND = 'process.command' as const;\n\n/**\n * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`.\n *\n * @example [\"cmd/otecol\", \"--config=config.yaml\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_COMMAND_ARGS = 'process.command_args' as const;\n\n/**\n * The name of the process executable. On Linux based systems, this **SHOULD** be set to the base name of the target of `/proc/[pid]/exe`. On Windows, this **SHOULD** be set to the base name of `GetProcessImageFileNameW`.\n *\n * @example otelcol\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_EXECUTABLE_NAME = 'process.executable.name' as const;\n\n/**\n * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`.\n *\n * @example /usr/bin/cmd/otelcol\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_EXECUTABLE_PATH = 'process.executable.path' as const;\n\n/**\n * The username of the user that owns the process.\n *\n * @example root\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_OWNER = 'process.owner' as const;\n\n/**\n * Process identifier (PID).\n *\n * @example 1234\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_PID = 'process.pid' as const;\n\n/**\n * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment.\n *\n * @example \"Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_DESCRIPTION =\n 'process.runtime.description' as const;\n\n/**\n * The name of the runtime of this process.\n *\n * @example OpenJDK Runtime Environment\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_NAME = 'process.runtime.name' as const;\n\n/**\n * The version of the runtime of this process, as returned by the runtime without modification.\n *\n * @example \"14.0.2\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_VERSION = 'process.runtime.version' as const;\n\n/**\n * The string ID of the service instance.\n *\n * @example 627cc493-f310-47de-96bd-71410b7dec09\n *\n * @note **MUST** be unique for each instance of the same `service.namespace,service.name` pair (in other words\n * `service.namespace,service.name,service.instance.id` triplet **MUST** be globally unique). The ID helps to\n * distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled\n * service).\n *\n * Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC\n * 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of\n * this value if stability is desirable. In that case, the ID **SHOULD** be used as source of a UUID Version 5 and\n * **SHOULD** use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`.\n *\n * UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is\n * needed. Similar to what can be seen in the man page for the\n * [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/latest/machine-id.html) file, the underlying\n * data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it\n * or not via another resource attribute.\n *\n * For applications running behind an application server (like unicorn), we do not recommend using one identifier\n * for all processes participating in the application. Instead, it's recommended each division (e.g. a worker\n * thread in unicorn) to have its own instance.id.\n *\n * It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the\n * service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will\n * likely be wrong, as the Collector might not know from which container within that pod the telemetry originated.\n * However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance\n * for that telemetry. This is typically the case for scraping receivers, as they know the target address and\n * port.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_SERVICE_INSTANCE_ID = 'service.instance.id' as const;\n\n/**\n * A namespace for `service.name`.\n *\n * @example Shop\n *\n * @note A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_SERVICE_NAMESPACE = 'service.namespace' as const;\n\n/**\n * Additional description of the web engine (e.g. detailed version and edition information).\n *\n * @example WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_WEBENGINE_DESCRIPTION = 'webengine.description' as const;\n\n/**\n * The name of the web engine.\n *\n * @example WildFly\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_WEBENGINE_NAME = 'webengine.name' as const;\n\n/**\n * The version of the web engine.\n *\n * @example 21.0.0\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_WEBENGINE_VERSION = 'webengine.version' as const;\n"]} |
+1
-12
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| //# sourceMappingURL=types.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","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 { AttributeValue } from '@opentelemetry/api';\nimport { ResourceDetectionConfig } from './config';\n\n/**\n * Interface for a Resource Detector.\n * A resource detector returns a set of detected resource attributes.\n * A detected resource attribute may be an {@link AttributeValue} or a Promise of an AttributeValue.\n */\nexport interface ResourceDetector {\n /**\n * Detect resource attributes.\n *\n * @returns a {@link DetectedResource} object containing detected resource attributes\n */\n detect(config?: ResourceDetectionConfig): DetectedResource;\n}\n\nexport type DetectedResource = {\n /**\n * Detected resource attributes.\n */\n attributes?: DetectedResourceAttributes;\n};\n\n/**\n * An object representing detected resource attributes.\n * Value may be {@link AttributeValue}s, a promise to an {@link AttributeValue}, or undefined.\n */\ntype DetectedResourceAttributeValue = MaybePromise<AttributeValue | undefined>;\n\n/**\n * An object representing detected resource attributes.\n * Values may be {@link AttributeValue}s or a promise to an {@link AttributeValue}.\n */\nexport type DetectedResourceAttributes = Record<\n string,\n DetectedResourceAttributeValue\n>;\n\nexport type MaybePromise<T> = T | Promise<T>;\n\nexport type RawResourceAttribute = [\n string,\n MaybePromise<AttributeValue | undefined>,\n];\n\n/**\n * Options for creating a {@link Resource}.\n */\nexport type ResourceOptions = {\n schemaUrl?: string;\n};\n"]} | ||
| {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { AttributeValue } from '@opentelemetry/api';\nimport { ResourceDetectionConfig } from './config';\n\n/**\n * Interface for a Resource Detector.\n * A resource detector returns a set of detected resource attributes.\n * A detected resource attribute may be an {@link AttributeValue} or a Promise of an AttributeValue.\n */\nexport interface ResourceDetector {\n /**\n * Detect resource attributes.\n *\n * @returns a {@link DetectedResource} object containing detected resource attributes\n */\n detect(config?: ResourceDetectionConfig): DetectedResource;\n}\n\nexport type DetectedResource = {\n /**\n * Detected resource attributes.\n */\n attributes?: DetectedResourceAttributes;\n};\n\n/**\n * An object representing detected resource attributes.\n * Value may be {@link AttributeValue}s, a promise to an {@link AttributeValue}, or undefined.\n */\ntype DetectedResourceAttributeValue = MaybePromise<AttributeValue | undefined>;\n\n/**\n * An object representing detected resource attributes.\n * Values may be {@link AttributeValue}s or a promise to an {@link AttributeValue}.\n */\nexport type DetectedResourceAttributes = Record<\n string,\n DetectedResourceAttributeValue\n>;\n\nexport type MaybePromise<T> = T | Promise<T>;\n\nexport type RawResourceAttribute = [\n string,\n MaybePromise<AttributeValue | undefined>,\n];\n\n/**\n * Options for creating a {@link Resource}.\n */\nexport type ResourceOptions = {\n schemaUrl?: string;\n};\n"]} |
+1
-12
| "use strict"; | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
@@ -17,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEI,MAAM,aAAa,GAAG,CAAI,GAAY,EAAyB,EAAE;IACtE,OAAO,CACL,GAAG,KAAK,IAAI;QACZ,OAAO,GAAG,KAAK,QAAQ;QACvB,OAAQ,GAA+B,CAAC,IAAI,KAAK,UAAU,CAC5D,CAAC;AACJ,CAAC,CAAC;AANW,QAAA,aAAa,iBAMxB","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\nexport const isPromiseLike = <R>(val: unknown): val is PromiseLike<R> => {\n return (\n val !== null &&\n typeof val === 'object' &&\n typeof (val as Partial<PromiseLike<R>>).then === 'function'\n );\n};\n"]} | ||
| {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEI,MAAM,aAAa,GAAG,CAAI,GAAY,EAAyB,EAAE;IACtE,OAAO,CACL,GAAG,KAAK,IAAI;QACZ,OAAO,GAAG,KAAK,QAAQ;QACvB,OAAQ,GAA+B,CAAC,IAAI,KAAK,UAAU,CAC5D,CAAC;AACJ,CAAC,CAAC;AANW,QAAA,aAAa,iBAMxB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport const isPromiseLike = <R>(val: unknown): val is PromiseLike<R> => {\n return (\n val !== null &&\n typeof val === 'object' &&\n typeof (val as Partial<PromiseLike<R>>).then === 'function'\n );\n};\n"]} |
@@ -1,2 +0,2 @@ | ||
| export declare const VERSION = "2.5.1"; | ||
| export declare const VERSION = "2.6.0"; | ||
| //# sourceMappingURL=version.d.ts.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
| // this is autogenerated file, see scripts/version-update.js | ||
| exports.VERSION = '2.5.1'; | ||
| exports.VERSION = '2.6.0'; | ||
| //# sourceMappingURL=version.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,OAAO,CAAC","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\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '2.5.1';\n"]} | ||
| {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,OAAO,CAAC","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\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '2.6.0';\n"]} |
+3
-3
| { | ||
| "name": "@opentelemetry/resources", | ||
| "version": "2.5.1", | ||
| "version": "2.6.0", | ||
| "description": "OpenTelemetry SDK resources", | ||
@@ -85,3 +85,3 @@ "main": "build/src/index.js", | ||
| "dependencies": { | ||
| "@opentelemetry/core": "2.5.1", | ||
| "@opentelemetry/core": "2.6.0", | ||
| "@opentelemetry/semantic-conventions": "^1.29.0" | ||
@@ -91,3 +91,3 @@ }, | ||
| "sideEffects": false, | ||
| "gitHead": "ad92be4c2c1094745a85b0b7eeff1444a11b1b4a" | ||
| "gitHead": "541e1b4ad83ad2093459794a18283228fe58d199" | ||
| } |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
440477
-19.07%4857
-18.93%+ Added
- Removed
Updated