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,35 @@
import { ResourceAttributes } from './types';
/**
* An interface that represents a resource. A Resource describes the entity for which signals (metrics or trace) are
* collected.
*
*/
export interface IResource {
/**
* Check if async attributes have resolved. This is useful to avoid awaiting
* waitForAsyncAttributes (which will introduce asynchronous behavior) when not necessary.
*
* @returns true if the resource "attributes" property is not yet settled to its final value
*/
asyncAttributesPending?: boolean;
/**
* @returns the Resource's attributes.
*/
readonly attributes: ResourceAttributes;
/**
* Returns a promise that will never be rejected. Resolves when all async attributes have finished being added to
* this Resource's attributes. This is useful in exporters to block until resource detection
* has finished.
*/
waitForAsyncAttributes?(): Promise<void>;
/**
* Returns a new, merged {@link Resource} by merging the current Resource
* with the other Resource. In case of a collision, other Resource takes
* precedence.
*
* @param other the Resource that will be merged with this.
* @returns the newly merged Resource.
*/
merge(other: IResource | null): IResource;
}
//# sourceMappingURL=IResource.d.ts.map

View File

@@ -0,0 +1,18 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=IResource.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IResource.js","sourceRoot":"","sources":["../../src/IResource.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ResourceAttributes } from './types';\n\n/**\n * An interface that represents a resource. A Resource describes the entity for which signals (metrics or trace) are\n * collected.\n *\n */\nexport interface IResource {\n /**\n * Check if async attributes have resolved. This is useful to avoid awaiting\n * waitForAsyncAttributes (which will introduce asynchronous behavior) when not necessary.\n *\n * @returns true if the resource \"attributes\" property is not yet settled to its final value\n */\n asyncAttributesPending?: boolean;\n\n /**\n * @returns the Resource's attributes.\n */\n readonly attributes: ResourceAttributes;\n\n /**\n * Returns a promise that will never be rejected. Resolves when all async attributes have finished being added to\n * this Resource's attributes. This is useful in exporters to block until resource detection\n * has finished.\n */\n waitForAsyncAttributes?(): Promise<void>;\n\n /**\n * Returns a new, merged {@link Resource} by merging the current Resource\n * with the other Resource. In case of a collision, other Resource takes\n * precedence.\n *\n * @param other the Resource that will be merged with this.\n * @returns the newly merged Resource.\n */\n merge(other: IResource | null): IResource;\n}\n"]}

View File

@@ -0,0 +1,51 @@
import { ResourceAttributes } from './types';
import { IResource } from './IResource';
/**
* A Resource describes the entity for which a signals (metrics or trace) are
* collected.
*/
export declare class Resource implements IResource {
static readonly EMPTY: Resource;
private _syncAttributes?;
private _asyncAttributesPromise?;
private _attributes?;
/**
* Check if async attributes have resolved. This is useful to avoid awaiting
* waitForAsyncAttributes (which will introduce asynchronous behavior) when not necessary.
*
* @returns true if the resource "attributes" property is not yet settled to its final value
*/
asyncAttributesPending?: boolean;
/**
* Returns an empty Resource
*/
static empty(): IResource;
/**
* Returns a Resource that identifies the SDK in use.
*/
static default(): IResource;
constructor(
/**
* A dictionary of attributes with string keys and values that provide
* information about the entity as numbers, strings or booleans
* TODO: Consider to add check/validation on attributes.
*/
attributes: ResourceAttributes, asyncAttributesPromise?: Promise<ResourceAttributes>);
get attributes(): ResourceAttributes;
/**
* Returns a promise that will never be rejected. Resolves when all async attributes have finished being added to
* this Resource's attributes. This is useful in exporters to block until resource detection
* has finished.
*/
waitForAsyncAttributes?(): Promise<void>;
/**
* Returns a new, merged {@link Resource} by merging the current Resource
* with the other Resource. In case of a collision, other Resource takes
* precedence.
*
* @param other the Resource that will be merged with this.
* @returns the newly merged Resource.
*/
merge(other: IResource | null): IResource;
}
//# sourceMappingURL=Resource.d.ts.map

View File

