feat: Complete zCode CLI X with Telegram bot integration

- Add full Telegram bot functionality with Z.AI API integration
- Implement 4 tools: Bash, FileEdit, WebSearch, Git
- Add 3 agents: Code Reviewer, Architect, DevOps Engineer
- Add 6 skills for common coding tasks
- Add systemd service file for 24/7 operation
- Add nginx configuration for HTTPS webhook
- Add comprehensive documentation
- Implement WebSocket server for real-time updates
- Add logging system with Winston
- Add environment validation

🤖 zCode CLI X - Agentic coder with Z.AI + Telegram integration
This commit is contained in:
admin
2026-05-05 09:01:26 +00:00
Unverified
parent 4a7035dd92
commit 875c7f9b91
24688 changed files with 3224957 additions and 221 deletions

View File

@@ -0,0 +1,12 @@
import { IResource } from '../IResource';
import { ResourceDetectionConfig } from '../config';
import { Detector } from '../types';
/**
* BrowserDetector will be used to detect the resources related to browser.
*/
declare class BrowserDetector implements Detector {
detect(config?: ResourceDetectionConfig): Promise<IResource>;
}
export declare const browserDetector: BrowserDetector;
export {};
//# sourceMappingURL=BrowserDetector.d.ts.map

View File

@@ -0,0 +1,26 @@
/*
* 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.
*/
import { browserDetectorSync } from './BrowserDetectorSync';
/**
* BrowserDetector will be used to detect the resources related to browser.
*/
class BrowserDetector {
detect(config) {
return Promise.resolve(browserDetectorSync.detect(config));
}
}
export const browserDetector = new BrowserDetector();
//# sourceMappingURL=BrowserDetector.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"BrowserDetector.js","sourceRoot":"","sources":["../../../src/detectors/BrowserDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;GAEG;AACH,MAAM,eAAe;IACnB,MAAM,CAAC,MAAgC;QACrC,OAAO,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,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 { IResource } from '../IResource';\nimport { ResourceDetectionConfig } from '../config';\nimport { Detector } from '../types';\nimport { browserDetectorSync } from './BrowserDetectorSync';\n\n/**\n * BrowserDetector will be used to detect the resources related to browser.\n */\nclass BrowserDetector implements Detector {\n detect(config?: ResourceDetectionConfig): Promise<IResource> {\n return Promise.resolve(browserDetectorSync.detect(config));\n }\n}\n\nexport const browserDetector = new BrowserDetector();\n"]}

View File

@@ -0,0 +1,20 @@
import { DetectorSync } from '../types';
import { ResourceDetectionConfig } from '../config';
import { IResource } from '../IResource';
/**
* BrowserDetectorSync will be used to detect the resources related to browser.
*/
declare class BrowserDetectorSync implements DetectorSync {
detect(config?: ResourceDetectionConfig): IResource;
/**
* Validates process resource attribute map from process variables
*
* @param browserResource The un-sanitized resource attributes from process as key/value pairs.
* @param config: Config
* @returns The sanitized resource attributes.
*/
private _getResourceAttributes;
}
export declare const browserDetectorSync: BrowserDetectorSync;
export {};
//# sourceMappingURL=BrowserDetectorSync.d.ts.map

View File