@@ -0,0 +1,113 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.Resource = void 0;
const api_1 = require("@opentelemetry/api");
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
const core_1 = require("@opentelemetry/core");
const platform_1 = require("./platform");
/**
* A Resource describes the entity for which a signals (metrics or trace) are
* collected.
*/
class Resource {
constructor(
/**
* A dictionary of attributes with string keys and values that provide
* information about the entity as numbers, strings or booleans
* TODO: Consider to add check/validation on attributes.
*/
attributes, asyncAttributesPromise) {
var _a;
this._attributes = attributes;
this.asyncAttributesPending = asyncAttributesPromise != null;
this._syncAttributes = (_a = this._attributes) !== null && _a !== void 0 ? _a : {};
this._asyncAttributesPromise = asyncAttributesPromise === null || asyncAttributesPromise === void 0 ? void 0 : asyncAttributesPromise.then(asyncAttributes => {
this._attributes = Object.assign({}, this._attributes, asyncAttributes);
this.asyncAttributesPending = false;
return asyncAttributes;
}, err => {
api_1.diag.debug("a resource's async attributes promise rejected: %s", err);
this.asyncAttributesPending = false;
return {};
});
}
/**
* Returns an empty Resource
*/
static empty() {
return Resource.EMPTY;
}
/**
* Returns a Resource that identifies the SDK in use.
*/
static default() {
return new Resource({
[semantic_conventions_1.SEMRESATTRS_SERVICE_NAME]: (0, platform_1.defaultServiceName)(),
[semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]: core_1.SDK_INFO[semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE],
[semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME]: core_1.SDK_INFO[semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME],
[semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_VERSION]: core_1.SDK_INFO[semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_VERSION],
});
}
get attributes() {
var _a;
if (this.asyncAttributesPending) {
api_1.diag.error('Accessing resource attributes before async attributes settled');
}
return (_a = this._attributes) !== null && _a !== void 0 ? _a : {};
}
/**
* Returns a promise that will never be rejected. Resolves when all async attributes have finished being added to
* this Resource's attributes. This is useful in exporters to block until resource detection
* has finished.
*/
async waitForAsyncAttributes() {
if (this.asyncAttributesPending) {
await this._asyncAttributesPromise;
}
}
/**
* Returns a new, merged {@link Resource} by merging the current Resource
* with the other Resource. In case of a collision, other Resource takes
* precedence.
*
* @param other the Resource that will be merged with this.
* @returns the newly merged Resource.
*/
merge(other) {
var _a;
if (!other)
return this;
// SpanAttributes from other resource overwrite attributes from this resource.
const mergedSyncAttributes = Object.assign(Object.assign({}, this._syncAttributes), ((_a = other._syncAttributes) !== null && _a !== void 0 ? _a : other.attributes));
if (!this._asyncAttributesPromise &&
!other._asyncAttributesPromise) {
return new Resource(mergedSyncAttributes);
}
const mergedAttributesPromise = Promise.all([
this._asyncAttributesPromise,
other._asyncAttributesPromise,
]).then(([thisAsyncAttributes, otherAsyncAttributes]) => {
var _a;
return Object.assign(Object.assign(Object.assign(Object.assign({}, this._syncAttributes), thisAsyncAttributes), ((_a = other._syncAttributes) !== null && _a !== void 0 ? _a : other.attributes)), otherAsyncAttributes);
});
return new Resource(mergedSyncAttributes, mergedAttributesPromise);
}
}
exports.Resource = Resource;
Resource.EMPTY = new Resource({});
//# sourceMappingURL=Resource.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
import type { Detector, DetectorSync } from './types';
/**
* ResourceDetectionConfig provides an interface for configuring resource auto-detection.
*/
export interface ResourceDetectionConfig {
detectors?: Array<Detector | DetectorSync>;
}
//# sourceMappingURL=config.d.ts.map

View File

@@ -0,0 +1,18 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=config.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Detector, DetectorSync } from './types';\n\n/**\n * ResourceDetectionConfig provides an interface for configuring resource auto-detection.\n */\nexport interface ResourceDetectionConfig {\n detectors?: Array<Detector | DetectorSync>;\n}\n"]}

View File

@@ -0,0 +1,18 @@
import { ResourceDetectionConfig } from './config';
import { IResource } from './IResource';
/**
* Runs all resource detectors and returns the results merged into a single Resource. Promise
* does not resolve until all the underlying detectors have resolved, unlike
* detectResourcesSync.
*
* @deprecated use detectResourcesSync() instead.
* @param config Configuration for resource detection
*/
export declare const detectResources: (config?: ResourceDetectionConfig) => Promise<IResource>;
/**
* Runs all resource detectors synchronously, merging their results. In case of attribute collision later resources will take precedence.
*
* @param config Configuration for resource detection
*/
export declare const detectResourcesSync: (config?: ResourceDetectionConfig) => IResource;
//# sourceMappingURL=detect-resources.d.ts.map

View File

@@ -0,0 +1,109 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.detectResourcesSync = exports.detectResources = void 0;
const Resource_1 = require("./Resource");
const api_1 = require("@opentelemetry/api");
const utils_1 = require("./utils");
/**
* Runs all resource detectors and returns the results merged into a single Resource. Promise
* does not resolve until all the underlying detectors have resolved, unlike
* detectResourcesSync.
*
* @deprecated use detectResourcesSync() instead.
* @param config Configuration for resource detection
*/
const detectResources = async (config = {}) => {
const resources = await Promise.all((config.detectors || []).map(async (d) => {
try {
const resource = await d.detect(config);
api_1.diag.debug(`${d.constructor.name} found resource.`, resource);
return resource;
}
catch (e) {
api_1.diag.debug(`${d.constructor.name} failed: ${e.message}`);
return Resource_1.Resource.empty();
}
}));
// Future check if verbose logging is enabled issue #1903
logResources(resources);
return resources.reduce((acc, resource) => acc.merge(resource), Resource_1.Resource.empty());
};
exports.detectResources = detectResources;
/**
* Runs all resource detectors synchronously, merging their results. In case of attribute collision later resources will take precedence.
*
* @param config Configuration for resource detection
*/
const detectResourcesSync = (config = {}) => {
var _a;
const resources = ((_a = config.detectors) !== null && _a !== void 0 ? _a : []).map((d) => {
try {
const resourceOrPromise = d.detect(config);
let resource;
if ((0, utils_1.isPromiseLike)(resourceOrPromise)) {
const createPromise = async () => {
var _a;
const resolvedResource = await resourceOrPromise;
await ((_a = resolvedResource.waitForAsyncAttributes) === null || _a === void 0 ? void 0 : _a.call(resolvedResource));
return resolvedResource.attributes;
};
resource = new Resource_1.Resource({}, createPromise());
}
else {
resource = resourceOrPromise;
}
if (resource.waitForAsyncAttributes) {
void resource
.waitForAsyncAttributes()
.then(() => api_1.diag.debug(`${d.constructor.name} found resource.`, resource));
}
else {
api_1.diag.debug(`${d.constructor.name} found resource.`, resource);
}
return resource;
}
catch (e) {
api_1.diag.error(`${d.constructor.name} failed: ${e.message}`);
return Resource_1.Resource.empty();
}
});
const mergedResources = resources.reduce((acc, resource) => acc.merge(resource), Resource_1.Resource.empty());
if (mergedResources.waitForAsyncAttributes) {
void mergedResources.waitForAsyncAttributes().then(() => {
// Future check if verbose logging is enabled issue #1903
logResources(resources);
});
}
return mergedResources;
};
exports.detectResourcesSync = detectResourcesSync;
/**
* Writes debug information about the detected resources to the logger defined in the resource detection config, if one is provided.
*
* @param resources The array of {@link Resource} that should be logged. Empty entries will be ignored.
*/
const logResources = (resources) => {
resources.forEach(resource => {
// Print only populated resources
if (Object.keys(resource.attributes).length > 0) {
const resourceDebugString = JSON.stringify(resource.attributes, null, 4);
api_1.diag.verbose(resourceDebugString);
}
});
};
//# sourceMappingURL=detect-resources.js.map