@@ -0,0 +1,58 @@
/*
* 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.
*/
import { SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION, SEMRESATTRS_PROCESS_RUNTIME_NAME, SEMRESATTRS_PROCESS_RUNTIME_VERSION, } from '@opentelemetry/semantic-conventions';
import { diag } from '@opentelemetry/api';
import { Resource } from '../Resource';
/**
* BrowserDetectorSync will be used to detect the resources related to browser.
*/
class BrowserDetectorSync {
detect(config) {
var _a, _b, _c;
const isBrowser = typeof navigator !== 'undefined' &&
((_b = (_a = global.process) === null || _a === void 0 ? void 0 : _a.versions) === null || _b === void 0 ? void 0 : _b.node) === undefined && // Node.js v21 adds `navigator`
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore don't have Bun types
((_c = global.Bun) === null || _c === void 0 ? void 0 : _c.version) === undefined; // Bun (bun.sh) defines `navigator`
if (!isBrowser) {
return Resource.empty();
}
const browserResource = {
[SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'browser',
[SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION]: 'Web Browser',
[SEMRESATTRS_PROCESS_RUNTIME_VERSION]: navigator.userAgent,
};
return this._getResourceAttributes(browserResource, config);
}
/**
* Validates process resource attribute map from process variables
*
* @param browserResource The un-sanitized resource attributes from process as key/value pairs.
* @param config: Config
* @returns The sanitized resource attributes.
*/
_getResourceAttributes(browserResource, _config) {
if (browserResource[SEMRESATTRS_PROCESS_RUNTIME_VERSION] === '') {
diag.debug('BrowserDetector failed: Unable to find required browser resources. ');
return Resource.empty();
}
else {
return new Resource(Object.assign({}, browserResource));
}
}
}
export const browserDetectorSync = new BrowserDetectorSync();
//# sourceMappingURL=BrowserDetectorSync.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"BrowserDetectorSync.js","sourceRoot":"","sources":["../../../src/detectors/BrowserDetectorSync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,uCAAuC,EACvC,gCAAgC,EAChC,mCAAmC,GACpC,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAG1C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC;;GAEG;AACH,MAAM,mBAAmB;IACvB,MAAM,CAAC,MAAgC;;QACrC,MAAM,SAAS,GACb,OAAO,SAAS,KAAK,WAAW;YAChC,CAAA,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,QAAQ,0CAAE,IAAI,MAAK,SAAS,IAAI,+BAA+B;YAC/E,6DAA6D;YAC7D,kCAAkC;YAClC,CAAA,MAAA,MAAM,CAAC,GAAG,0CAAE,OAAO,MAAK,SAAS,CAAC,CAAC,mCAAmC;QACxE,IAAI,CAAC,SAAS,EAAE;YACd,OAAO,QAAQ,CAAC,KAAK,EAAE,CAAC;SACzB;QACD,MAAM,eAAe,GAAuB;YAC1C,CAAC,gCAAgC,CAAC,EAAE,SAAS;YAC7C,CAAC,uCAAuC,CAAC,EAAE,aAAa;YACxD,CAAC,mCAAmC,CAAC,EAAE,SAAS,CAAC,SAAS;SAC3D,CAAC;QACF,OAAO,IAAI,CAAC,sBAAsB,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;IACD;;;;;;OAMG;IACK,sBAAsB,CAC5B,eAAmC,EACnC,OAAiC;QAEjC,IAAI,eAAe,CAAC,mCAAmC,CAAC,KAAK,EAAE,EAAE;YAC/D,IAAI,CAAC,KAAK,CACR,qEAAqE,CACtE,CAAC;YACF,OAAO,QAAQ,CAAC,KAAK,EAAE,CAAC;SACzB;aAAM;YACL,OAAO,IAAI,QAAQ,mBACd,eAAe,EAClB,CAAC;SACJ;IACH,CAAC;CACF;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,mBAAmB,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 {\n SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION,\n SEMRESATTRS_PROCESS_RUNTIME_NAME,\n SEMRESATTRS_PROCESS_RUNTIME_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { DetectorSync, ResourceAttributes } from '../types';\nimport { diag } from '@opentelemetry/api';\nimport { ResourceDetectionConfig } from '../config';\nimport { IResource } from '../IResource';\nimport { Resource } from '../Resource';\n\n/**\n * BrowserDetectorSync will be used to detect the resources related to browser.\n */\nclass BrowserDetectorSync implements DetectorSync {\n detect(config?: ResourceDetectionConfig): IResource {\n const isBrowser =\n typeof navigator !== 'undefined' &&\n global.process?.versions?.node === undefined && // Node.js v21 adds `navigator`\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore don't have Bun types\n global.Bun?.version === undefined; // Bun (bun.sh) defines `navigator`\n if (!isBrowser) {\n return Resource.empty();\n }\n const browserResource: ResourceAttributes = {\n [SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'browser',\n [SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION]: 'Web Browser',\n [SEMRESATTRS_PROCESS_RUNTIME_VERSION]: navigator.userAgent,\n };\n return this._getResourceAttributes(browserResource, config);\n }\n /**\n * Validates process resource attribute map from process variables\n *\n * @param browserResource The un-sanitized resource attributes from process as key/value pairs.\n * @param config: Config\n * @returns The sanitized resource attributes.\n */\n private _getResourceAttributes(\n browserResource: ResourceAttributes,\n _config?: ResourceDetectionConfig\n ) {\n if (browserResource[SEMRESATTRS_PROCESS_RUNTIME_VERSION] === '') {\n diag.debug(\n 'BrowserDetector failed: Unable to find required browser resources. '\n );\n return Resource.empty();\n } else {\n return new Resource({\n ...browserResource,\n });\n }\n }\n}\n\nexport const browserDetectorSync = new BrowserDetectorSync();\n"]}

View File

@@ -0,0 +1,20 @@
import { Detector } from '../types';
import { ResourceDetectionConfig } from '../config';
import { IResource } from '../IResource';
/**
* EnvDetector can be used to detect the presence of and create a Resource
* from the OTEL_RESOURCE_ATTRIBUTES environment variable.
*/
declare class EnvDetector implements Detector {
/**
* Returns a {@link Resource} populated with attributes from the
* OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async
* function to conform to the Detector interface.
*
* @param config The resource detection config
*/
detect(config?: ResourceDetectionConfig): Promise<IResource>;
}
export declare const envDetector: EnvDetector;
export {};
//# sourceMappingURL=EnvDetector.d.ts.map

View File

@@ -0,0 +1,34 @@
/*
* 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.
*/
import { envDetectorSync } from './EnvDetectorSync';
/**
* EnvDetector can be used to detect the presence of and create a Resource
* from the OTEL_RESOURCE_ATTRIBUTES environment variable.
*/
class EnvDetector {
/**
* Returns a {@link Resource} populated with attributes from the
* OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async
* function to conform to the Detector interface.
*
* @param config The resource detection config
*/
detect(config) {
return Promise.resolve(envDetectorSync.detect(config));
}
}
export const envDetector = new EnvDetector();
//# sourceMappingURL=EnvDetector.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"EnvDetector.js","sourceRoot":"","sources":["../../../src/detectors/EnvDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;GAGG;AACH,MAAM,WAAW;IACf;;;;;;OAMG;IACH,MAAM,CAAC,MAAgC;QACrC,OAAO,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACzD,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 { Detector } from '../types';\nimport { ResourceDetectionConfig } from '../config';\nimport { IResource } from '../IResource';\nimport { envDetectorSync } from './EnvDetectorSync';\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 Detector {\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): Promise<IResource> {\n return Promise.resolve(envDetectorSync.detect(config));\n }\n}\n\nexport const envDetector = new EnvDetector();\n"]}

View File

@@ -0,0 +1,57 @@
import { DetectorSync } from '../types';
import { ResourceDetectionConfig } from '../config';
import { IResource } from '../IResource';
/**
* EnvDetectorSync can be used to detect the presence of and create a Resource
* from the OTEL_RESOURCE_ATTRIBUTES environment variable.
*/
declare class EnvDetectorSync implements DetectorSync {
private readonly _MAX_LENGTH;
private readonly _COMMA_SEPARATOR;
private readonly _LABEL_KEY_VALUE_SPLITTER;
private readonly _ERROR_MESSAGE_INVALID_CHARS;
private readonly _ERROR_MESSAGE_INVALID_VALUE;
/**
* Returns a {@link Resource} populated with attributes from the
* OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async
* function to conform to the Detector interface.
*
* @param config The resource detection config
*/
detect(_config?: ResourceDetectionConfig): IResource;
/**
* Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment
* variable.
*
* 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.
*
* @param rawEnvAttributes The resource attributes as a comma-separated list
* of key/value pairs.
* @returns The sanitized resource 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;
}
export declare const envDetectorSync: EnvDetectorSync;
export {};
//# sourceMappingURL=EnvDetectorSync.d.ts.map

View File

@@ -0,0 +1,135 @@
/*
* 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.
*/
import { diag } from '@opentelemetry/api';
import { getEnv } from '@opentelemetry/core';
import { SEMRESATTRS_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
import { Resource } from '../Resource';
/**
* EnvDetectorSync can be used to detect the presence of and create a Resource
* from the OTEL_RESOURCE_ATTRIBUTES environment variable.
*/
class EnvDetectorSync {
constructor() {
// Type, attribute keys, and attribute values should not exceed 256 characters.
this._MAX_LENGTH = 255;
// OTEL_RESOURCE_ATTRIBUTES is a comma-separated list of attributes.
this._COMMA_SEPARATOR = ',';
// OTEL_RESOURCE_ATTRIBUTES contains key value pair separated by '='.
this._LABEL_KEY_VALUE_SPLITTER = '=';
this._ERROR_MESSAGE_INVALID_CHARS = 'should be a ASCII string with a length greater than 0 and not exceed ' +
this._MAX_LENGTH +
' characters.';
this._ERROR_MESSAGE_INVALID_VALUE = 'should be a ASCII string with a length not exceed ' +
this._MAX_LENGTH +
' characters.';
}
/**
* Returns a {@link Resource} populated with attributes from the
* OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async
* function to conform to the Detector interface.
*
* @param config The resource detection config
*/
detect(_config) {
const attributes = {};
const env = getEnv();
const rawAttributes = env.OTEL_RESOURCE_ATTRIBUTES;
const serviceName = env.OTEL_SERVICE_NAME;
if (rawAttributes) {
try {
const parsedAttributes = this._parseResourceAttributes(rawAttributes);
Object.assign(attributes, parsedAttributes);
}
catch (e) {
diag.debug(`EnvDetector failed: ${e.message}`);
}
}
if (serviceName) {
attributes[SEMRESATTRS_SERVICE_NAME] = serviceName;
}
return new Resource(attributes);
}
/**
* Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment
* variable.
*
* 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.
*
* @param rawEnvAttributes The resource attributes as a comma-separated list
* of key/value pairs.
* @returns The sanitized resource attributes.
*/
_parseResourceAttributes(rawEnvAttributes) {
if (!rawEnvAttributes)
return {};
const attributes = {};
const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR, -1);
for (const rawAttribute of rawAttributes) {
const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER, -1);
if (keyValuePair.length !== 2) {
continue;
}
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}`);
}
if (!this._isValid(value)) {
throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);
}
attributes[key] = decodeURIComponent(value);
}
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 envDetectorSync = new EnvDetectorSync();
//# sourceMappingURL=EnvDetectorSync.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,7 @@
import { Detector } from '../types';
import { IResource } from '../IResource';
export declare class NoopDetector implements Detector {
detect(): Promise<IResource>;
}
export declare const noopDetector: NoopDetector;
//# sourceMappingURL=NoopDetector.d.ts.map

View File

@@ -0,0 +1,23 @@
/*
* 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.
*/
import { noopDetectorSync } from './NoopDetectorSync';
export class NoopDetector {
detect() {
return Promise.resolve(noopDetectorSync.detect());
}
}
export const noopDetector = new NoopDetector();
//# sourceMappingURL=NoopDetector.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"NoopDetector.js","sourceRoot":"","sources":["../../../src/detectors/NoopDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,OAAO,YAAY;IACvB,MAAM;QACJ,OAAO,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC;IACpD,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 { Detector } from '../types';\nimport { IResource } from '../IResource';\nimport { noopDetectorSync } from './NoopDetectorSync';\n\nexport class NoopDetector implements Detector {\n detect(): Promise<IResource> {\n return Promise.resolve(noopDetectorSync.detect());\n }\n}\n\nexport const noopDetector = new NoopDetector();\n"]}

View File

@@ -0,0 +1,7 @@
import { DetectorSync } from '../types';
import { IResource } from '../IResource';
export declare class NoopDetectorSync implements DetectorSync {
detect(): IResource;
}
export declare const noopDetectorSync: NoopDetectorSync;
//# sourceMappingURL=NoopDetectorSync.d.ts.map

View File

@@ -0,0 +1,23 @@
/*
* 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.
*/
import { Resource } from '../Resource';
export class NoopDetectorSync {
detect() {
return new Resource({});
}
}
export const noopDetectorSync = new NoopDetectorSync();
//# sourceMappingURL=NoopDetectorSync.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"NoopDetectorSync.js","sourceRoot":"","sources":["../../../src/detectors/NoopDetectorSync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIvC,MAAM,OAAO,gBAAgB;IAC3B,MAAM;QACJ,OAAO,IAAI,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC;CACF;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,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 { Resource } from '../Resource';\nimport { DetectorSync } from '../types';\nimport { IResource } from '../IResource';\n\nexport class NoopDetectorSync implements DetectorSync {\n detect(): IResource {\n return new Resource({});\n }\n}\n\nexport const noopDetectorSync = new NoopDetectorSync();\n"]}

View File

@@ -0,0 +1,6 @@
export { hostDetector, hostDetectorSync, osDetector, osDetectorSync, processDetector, processDetectorSync, serviceInstanceIdDetectorSync, } from './platform';
export { browserDetector } from './BrowserDetector';
export { envDetector } from './EnvDetector';
export { browserDetectorSync } from './BrowserDetectorSync';
export { envDetectorSync } from './EnvDetectorSync';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,21 @@
/*
* 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.
*/
export { hostDetector, hostDetectorSync, osDetector, osDetectorSync, processDetector, processDetectorSync, serviceInstanceIdDetectorSync, } from './platform';
export { browserDetector } from './BrowserDetector';
export { envDetector } from './EnvDetector';
export { browserDetectorSync } from './BrowserDetectorSync';
export { envDetectorSync } from './EnvDetectorSync';
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/detectors/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,6BAA6B,GAC9B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,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 {\n hostDetector,\n hostDetectorSync,\n osDetector,\n osDetectorSync,\n processDetector,\n processDetectorSync,\n serviceInstanceIdDetectorSync,\n} from './platform';\nexport { browserDetector } from './BrowserDetector';\nexport { envDetector } from './EnvDetector';\nexport { browserDetectorSync } from './BrowserDetectorSync';\nexport { envDetectorSync } from './EnvDetectorSync';\n"]}

View File

@@ -0,0 +1,2 @@
export declare const hostDetector: import("../../NoopDetector").NoopDetector;
//# sourceMappingURL=HostDetector.d.ts.map

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
import { noopDetector } from '../../NoopDetector';
export const hostDetector = noopDetector;
//# sourceMappingURL=HostDetector.js.map

View File

@@ -0,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"]}

View File

@@ -0,0 +1,2 @@
export declare const hostDetectorSync: import("../../NoopDetectorSync").NoopDetectorSync;
//# sourceMappingURL=HostDetectorSync.d.ts.map

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
import { noopDetectorSync } from '../../NoopDetectorSync';
export const hostDetectorSync = noopDetectorSync;
//# sourceMappingURL=HostDetectorSync.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"HostDetectorSync.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/HostDetectorSync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,MAAM,CAAC,MAAM,gBAAgB,GAAG,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\nimport { noopDetectorSync } from '../../NoopDetectorSync';\n\nexport const hostDetectorSync = noopDetectorSync;\n"]}

View File

@@ -0,0 +1,2 @@
export declare const osDetector: import("../../NoopDetector").NoopDetector;
//# sourceMappingURL=OSDetector.d.ts.map

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
import { noopDetector } from '../../NoopDetector';
export const osDetector = noopDetector;
//# sourceMappingURL=OSDetector.js.map

View File

@@ -0,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"]}

View File

@@ -0,0 +1,2 @@
export declare const osDetectorSync: import("../../NoopDetectorSync").NoopDetectorSync;
//# sourceMappingURL=OSDetectorSync.d.ts.map

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
import { noopDetectorSync } from '../../NoopDetectorSync';
export const osDetectorSync = noopDetectorSync;
//# sourceMappingURL=OSDetectorSync.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"OSDetectorSync.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/OSDetectorSync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,MAAM,CAAC,MAAM,cAAc,GAAG,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\nimport { noopDetectorSync } from '../../NoopDetectorSync';\n\nexport const osDetectorSync = noopDetectorSync;\n"]}

View File

@@ -0,0 +1,2 @@
export declare const processDetector: import("../../NoopDetector").NoopDetector;
//# sourceMappingURL=ProcessDetector.d.ts.map

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
import { noopDetector } from '../../NoopDetector';
export const processDetector = noopDetector;
//# sourceMappingURL=ProcessDetector.js.map

View File

@@ -0,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"]}

View File

@@ -0,0 +1,2 @@
export declare const processDetectorSync: import("../../NoopDetector").NoopDetector;
//# sourceMappingURL=ProcessDetectorSync.d.ts.map

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
import { noopDetector } from '../../NoopDetector';
export const processDetectorSync = noopDetector;
//# sourceMappingURL=ProcessDetectorSync.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ProcessDetectorSync.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/ProcessDetectorSync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,mBAAmB,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 processDetectorSync = noopDetector;\n"]}

View File

@@ -0,0 +1,5 @@
/**
* @experimental
*/
export declare const serviceInstanceIdDetectorSync: import("../../NoopDetectorSync").NoopDetectorSync;
//# sourceMappingURL=ServiceInstanceIdDetectorSync.d.ts.map

View File

@@ -0,0 +1,21 @@
/*
* 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.
*/
import { noopDetectorSync } from '../../NoopDetectorSync';
/**
* @experimental
*/
export const serviceInstanceIdDetectorSync = noopDetectorSync;
//# sourceMappingURL=ServiceInstanceIdDetectorSync.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ServiceInstanceIdDetectorSync.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/browser/ServiceInstanceIdDetectorSync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,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\nimport { noopDetectorSync } from '../../NoopDetectorSync';\n\n/**\n * @experimental\n */\nexport const serviceInstanceIdDetectorSync = noopDetectorSync;\n"]}

View File

@@ -0,0 +1,8 @@
export { hostDetector } from './HostDetector';
export { hostDetectorSync } from './HostDetectorSync';
export { osDetector } from './OSDetector';
export { osDetectorSync } from './OSDetectorSync';
export { processDetector } from './ProcessDetector';
export { processDetectorSync } from './ProcessDetectorSync';
export { serviceInstanceIdDetectorSync } from './ServiceInstanceIdDetectorSync';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,23 @@
/*
* 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.
*/
export { hostDetector } from './HostDetector';
export { hostDetectorSync } from './HostDetectorSync';
export { osDetector } from './OSDetector';
export { osDetectorSync } from './OSDetectorSync';
export { processDetector } from './ProcessDetector';
export { processDetectorSync } from './ProcessDetectorSync';
export { serviceInstanceIdDetectorSync } from './ServiceInstanceIdDetectorSync';
//# sourceMappingURL=index.js.map

View File

@@ -0,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,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,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 { hostDetectorSync } from './HostDetectorSync';\nexport { osDetector } from './OSDetector';\nexport { osDetectorSync } from './OSDetectorSync';\nexport { processDetector } from './ProcessDetector';\nexport { processDetectorSync } from './ProcessDetectorSync';\nexport { serviceInstanceIdDetectorSync } from './ServiceInstanceIdDetectorSync';\n"]}

View File

@@ -0,0 +1,2 @@
export { hostDetector, hostDetectorSync, osDetector, osDetectorSync, processDetector, processDetectorSync, serviceInstanceIdDetectorSync, } from './node';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,17 @@
/*
* 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.
*/
export { hostDetector, hostDetectorSync, osDetector, osDetectorSync, processDetector, processDetectorSync, serviceInstanceIdDetectorSync, } from './node';
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/detectors/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,6BAA6B,GAC9B,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 hostDetectorSync,\n osDetector,\n osDetectorSync,\n processDetector,\n processDetectorSync,\n serviceInstanceIdDetectorSync,\n} from './node';\n"]}

View File

@@ -0,0 +1,13 @@
import { Detector } from '../../../types';
import { ResourceDetectionConfig } from '../../../config';
import { IResource } from '../../../IResource';
/**
* HostDetector detects the resources related to the host current process is
* running on. Currently only non-cloud-based attributes are included.
*/
declare class HostDetector implements Detector {
detect(_config?: ResourceDetectionConfig): Promise<IResource>;
}
export declare const hostDetector: HostDetector;
export {};
//# sourceMappingURL=HostDetector.d.ts.map

View File

@@ -0,0 +1,27 @@
/*
* 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.
*/
import { hostDetectorSync } from './HostDetectorSync';
/**
* HostDetector detects the resources related to the host current process is
* running on. Currently only non-cloud-based attributes are included.
*/
class HostDetector {
detect(_config) {
return Promise.resolve(hostDetectorSync.detect(_config));
}
}
export const hostDetector = new HostDetector();
//# sourceMappingURL=HostDetector.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"HostDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/HostDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,YAAY;IAChB,MAAM,CAAC,OAAiC;QACtC,OAAO,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3D,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 { Detector } from '../../../types';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { IResource } from '../../../IResource';\nimport { hostDetectorSync } from './HostDetectorSync';\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 Detector {\n detect(_config?: ResourceDetectionConfig): Promise<IResource> {\n return Promise.resolve(hostDetectorSync.detect(_config));\n }\n}\n\nexport const hostDetector = new HostDetector();\n"]}

View File

@@ -0,0 +1,14 @@
import { Resource } from '../../../Resource';
import { DetectorSync } from '../../../types';
import { ResourceDetectionConfig } from '../../../config';
/**
* HostDetectorSync detects the resources related to the host current process is
* running on. Currently only non-cloud-based attributes are included.
*/
declare class HostDetectorSync implements DetectorSync {
detect(_config?: ResourceDetectionConfig): Resource;
private _getAsyncAttributes;
}
export declare const hostDetectorSync: HostDetectorSync;
export {};
//# sourceMappingURL=HostDetectorSync.d.ts.map

View File

@@ -0,0 +1,44 @@
/*
* 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.
*/
import { SEMRESATTRS_HOST_ARCH, SEMRESATTRS_HOST_ID, SEMRESATTRS_HOST_NAME, } from '@opentelemetry/semantic-conventions';
import { Resource } from '../../../Resource';
import { arch, hostname } from 'os';
import { normalizeArch } from './utils';
import { getMachineId } from './machine-id/getMachineId';
/**
* HostDetectorSync detects the resources related to the host current process is
* running on. Currently only non-cloud-based attributes are included.
*/
class HostDetectorSync {
detect(_config) {
const attributes = {
[SEMRESATTRS_HOST_NAME]: hostname(),
[SEMRESATTRS_HOST_ARCH]: normalizeArch(arch()),
};
return new Resource(attributes, this._getAsyncAttributes());
}
_getAsyncAttributes() {
return getMachineId().then(machineId => {
const attributes = {};
if (machineId) {
attributes[SEMRESATTRS_HOST_ID] = machineId;
}
return attributes;
});
}
}
export const hostDetectorSync = new HostDetectorSync();
//# sourceMappingURL=HostDetectorSync.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"HostDetectorSync.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/HostDetectorSync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG7C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD;;;GAGG;AACH,MAAM,gBAAgB;IACpB,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAuB;YACrC,CAAC,qBAAqB,CAAC,EAAE,QAAQ,EAAE;YACnC,CAAC,qBAAqB,CAAC,EAAE,aAAa,CAAC,IAAI,EAAE,CAAC;SAC/C,CAAC;QAEF,OAAO,IAAI,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAC9D,CAAC;IAEO,mBAAmB;QACzB,OAAO,YAAY,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;YACrC,MAAM,UAAU,GAAuB,EAAE,CAAC;YAC1C,IAAI,SAAS,EAAE;gBACb,UAAU,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAAC;aAC7C;YACD,OAAO,UAAU,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,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 {\n SEMRESATTRS_HOST_ARCH,\n SEMRESATTRS_HOST_ID,\n SEMRESATTRS_HOST_NAME,\n} from '@opentelemetry/semantic-conventions';\nimport { Resource } from '../../../Resource';\nimport { DetectorSync, ResourceAttributes } from '../../../types';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { arch, hostname } from 'os';\nimport { normalizeArch } from './utils';\nimport { getMachineId } from './machine-id/getMachineId';\n\n/**\n * HostDetectorSync detects the resources related to the host current process is\n * running on. Currently only non-cloud-based attributes are included.\n */\nclass HostDetectorSync implements DetectorSync {\n detect(_config?: ResourceDetectionConfig): Resource {\n const attributes: ResourceAttributes = {\n [SEMRESATTRS_HOST_NAME]: hostname(),\n [SEMRESATTRS_HOST_ARCH]: normalizeArch(arch()),\n };\n\n return new Resource(attributes, this._getAsyncAttributes());\n }\n\n private _getAsyncAttributes(): Promise<ResourceAttributes> {\n return getMachineId().then(machineId => {\n const attributes: ResourceAttributes = {};\n if (machineId) {\n attributes[SEMRESATTRS_HOST_ID] = machineId;\n }\n return attributes;\n });\n }\n}\n\nexport const hostDetectorSync = new HostDetectorSync();\n"]}

View File

@@ -0,0 +1,13 @@
import { Detector } from '../../../types';
import { ResourceDetectionConfig } from '../../../config';
import { IResource } from '../../../IResource';
/**
* OSDetector detects the resources related to the operating system (OS) on
* which the process represented by this resource is running.
*/
declare class OSDetector implements Detector {
detect(_config?: ResourceDetectionConfig): Promise<IResource>;
}
export declare const osDetector: OSDetector;
export {};
//# sourceMappingURL=OSDetector.d.ts.map

View File

@@ -0,0 +1,27 @@
/*
* 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.
*/
import { osDetectorSync } from './OSDetectorSync';
/**
* OSDetector detects the resources related to the operating system (OS) on
* which the process represented by this resource is running.
*/
class OSDetector {
detect(_config) {
return Promise.resolve(osDetectorSync.detect(_config));
}
}
export const osDetector = new OSDetector();
//# sourceMappingURL=OSDetector.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"OSDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/OSDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,MAAM,UAAU;IACd,MAAM,CAAC,OAAiC;QACtC,OAAO,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACzD,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 { Detector } from '../../../types';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { IResource } from '../../../IResource';\nimport { osDetectorSync } from './OSDetectorSync';\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 Detector {\n detect(_config?: ResourceDetectionConfig): Promise<IResource> {\n return Promise.resolve(osDetectorSync.detect(_config));\n }\n}\n\nexport const osDetector = new OSDetector();\n"]}

View File

@@ -0,0 +1,13 @@
import { Resource } from '../../../Resource';
import { DetectorSync } from '../../../types';
import { ResourceDetectionConfig } from '../../../config';
/**
* OSDetectorSync detects the resources related to the operating system (OS) on
* which the process represented by this resource is running.
*/
declare class OSDetectorSync implements DetectorSync {
detect(_config?: ResourceDetectionConfig): Resource;
}
export declare const osDetectorSync: OSDetectorSync;
export {};
//# sourceMappingURL=OSDetectorSync.d.ts.map

View File

@@ -0,0 +1,34 @@
/*
* 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.
*/
import { SEMRESATTRS_OS_TYPE, SEMRESATTRS_OS_VERSION, } from '@opentelemetry/semantic-conventions';
import { Resource } from '../../../Resource';
import { platform, release } from 'os';
import { normalizeType } from './utils';
/**
* OSDetectorSync detects the resources related to the operating system (OS) on
* which the process represented by this resource is running.
*/
class OSDetectorSync {
detect(_config) {
const attributes = {
[SEMRESATTRS_OS_TYPE]: normalizeType(platform()),
[SEMRESATTRS_OS_VERSION]: release(),
};
return new Resource(attributes);
}
}
export const osDetectorSync = new OSDetectorSync();
//# sourceMappingURL=OSDetectorSync.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"OSDetectorSync.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/OSDetectorSync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG7C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC;;;GAGG;AACH,MAAM,cAAc;IAClB,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAuB;YACrC,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC;YAChD,CAAC,sBAAsB,CAAC,EAAE,OAAO,EAAE;SACpC,CAAC;QACF,OAAO,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;CACF;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,cAAc,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 {\n SEMRESATTRS_OS_TYPE,\n SEMRESATTRS_OS_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { Resource } from '../../../Resource';\nimport { DetectorSync, ResourceAttributes } from '../../../types';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { platform, release } from 'os';\nimport { normalizeType } from './utils';\n\n/**\n * OSDetectorSync detects the resources related to the operating system (OS) on\n * which the process represented by this resource is running.\n */\nclass OSDetectorSync implements DetectorSync {\n detect(_config?: ResourceDetectionConfig): Resource {\n const attributes: ResourceAttributes = {\n [SEMRESATTRS_OS_TYPE]: normalizeType(platform()),\n [SEMRESATTRS_OS_VERSION]: release(),\n };\n return new Resource(attributes);\n }\n}\n\nexport const osDetectorSync = new OSDetectorSync();\n"]}

View File

@@ -0,0 +1,13 @@
import { Detector } from '../../../types';
import { ResourceDetectionConfig } from '../../../config';
import { IResource } from '../../../IResource';
/**
* ProcessDetector will be used to detect the resources related current process running
* and being instrumented from the NodeJS Process module.
*/
declare class ProcessDetector implements Detector {
detect(config?: ResourceDetectionConfig): Promise<IResource>;
}
export declare const processDetector: ProcessDetector;
export {};
//# sourceMappingURL=ProcessDetector.d.ts.map

View File

@@ -0,0 +1,27 @@
/*
* 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.
*/
import { processDetectorSync } from './ProcessDetectorSync';
/**
* ProcessDetector will be used to detect the resources related current process running
* and being instrumented from the NodeJS Process module.
*/
class ProcessDetector {
detect(config) {
return Promise.resolve(processDetectorSync.detect(config));
}
}
export const processDetector = new ProcessDetector();
//# sourceMappingURL=ProcessDetector.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ProcessDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/ProcessDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;GAGG;AACH,MAAM,eAAe;IACnB,MAAM,CAAC,MAAgC;QACrC,OAAO,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,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 { Detector } from '../../../types';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { IResource } from '../../../IResource';\nimport { processDetectorSync } from './ProcessDetectorSync';\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 Detector {\n detect(config?: ResourceDetectionConfig): Promise<IResource> {\n return Promise.resolve(processDetectorSync.detect(config));\n }\n}\n\nexport const processDetector = new ProcessDetector();\n"]}

View File

@@ -0,0 +1,13 @@
import { DetectorSync } from '../../../types';
import { ResourceDetectionConfig } from '../../../config';
import { IResource } from '../../../IResource';
/**
* ProcessDetectorSync will be used to detect the resources related current process running
* and being instrumented from the NodeJS Process module.
*/
declare class ProcessDetectorSync implements DetectorSync {
detect(_config?: ResourceDetectionConfig): IResource;
}
export declare const processDetectorSync: ProcessDetectorSync;
export {};
//# sourceMappingURL=ProcessDetectorSync.d.ts.map

View File

@@ -0,0 +1,53 @@
/*
* 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.
*/
import { diag } from '@opentelemetry/api';
import { SEMRESATTRS_PROCESS_COMMAND, SEMRESATTRS_PROCESS_COMMAND_ARGS, SEMRESATTRS_PROCESS_EXECUTABLE_NAME, SEMRESATTRS_PROCESS_EXECUTABLE_PATH, SEMRESATTRS_PROCESS_OWNER, SEMRESATTRS_PROCESS_PID, SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION, SEMRESATTRS_PROCESS_RUNTIME_NAME, SEMRESATTRS_PROCESS_RUNTIME_VERSION, } from '@opentelemetry/semantic-conventions';
import { Resource } from '../../../Resource';
import * as os from 'os';
/**
* ProcessDetectorSync will be used to detect the resources related current process running
* and being instrumented from the NodeJS Process module.
*/
class ProcessDetectorSync {
detect(_config) {
const attributes = {
[SEMRESATTRS_PROCESS_PID]: process.pid,
[SEMRESATTRS_PROCESS_EXECUTABLE_NAME]: process.title,
[SEMRESATTRS_PROCESS_EXECUTABLE_PATH]: process.execPath,
[SEMRESATTRS_PROCESS_COMMAND_ARGS]: [
process.argv[0],
...process.execArgv,
...process.argv.slice(1),
],
[SEMRESATTRS_PROCESS_RUNTIME_VERSION]: process.versions.node,
[SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'nodejs',
[SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION]: 'Node.js',
};
if (process.argv.length > 1) {
attributes[SEMRESATTRS_PROCESS_COMMAND] = process.argv[1];
}
try {
const userInfo = os.userInfo();
attributes[SEMRESATTRS_PROCESS_OWNER] = userInfo.username;
}
catch (e) {
diag.debug(`error obtaining process owner: ${e}`);
}
return new Resource(attributes);
}
}
export const processDetectorSync = new ProcessDetectorSync();
//# sourceMappingURL=ProcessDetectorSync.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ProcessDetectorSync.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/ProcessDetectorSync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EACL,2BAA2B,EAC3B,gCAAgC,EAChC,mCAAmC,EACnC,mCAAmC,EACnC,yBAAyB,EACzB,uBAAuB,EACvB,uCAAuC,EACvC,gCAAgC,EAChC,mCAAmC,GACpC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAI7C,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB;;;GAGG;AACH,MAAM,mBAAmB;IACvB,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAuB;YACrC,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAC,GAAG;YACtC,CAAC,mCAAmC,CAAC,EAAE,OAAO,CAAC,KAAK;YACpD,CAAC,mCAAmC,CAAC,EAAE,OAAO,CAAC,QAAQ;YACvD,CAAC,gCAAgC,CAAC,EAAE;gBAClC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;gBACf,GAAG,OAAO,CAAC,QAAQ;gBACnB,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;aACzB;YACD,CAAC,mCAAmC,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;YAC5D,CAAC,gCAAgC,CAAC,EAAE,QAAQ;YAC5C,CAAC,uCAAuC,CAAC,EAAE,SAAS;SACrD,CAAC;QAEF,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3B,UAAU,CAAC,2BAA2B,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAC3D;QAED,IAAI;YACF,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;YAC/B,UAAU,CAAC,yBAAyB,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC;SAC3D;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,KAAK,CAAC,kCAAkC,CAAC,EAAE,CAAC,CAAC;SACnD;QAED,OAAO,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;CACF;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,mBAAmB,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 { diag } from '@opentelemetry/api';\nimport {\n SEMRESATTRS_PROCESS_COMMAND,\n SEMRESATTRS_PROCESS_COMMAND_ARGS,\n SEMRESATTRS_PROCESS_EXECUTABLE_NAME,\n SEMRESATTRS_PROCESS_EXECUTABLE_PATH,\n SEMRESATTRS_PROCESS_OWNER,\n SEMRESATTRS_PROCESS_PID,\n SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION,\n SEMRESATTRS_PROCESS_RUNTIME_NAME,\n SEMRESATTRS_PROCESS_RUNTIME_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { Resource } from '../../../Resource';\nimport { DetectorSync, ResourceAttributes } from '../../../types';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { IResource } from '../../../IResource';\nimport * as os from 'os';\n\n/**\n * ProcessDetectorSync will be used to detect the resources related current process running\n * and being instrumented from the NodeJS Process module.\n */\nclass ProcessDetectorSync implements DetectorSync {\n detect(_config?: ResourceDetectionConfig): IResource {\n const attributes: ResourceAttributes = {\n [SEMRESATTRS_PROCESS_PID]: process.pid,\n [SEMRESATTRS_PROCESS_EXECUTABLE_NAME]: process.title,\n [SEMRESATTRS_PROCESS_EXECUTABLE_PATH]: process.execPath,\n [SEMRESATTRS_PROCESS_COMMAND_ARGS]: [\n process.argv[0],\n ...process.execArgv,\n ...process.argv.slice(1),\n ],\n [SEMRESATTRS_PROCESS_RUNTIME_VERSION]: process.versions.node,\n [SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'nodejs',\n [SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION]: 'Node.js',\n };\n\n if (process.argv.length > 1) {\n attributes[SEMRESATTRS_PROCESS_COMMAND] = process.argv[1];\n }\n\n try {\n const userInfo = os.userInfo();\n attributes[SEMRESATTRS_PROCESS_OWNER] = userInfo.username;\n } catch (e) {\n diag.debug(`error obtaining process owner: ${e}`);\n }\n\n return new Resource(attributes);\n }\n}\n\nexport const processDetectorSync = new ProcessDetectorSync();\n"]}

View File

@@ -0,0 +1,15 @@
import { Resource } from '../../../Resource';
import { DetectorSync } from '../../../types';
import { ResourceDetectionConfig } from '../../../config';
/**
* ServiceInstanceIdDetectorSync detects the resources related to the service instance ID.
*/
declare class ServiceInstanceIdDetectorSync implements DetectorSync {
detect(_config?: ResourceDetectionConfig): Resource;
}
/**
* @experimental
*/
export declare const serviceInstanceIdDetectorSync: ServiceInstanceIdDetectorSync;
export {};
//# sourceMappingURL=ServiceInstanceIdDetectorSync.d.ts.map

View File

@@ -0,0 +1,34 @@
/*
* 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.
*/
import { SEMRESATTRS_SERVICE_INSTANCE_ID } from '@opentelemetry/semantic-conventions';
import { Resource } from '../../../Resource';
import { randomUUID } from 'crypto';
/**
* ServiceInstanceIdDetectorSync detects the resources related to the service instance ID.
*/
class ServiceInstanceIdDetectorSync {
detect(_config) {
const attributes = {
[SEMRESATTRS_SERVICE_INSTANCE_ID]: randomUUID(),
};
return new Resource(attributes);
}
}
/**
* @experimental
*/
export const serviceInstanceIdDetectorSync = new ServiceInstanceIdDetectorSync();
//# sourceMappingURL=ServiceInstanceIdDetectorSync.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ServiceInstanceIdDetectorSync.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/ServiceInstanceIdDetectorSync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,+BAA+B,EAAE,MAAM,qCAAqC,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG7C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC;;GAEG;AACH,MAAM,6BAA6B;IACjC,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAuB;YACrC,CAAC,+BAA+B,CAAC,EAAE,UAAU,EAAE;SAChD,CAAC;QAEF,OAAO,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GACxC,IAAI,6BAA6B,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 { SEMRESATTRS_SERVICE_INSTANCE_ID } from '@opentelemetry/semantic-conventions';\nimport { Resource } from '../../../Resource';\nimport { DetectorSync, ResourceAttributes } from '../../../types';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { randomUUID } from 'crypto';\n\n/**\n * ServiceInstanceIdDetectorSync detects the resources related to the service instance ID.\n */\nclass ServiceInstanceIdDetectorSync implements DetectorSync {\n detect(_config?: ResourceDetectionConfig): Resource {\n const attributes: ResourceAttributes = {\n [SEMRESATTRS_SERVICE_INSTANCE_ID]: randomUUID(),\n };\n\n return new Resource(attributes);\n }\n}\n\n/**\n * @experimental\n */\nexport const serviceInstanceIdDetectorSync =\n new ServiceInstanceIdDetectorSync();\n"]}

View File

@@ -0,0 +1,8 @@
export { hostDetector } from './HostDetector';
export { hostDetectorSync } from './HostDetectorSync';
export { osDetector } from './OSDetector';
export { osDetectorSync } from './OSDetectorSync';
export { processDetector } from './ProcessDetector';
export { processDetectorSync } from './ProcessDetectorSync';
export { serviceInstanceIdDetectorSync } from './ServiceInstanceIdDetectorSync';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,23 @@
/*
* 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.
*/
export { hostDetector } from './HostDetector';
export { hostDetectorSync } from './HostDetectorSync';
export { osDetector } from './OSDetector';
export { osDetectorSync } from './OSDetectorSync';
export { processDetector } from './ProcessDetector';
export { processDetectorSync } from './ProcessDetectorSync';
export { serviceInstanceIdDetectorSync } from './ServiceInstanceIdDetectorSync';
//# sourceMappingURL=index.js.map

View File

@@ -0,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,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,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 { hostDetectorSync } from './HostDetectorSync';\nexport { osDetector } from './OSDetector';\nexport { osDetectorSync } from './OSDetectorSync';\nexport { processDetector } from './ProcessDetector';\nexport { processDetectorSync } from './ProcessDetectorSync';\nexport { serviceInstanceIdDetectorSync } from './ServiceInstanceIdDetectorSync';\n"]}

View File

@@ -0,0 +1,4 @@
/// <reference types="node" />
import * as child_process from 'child_process';
export declare const execAsync: typeof child_process.exec.__promisify__;
//# sourceMappingURL=execAsync.d.ts.map

View File

@@ -0,0 +1,19 @@
/*
* 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.
*/
import * as child_process from 'child_process';
import * as util from 'util';
export const execAsync = util.promisify(child_process.exec);
//# sourceMappingURL=execAsync.js.map

View File

@@ -0,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"]}

View File

@@ -0,0 +1,2 @@
export declare function getMachineId(): Promise<string>;
//# sourceMappingURL=getMachineId-bsd.d.ts.map

View File

@@ -0,0 +1,36 @@
/*
* 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.
*/
import { promises as fs } from 'fs';
import { execAsync } from './execAsync';
import { diag } from '@opentelemetry/api';
export async function getMachineId() {
try {
const result = await fs.readFile('/etc/hostid', { encoding: 'utf8' });
return result.trim();
}
catch (e) {
diag.debug(`error reading machine id: ${e}`);
}
try {
const result = await execAsync('kenv -q smbios.system.uuid');
return result.stdout.trim();
}
catch (e) {
diag.debug(`error reading machine id: ${e}`);
}
return '';
}
//# sourceMappingURL=getMachineId-bsd.js.map

View File

@@ -0,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,EAAE,CAAC;AACZ,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> {\n try {\n const result = await fs.readFile('/etc/hostid', { encoding: 'utf8' });\n return result.trim();\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n try {\n const result = await execAsync('kenv -q smbios.system.uuid');\n return result.stdout.trim();\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return '';\n}\n"]}

View File

@@ -0,0 +1,2 @@
export declare function getMachineId(): Promise<string>;
//# sourceMappingURL=getMachineId-darwin.d.ts.map

View File

@@ -0,0 +1,37 @@
/*
* 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.
*/
import { execAsync } from './execAsync';
import { diag } from '@opentelemetry/api';
export async function getMachineId() {
try {
const result = await execAsync('ioreg -rd1 -c "IOPlatformExpertDevice"');
const idLine = result.stdout
.split('\n')
.find(line => line.includes('IOPlatformUUID'));
if (!idLine) {
return '';
}
const parts = idLine.split('" = "');
if (parts.length === 2) {
return parts[1].slice(0, -1);
}
}
catch (e) {
diag.debug(`error reading machine id: ${e}`);
}
return '';
}
//# sourceMappingURL=getMachineId-darwin.js.map

View File

@@ -0,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,EAAE,CAAC;SACX;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,EAAE,CAAC;AACZ,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> {\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 '';\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 '';\n}\n"]}

View File

@@ -0,0 +1,2 @@
export declare function getMachineId(): Promise<string>;
//# sourceMappingURL=getMachineId-linux.d.ts.map

View File

@@ -0,0 +1,31 @@
/*
* 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.
*/
import { promises as fs } from 'fs';
import { diag } from '@opentelemetry/api';
export async function getMachineId() {
const paths = ['/etc/machine-id', '/var/lib/dbus/machine-id'];
for (const path of paths) {
try {
const result = await fs.readFile(path, { encoding: 'utf8' });
return result.trim();
}
catch (e) {
diag.debug(`error reading machine id: ${e}`);
}
}
return '';
}
//# sourceMappingURL=getMachineId-linux.js.map

View File

@@ -0,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,EAAE,CAAC;AACZ,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> {\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 '';\n}\n"]}

View File

@@ -0,0 +1,2 @@
export declare function getMachineId(): Promise<string>;
//# sourceMappingURL=getMachineId-unsupported.d.ts.map

View File

@@ -0,0 +1,21 @@
/*
* 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.
*/
import { diag } from '@opentelemetry/api';
export async function getMachineId() {
diag.debug('could not read machine-id: unsupported platform');
return '';
}
//# sourceMappingURL=getMachineId-unsupported.js.map

View File

@@ -0,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,EAAE,CAAC;AACZ,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> {\n diag.debug('could not read machine-id: unsupported platform');\n return '';\n}\n"]}

View File

@@ -0,0 +1,2 @@
export declare function getMachineId(): Promise<string>;
//# sourceMappingURL=getMachineId-win.d.ts.map

View File

@@ -0,0 +1,37 @@
/*
* 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.
*/
import * as process from 'process';
import { execAsync } from './execAsync';
import { diag } from '@opentelemetry/api';
export async function getMachineId() {
const args = 'QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid';
let command = '%windir%\\System32\\REG.exe';
if (process.arch === 'ia32' && 'PROCESSOR_ARCHITEW6432' in process.env) {
command = '%windir%\\sysnative\\cmd.exe /c ' + command;
}
try {
const result = await execAsync(`${command} ${args}`);
const parts = result.stdout.split('REG_SZ');
if (parts.length === 2) {
return parts[1].trim();
}
}
catch (e) {
diag.debug(`error reading machine id: ${e}`);
}
return '';
}
//# sourceMappingURL=getMachineId-win.js.map

View File

@@ -0,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,EAAE,CAAC;AACZ,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> {\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 '';\n}\n"]}

View File

@@ -0,0 +1,3 @@
declare let getMachineId: () => Promise<string>;
export { getMachineId };
//# sourceMappingURL=getMachineId.d.ts.map

View File

@@ -0,0 +1,35 @@
/*
* 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.
*/
import * as process from 'process';
let getMachineId;
switch (process.platform) {
case 'darwin':
({ getMachineId } = require('./getMachineId-darwin'));
break;
case 'linux':
({ getMachineId } = require('./getMachineId-linux'));
break;
case 'freebsd':
({ getMachineId } = require('./getMachineId-bsd'));
break;
case 'win32':
({ getMachineId } = require('./getMachineId-win'));
break;
default:
({ getMachineId } = require('./getMachineId-unsupported'));
}
export { getMachineId };
//# sourceMappingURL=getMachineId.js.map

View File

@@ -0,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,YAAmC,CAAC;AAExC,QAAQ,OAAO,CAAC,QAAQ,EAAE;IACxB,KAAK,QAAQ;QACX,CAAC,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAC;QACtD,MAAM;IACR,KAAK,OAAO;QACV,CAAC,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC;QACrD,MAAM;IACR,KAAK,SAAS;QACZ,CAAC,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC;QACnD,MAAM;IACR,KAAK,OAAO;QACV,CAAC,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC;QACnD,MAAM;IACR;QACE,CAAC,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC,CAAC;CAC9D;AAED,OAAO,EAAE,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 */\nimport * as process from 'process';\n\nlet getMachineId: () => Promise<string>;\n\nswitch (process.platform) {\n case 'darwin':\n ({ getMachineId } = require('./getMachineId-darwin'));\n break;\n case 'linux':\n ({ getMachineId } = require('./getMachineId-linux'));\n break;\n case 'freebsd':\n ({ getMachineId } = require('./getMachineId-bsd'));\n break;\n case 'win32':\n ({ getMachineId } = require('./getMachineId-win'));\n break;\n default:\n ({ getMachineId } = require('./getMachineId-unsupported'));\n}\n\nexport { getMachineId };\n"]}

View File

@@ -0,0 +1,3 @@
export declare const normalizeArch: (nodeArchString: string) => string;
export declare const normalizeType: (nodePlatform: string) => string;
//# sourceMappingURL=utils.d.ts.map

View File

@@ -0,0 +1,42 @@
/*
* 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.
*/
export const normalizeArch = (nodeArchString) => {
// Maps from https://nodejs.org/api/os.html#osarch to arch values in spec:
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/host.md
switch (nodeArchString) {
case 'arm':
return 'arm32';
case 'ppc':
return 'ppc32';
case 'x64':
return 'amd64';
default:
return nodeArchString;
}
};
export const normalizeType = (nodePlatform) => {
// Maps from https://nodejs.org/api/os.html#osplatform to arch values in spec:
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/os.md
switch (nodePlatform) {
case 'sunos':
return 'solaris';
case 'win32':
return 'windows';
default:
return nodePlatform;
}
};
//# sourceMappingURL=utils.js.map

View File

@@ -0,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"]}