File diff suppressed because one or more lines are too long

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,29 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.browserDetector = void 0;
const BrowserDetectorSync_1 = require("./BrowserDetectorSync");
/**
* BrowserDetector will be used to detect the resources related to browser.
*/
class BrowserDetector {
detect(config) {
return Promise.resolve(BrowserDetectorSync_1.browserDetectorSync.detect(config));
}
}
exports.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,+DAA4D;AAE5D;;GAEG;AACH,MAAM,eAAe;IACnB,MAAM,CAAC,MAAgC;QACrC,OAAO,OAAO,CAAC,OAAO,CAAC,yCAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,CAAC;CACF;AAEY,QAAA,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { 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,61 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.browserDetectorSync = void 0;
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
const api_1 = require("@opentelemetry/api");
const Resource_1 = require("../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_1.Resource.empty();
}
const browserResource = {
[semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'browser',
[semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION]: 'Web Browser',
[semantic_conventions_1.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[semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_VERSION] === '') {
api_1.diag.debug('BrowserDetector failed: Unable to find required browser resources. ');
return Resource_1.Resource.empty();
}
else {
return new Resource_1.Resource(Object.assign({}, browserResource));
}
}
}
exports.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,8EAI6C;AAE7C,4CAA0C;AAG1C,0CAAuC;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,mBAAQ,CAAC,KAAK,EAAE,CAAC;SACzB;QACD,MAAM,eAAe,GAAuB;YAC1C,CAAC,uDAAgC,CAAC,EAAE,SAAS;YAC7C,CAAC,8DAAuC,CAAC,EAAE,aAAa;YACxD,CAAC,0DAAmC,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,0DAAmC,CAAC,KAAK,EAAE,EAAE;YAC/D,UAAI,CAAC,KAAK,CACR,qEAAqE,CACtE,CAAC;YACF,OAAO,mBAAQ,CAAC,KAAK,EAAE,CAAC;SACzB;aAAM;YACL,OAAO,IAAI,mBAAQ,mBACd,eAAe,EAClB,CAAC;SACJ;IACH,CAAC;CACF;AAEY,QAAA,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,37 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.envDetector = void 0;
const EnvDetectorSync_1 = require("./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_1.envDetectorSync.detect(config));
}
}
exports.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,uDAAoD;AAEpD;;;GAGG;AACH,MAAM,WAAW;IACf;;;;;;OAMG;IACH,MAAM,CAAC,MAAgC;QACrC,OAAO,OAAO,CAAC,OAAO,CAAC,iCAAe,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACzD,CAAC;CACF;AAEY,QAAA,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { 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,138 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.envDetectorSync = void 0;
const api_1 = require("@opentelemetry/api");
const core_1 = require("@opentelemetry/core");
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
const Resource_1 = require("../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 = (0, core_1.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) {
api_1.diag.debug(`EnvDetector failed: ${e.message}`);
}
}
if (serviceName) {
attributes[semantic_conventions_1.SEMRESATTRS_SERVICE_NAME] = serviceName;
}
return new Resource_1.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);
}
}
exports.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,27 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.noopDetector = exports.NoopDetector = void 0;
const NoopDetectorSync_1 = require("./NoopDetectorSync");
class NoopDetector {
detect() {
return Promise.resolve(NoopDetectorSync_1.noopDetectorSync.detect());
}
}
exports.NoopDetector = NoopDetector;
exports.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,yDAAsD;AAEtD,MAAa,YAAY;IACvB,MAAM;QACJ,OAAO,OAAO,CAAC,OAAO,CAAC,mCAAgB,CAAC,MAAM,EAAE,CAAC,CAAC;IACpD,CAAC;CACF;AAJD,oCAIC;AAEY,QAAA,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { 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,27 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.noopDetectorSync = exports.NoopDetectorSync = void 0;
const Resource_1 = require("../Resource");
class NoopDetectorSync {
detect() {
return new Resource_1.Resource({});
}
}
exports.NoopDetectorSync = NoopDetectorSync;
exports.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,0CAAuC;AAIvC,MAAa,gBAAgB;IAC3B,MAAM;QACJ,OAAO,IAAI,mBAAQ,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC;CACF;AAJD,4CAIC;AAEY,QAAA,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,35 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.envDetectorSync = exports.browserDetectorSync = exports.envDetector = exports.browserDetector = exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = void 0;
var platform_1 = require("./platform");
Object.defineProperty(exports, "hostDetector", { enumerable: true, get: function () { return platform_1.hostDetector; } });
Object.defineProperty(exports, "hostDetectorSync", { enumerable: true, get: function () { return platform_1.hostDetectorSync; } });
Object.defineProperty(exports, "osDetector", { enumerable: true, get: function () { return platform_1.osDetector; } });
Object.defineProperty(exports, "osDetectorSync", { enumerable: true, get: function () { return platform_1.osDetectorSync; } });
Object.defineProperty(exports, "processDetector", { enumerable: true, get: function () { return platform_1.processDetector; } });
Object.defineProperty(exports, "processDetectorSync", { enumerable: true, get: function () { return platform_1.processDetectorSync; } });
Object.defineProperty(exports, "serviceInstanceIdDetectorSync", { enumerable: true, get: function () { return platform_1.serviceInstanceIdDetectorSync; } });
var BrowserDetector_1 = require("./BrowserDetector");
Object.defineProperty(exports, "browserDetector", { enumerable: true, get: function () { return BrowserDetector_1.browserDetector; } });
var EnvDetector_1 = require("./EnvDetector");
Object.defineProperty(exports, "envDetector", { enumerable: true, get: function () { return EnvDetector_1.envDetector; } });
var BrowserDetectorSync_1 = require("./BrowserDetectorSync");
Object.defineProperty(exports, "browserDetectorSync", { enumerable: true, get: function () { return BrowserDetectorSync_1.browserDetectorSync; } });
var EnvDetectorSync_1 = require("./EnvDetectorSync");
Object.defineProperty(exports, "envDetectorSync", { enumerable: true, get: function () { return EnvDetectorSync_1.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,uCAQoB;AAPlB,wGAAA,YAAY,OAAA;AACZ,4GAAA,gBAAgB,OAAA;AAChB,sGAAA,UAAU,OAAA;AACV,0GAAA,cAAc,OAAA;AACd,2GAAA,eAAe,OAAA;AACf,+GAAA,mBAAmB,OAAA;AACnB,yHAAA,6BAA6B,OAAA;AAE/B,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,qDAAoD;AAA3C,kHAAA,eAAe,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport {\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,21 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.hostDetector = void 0;
const NoopDetector_1 = require("../../NoopDetector");
exports.hostDetector = NoopDetector_1.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,qDAAkD;AAErC,QAAA,YAAY,GAAG,2BAAY,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { noopDetector } from '../../NoopDetector';\n\nexport const hostDetector = noopDetector;\n"]}

View File

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

View File

@@ -0,0 +1,21 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.hostDetectorSync = void 0;
const NoopDetectorSync_1 = require("../../NoopDetectorSync");
exports.hostDetectorSync = NoopDetectorSync_1.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,6DAA0D;AAE7C,QAAA,gBAAgB,GAAG,mCAAgB,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,21 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.osDetector = void 0;
const NoopDetector_1 = require("../../NoopDetector");
exports.osDetector = NoopDetector_1.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,qDAAkD;AAErC,QAAA,UAAU,GAAG,2BAAY,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { noopDetector } from '../../NoopDetector';\n\nexport const osDetector = noopDetector;\n"]}

View File

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

View File

@@ -0,0 +1,21 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.osDetectorSync = void 0;
const NoopDetectorSync_1 = require("../../NoopDetectorSync");
exports.osDetectorSync = NoopDetectorSync_1.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,6DAA0D;AAE7C,QAAA,cAAc,GAAG,mCAAgB,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,21 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.processDetector = void 0;
const NoopDetector_1 = require("../../NoopDetector");
exports.processDetector = NoopDetector_1.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,qDAAkD;AAErC,QAAA,eAAe,GAAG,2BAAY,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { noopDetector } from '../../NoopDetector';\n\nexport const processDetector = noopDetector;\n"]}

View File

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

View File

@@ -0,0 +1,21 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.processDetectorSync = void 0;
const NoopDetector_1 = require("../../NoopDetector");
exports.processDetectorSync = NoopDetector_1.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,qDAAkD;AAErC,QAAA,mBAAmB,GAAG,2BAAY,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { noopDetector } from '../../NoopDetector';\n\nexport const 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,24 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.serviceInstanceIdDetectorSync = void 0;
const NoopDetectorSync_1 = require("../../NoopDetectorSync");
/**
* @experimental
*/
exports.serviceInstanceIdDetectorSync = NoopDetectorSync_1.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,6DAA0D;AAE1D;;GAEG;AACU,QAAA,6BAA6B,GAAG,mCAAgB,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,33 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = void 0;
var HostDetector_1 = require("./HostDetector");
Object.defineProperty(exports, "hostDetector", { enumerable: true, get: function () { return HostDetector_1.hostDetector; } });
var HostDetectorSync_1 = require("./HostDetectorSync");
Object.defineProperty(exports, "hostDetectorSync", { enumerable: true, get: function () { return HostDetectorSync_1.hostDetectorSync; } });
var OSDetector_1 = require("./OSDetector");
Object.defineProperty(exports, "osDetector", { enumerable: true, get: function () { return OSDetector_1.osDetector; } });
var OSDetectorSync_1 = require("./OSDetectorSync");
Object.defineProperty(exports, "osDetectorSync", { enumerable: true, get: function () { return OSDetectorSync_1.osDetectorSync; } });
var ProcessDetector_1 = require("./ProcessDetector");
Object.defineProperty(exports, "processDetector", { enumerable: true, get: function () { return ProcessDetector_1.processDetector; } });
var ProcessDetectorSync_1 = require("./ProcessDetectorSync");
Object.defineProperty(exports, "processDetectorSync", { enumerable: true, get: function () { return ProcessDetectorSync_1.processDetectorSync; } });
var ServiceInstanceIdDetectorSync_1 = require("./ServiceInstanceIdDetectorSync");
Object.defineProperty(exports, "serviceInstanceIdDetectorSync", { enumerable: true, get: function () { return ServiceInstanceIdDetectorSync_1.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,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,iFAAgF;AAAvE,8IAAA,6BAA6B,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { hostDetector } from './HostDetector';\nexport { 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,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = void 0;
/*
* 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.
*/
var node_1 = require("./node");
Object.defineProperty(exports, "hostDetector", { enumerable: true, get: function () { return node_1.hostDetector; } });
Object.defineProperty(exports, "hostDetectorSync", { enumerable: true, get: function () { return node_1.hostDetectorSync; } });
Object.defineProperty(exports, "osDetector", { enumerable: true, get: function () { return node_1.osDetector; } });
Object.defineProperty(exports, "osDetectorSync", { enumerable: true, get: function () { return node_1.osDetectorSync; } });
Object.defineProperty(exports, "processDetector", { enumerable: true, get: function () { return node_1.processDetector; } });
Object.defineProperty(exports, "processDetectorSync", { enumerable: true, get: function () { return node_1.processDetectorSync; } });
Object.defineProperty(exports, "serviceInstanceIdDetectorSync", { enumerable: true, get: function () { return node_1.serviceInstanceIdDetectorSync; } });
//# 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,+BAQgB;AAPd,oGAAA,YAAY,OAAA;AACZ,wGAAA,gBAAgB,OAAA;AAChB,kGAAA,UAAU,OAAA;AACV,sGAAA,cAAc,OAAA;AACd,uGAAA,eAAe,OAAA;AACf,2GAAA,mBAAmB,OAAA;AACnB,qHAAA,6BAA6B,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport {\n hostDetector,\n 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,30 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.hostDetector = void 0;
const HostDetectorSync_1 = require("./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_1.hostDetectorSync.detect(_config));
}
}
exports.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,yDAAsD;AAEtD;;;GAGG;AACH,MAAM,YAAY;IAChB,MAAM,CAAC,OAAiC;QACtC,OAAO,OAAO,CAAC,OAAO,CAAC,mCAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3D,CAAC;CACF;AAEY,QAAA,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { 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,47 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.hostDetectorSync = void 0;
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
const Resource_1 = require("../../../Resource");
const os_1 = require("os");
const utils_1 = require("./utils");
const getMachineId_1 = require("./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 = {
[semantic_conventions_1.SEMRESATTRS_HOST_NAME]: (0, os_1.hostname)(),
[semantic_conventions_1.SEMRESATTRS_HOST_ARCH]: (0, utils_1.normalizeArch)((0, os_1.arch)()),
};
return new Resource_1.Resource(attributes, this._getAsyncAttributes());
}
_getAsyncAttributes() {
return (0, getMachineId_1.getMachineId)().then(machineId => {
const attributes = {};
if (machineId) {
attributes[semantic_conventions_1.SEMRESATTRS_HOST_ID] = machineId;
}
return attributes;
});
}
}
exports.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,8EAI6C;AAC7C,gDAA6C;AAG7C,2BAAoC;AACpC,mCAAwC;AACxC,4DAAyD;AAEzD;;;GAGG;AACH,MAAM,gBAAgB;IACpB,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAuB;YACrC,CAAC,4CAAqB,CAAC,EAAE,IAAA,aAAQ,GAAE;YACnC,CAAC,4CAAqB,CAAC,EAAE,IAAA,qBAAa,EAAC,IAAA,SAAI,GAAE,CAAC;SAC/C,CAAC;QAEF,OAAO,IAAI,mBAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAC9D,CAAC;IAEO,mBAAmB;QACzB,OAAO,IAAA,2BAAY,GAAE,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;YACrC,MAAM,UAAU,GAAuB,EAAE,CAAC;YAC1C,IAAI,SAAS,EAAE;gBACb,UAAU,CAAC,0CAAmB,CAAC,GAAG,SAAS,CAAC;aAC7C;YACD,OAAO,UAAU,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAEY,QAAA,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,30 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.osDetector = void 0;
const OSDetectorSync_1 = require("./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_1.osDetectorSync.detect(_config));
}
}
exports.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,qDAAkD;AAElD;;;GAGG;AACH,MAAM,UAAU;IACd,MAAM,CAAC,OAAiC;QACtC,OAAO,OAAO,CAAC,OAAO,CAAC,+BAAc,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACzD,CAAC;CACF;AAEY,QAAA,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { 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,37 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.osDetectorSync = void 0;
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
const Resource_1 = require("../../../Resource");
const os_1 = require("os");
const utils_1 = require("./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 = {
[semantic_conventions_1.SEMRESATTRS_OS_TYPE]: (0, utils_1.normalizeType)((0, os_1.platform)()),
[semantic_conventions_1.SEMRESATTRS_OS_VERSION]: (0, os_1.release)(),
};
return new Resource_1.Resource(attributes);
}
}
exports.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,8EAG6C;AAC7C,gDAA6C;AAG7C,2BAAuC;AACvC,mCAAwC;AAExC;;;GAGG;AACH,MAAM,cAAc;IAClB,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAuB;YACrC,CAAC,0CAAmB,CAAC,EAAE,IAAA,qBAAa,EAAC,IAAA,aAAQ,GAAE,CAAC;YAChD,CAAC,6CAAsB,CAAC,EAAE,IAAA,YAAO,GAAE;SACpC,CAAC;QACF,OAAO,IAAI,mBAAQ,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;CACF;AAEY,QAAA,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,30 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.processDetector = void 0;
const ProcessDetectorSync_1 = require("./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_1.processDetectorSync.detect(config));
}
}
exports.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,+DAA4D;AAE5D;;;GAGG;AACH,MAAM,eAAe;IACnB,MAAM,CAAC,MAAgC;QACrC,OAAO,OAAO,CAAC,OAAO,CAAC,yCAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,CAAC;CACF;AAEY,QAAA,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { 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,56 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.processDetectorSync = void 0;
const api_1 = require("@opentelemetry/api");
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
const Resource_1 = require("../../../Resource");
const os = require("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 = {
[semantic_conventions_1.SEMRESATTRS_PROCESS_PID]: process.pid,
[semantic_conventions_1.SEMRESATTRS_PROCESS_EXECUTABLE_NAME]: process.title,
[semantic_conventions_1.SEMRESATTRS_PROCESS_EXECUTABLE_PATH]: process.execPath,
[semantic_conventions_1.SEMRESATTRS_PROCESS_COMMAND_ARGS]: [
process.argv[0],
...process.execArgv,
...process.argv.slice(1),
],
[semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_VERSION]: process.versions.node,
[semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'nodejs',
[semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION]: 'Node.js',
};
if (process.argv.length > 1) {
attributes[semantic_conventions_1.SEMRESATTRS_PROCESS_COMMAND] = process.argv[1];
}
try {
const userInfo = os.userInfo();
attributes[semantic_conventions_1.SEMRESATTRS_PROCESS_OWNER] = userInfo.username;
}
catch (e) {
api_1.diag.debug(`error obtaining process owner: ${e}`);
}
return new Resource_1.Resource(attributes);
}
}
exports.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,4CAA0C;AAC1C,8EAU6C;AAC7C,gDAA6C;AAI7C,yBAAyB;AAEzB;;;GAGG;AACH,MAAM,mBAAmB;IACvB,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAuB;YACrC,CAAC,8CAAuB,CAAC,EAAE,OAAO,CAAC,GAAG;YACtC,CAAC,0DAAmC,CAAC,EAAE,OAAO,CAAC,KAAK;YACpD,CAAC,0DAAmC,CAAC,EAAE,OAAO,CAAC,QAAQ;YACvD,CAAC,uDAAgC,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,0DAAmC,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;YAC5D,CAAC,uDAAgC,CAAC,EAAE,QAAQ;YAC5C,CAAC,8DAAuC,CAAC,EAAE,SAAS;SACrD,CAAC;QAEF,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3B,UAAU,CAAC,kDAA2B,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,gDAAyB,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC;SAC3D;QAAC,OAAO,CAAC,EAAE;YACV,UAAI,CAAC,KAAK,CAAC,kCAAkC,CAAC,EAAE,CAAC,CAAC;SACnD;QAED,OAAO,IAAI,mBAAQ,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;CACF;AAEY,QAAA,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,37 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.serviceInstanceIdDetectorSync = void 0;
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
const Resource_1 = require("../../../Resource");
const crypto_1 = require("crypto");
/**
* ServiceInstanceIdDetectorSync detects the resources related to the service instance ID.
*/
class ServiceInstanceIdDetectorSync {
detect(_config) {
const attributes = {
[semantic_conventions_1.SEMRESATTRS_SERVICE_INSTANCE_ID]: (0, crypto_1.randomUUID)(),
};
return new Resource_1.Resource(attributes);
}
}
/**
* @experimental
*/
exports.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,8EAAsF;AACtF,gDAA6C;AAG7C,mCAAoC;AAEpC;;GAEG;AACH,MAAM,6BAA6B;IACjC,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAuB;YACrC,CAAC,sDAA+B,CAAC,EAAE,IAAA,mBAAU,GAAE;SAChD,CAAC;QAEF,OAAO,IAAI,mBAAQ,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;CACF;AAED;;GAEG;AACU,QAAA,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,33 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = void 0;
var HostDetector_1 = require("./HostDetector");
Object.defineProperty(exports, "hostDetector", { enumerable: true, get: function () { return HostDetector_1.hostDetector; } });
var HostDetectorSync_1 = require("./HostDetectorSync");
Object.defineProperty(exports, "hostDetectorSync", { enumerable: true, get: function () { return HostDetectorSync_1.hostDetectorSync; } });
var OSDetector_1 = require("./OSDetector");
Object.defineProperty(exports, "osDetector", { enumerable: true, get: function () { return OSDetector_1.osDetector; } });
var OSDetectorSync_1 = require("./OSDetectorSync");
Object.defineProperty(exports, "osDetectorSync", { enumerable: true, get: function () { return OSDetectorSync_1.osDetectorSync; } });
var ProcessDetector_1 = require("./ProcessDetector");
Object.defineProperty(exports, "processDetector", { enumerable: true, get: function () { return ProcessDetector_1.processDetector; } });
var ProcessDetectorSync_1 = require("./ProcessDetectorSync");
Object.defineProperty(exports, "processDetectorSync", { enumerable: true, get: function () { return ProcessDetectorSync_1.processDetectorSync; } });
var ServiceInstanceIdDetectorSync_1 = require("./ServiceInstanceIdDetectorSync");
Object.defineProperty(exports, "serviceInstanceIdDetectorSync", { enumerable: true, get: function () { return ServiceInstanceIdDetectorSync_1.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,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,iFAAgF;AAAvE,8IAAA,6BAA6B,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { hostDetector } from './HostDetector';\nexport { 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,22 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.execAsync = void 0;
const child_process = require("child_process");
const util = require("util");
exports.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,+CAA+C;AAC/C,6BAA6B;AAEhB,QAAA,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as child_process from 'child_process';\nimport * as util from 'util';\n\nexport const execAsync = util.promisify(child_process.exec);\n"]}

View File

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

View File

@@ -0,0 +1,40 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMachineId = void 0;
const fs_1 = require("fs");
const execAsync_1 = require("./execAsync");
const api_1 = require("@opentelemetry/api");
async function getMachineId() {
try {
const result = await fs_1.promises.readFile('/etc/hostid', { encoding: 'utf8' });
return result.trim();
}
catch (e) {
api_1.diag.debug(`error reading machine id: ${e}`);
}
try {
const result = await (0, execAsync_1.execAsync)('kenv -q smbios.system.uuid');
return result.stdout.trim();
}
catch (e) {
api_1.diag.debug(`error reading machine id: ${e}`);
}
return '';
}
exports.getMachineId = getMachineId;
//# 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,2BAAoC;AACpC,2CAAwC;AACxC,4CAA0C;AAEnC,KAAK,UAAU,YAAY;IAChC,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,aAAE,CAAC,QAAQ,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QACtE,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;KACtB;IAAC,OAAO,CAAC,EAAE;QACV,UAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAS,EAAC,4BAA4B,CAAC,CAAC;QAC7D,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;KAC7B;IAAC,OAAO,CAAC,EAAE;QACV,UAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAhBD,oCAgBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { promises as fs } from 'fs';\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string> {\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,41 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMachineId = void 0;
const execAsync_1 = require("./execAsync");
const api_1 = require("@opentelemetry/api");
async function getMachineId() {
try {
const result = await (0, execAsync_1.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) {
api_1.diag.debug(`error reading machine id: ${e}`);
}
return '';
}
exports.getMachineId = getMachineId;
//# 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,2CAAwC;AACxC,4CAA0C;AAEnC,KAAK,UAAU,YAAY;IAChC,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAS,EAAC,wCAAwC,CAAC,CAAC;QAEzE,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM;aACzB,KAAK,CAAC,IAAI,CAAC;aACX,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAEjD,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,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,UAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AArBD,oCAqBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string> {\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,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMachineId = void 0;
/*
* 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.
*/
const fs_1 = require("fs");
const api_1 = require("@opentelemetry/api");
async function getMachineId() {
const paths = ['/etc/machine-id', '/var/lib/dbus/machine-id'];
for (const path of paths) {
try {
const result = await fs_1.promises.readFile(path, { encoding: 'utf8' });
return result.trim();
}
catch (e) {
api_1.diag.debug(`error reading machine id: ${e}`);
}
}
return '';
}
exports.getMachineId = getMachineId;
//# 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,2BAAoC;AACpC,4CAA0C;AAEnC,KAAK,UAAU,YAAY;IAChC,MAAM,KAAK,GAAG,CAAC,iBAAiB,EAAE,0BAA0B,CAAC,CAAC;IAE9D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,aAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;YAC7D,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;SACtB;QAAC,OAAO,CAAC,EAAE;YACV,UAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;SAC9C;KACF;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAbD,oCAaC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { promises as fs } from 'fs';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string> {\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,25 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMachineId = void 0;
const api_1 = require("@opentelemetry/api");
async function getMachineId() {
api_1.diag.debug('could not read machine-id: unsupported platform');
return '';
}
exports.getMachineId = getMachineId;
//# 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,4CAA0C;AAEnC,KAAK,UAAU,YAAY;IAChC,UAAI,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;IAC9D,OAAO,EAAE,CAAC;AACZ,CAAC;AAHD,oCAGC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string> {\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

Some files were not shown because too many files have changed in this diff Show More