Socket
Socket
Sign inDemoInstall

@opentelemetry/resources

Package Overview
Dependencies
2
Maintainers
2
Versions
167
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.1.0

build/src/detectors/BrowserDetector.d.ts

1

build/src/index.d.ts

@@ -5,2 +5,3 @@ export * from './Resource';

export * from './config';
export * from './detectors';
//# sourceMappingURL=index.d.ts.map

@@ -32,2 +32,3 @@ "use strict";

__exportStar(require("./config"), exports);
__exportStar(require("./detectors"), exports);
//# sourceMappingURL=index.js.map

10

build/src/platform/browser/detect-resources.d.ts
import { Resource } from '../../Resource';
import { ResourceDetectionConfig } from '../../config';
/**
* Detects resources for the browser platform, which is currently only the
* telemetry SDK resource. More could be added in the future. This method
* is async to match the signature of corresponding method for node.
* Runs all resource detectors and returns the results merged into a single
* Resource.
*
* @param config Configuration for resource detection
*/
export declare const detectResources: () => Promise<Resource>;
export declare const detectResources: (config?: ResourceDetectionConfig) => Promise<Resource>;
//# sourceMappingURL=detect-resources.d.ts.map

@@ -20,11 +20,25 @@ "use strict";

const Resource_1 = require("../../Resource");
const api_1 = require("@opentelemetry/api");
/**
* Detects resources for the browser platform, which is currently only the
* telemetry SDK resource. More could be added in the future. This method
* is async to match the signature of corresponding method for node.
* Runs all resource detectors and returns the results merged into a single
* Resource.
*
* @param config Configuration for resource detection
*/
const detectResources = async () => {
return Resource_1.Resource.empty();
const detectResources = async (config = {}) => {
const internalConfig = Object.assign(config);
const resources = await Promise.all((internalConfig.detectors || []).map(async (d) => {
try {
const resource = await d.detect(internalConfig);
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();
}
}));
return resources.reduce((acc, resource) => acc.merge(resource), Resource_1.Resource.empty());
};
exports.detectResources = detectResources;
//# sourceMappingURL=detect-resources.js.map

@@ -49,3 +49,3 @@ "use strict";

*
* @param resources The array of {@link Resource} that should be logged. Empty entried will be ignored.
* @param resources The array of {@link Resource} that should be logged. Empty entries will be ignored.
*/

@@ -52,0 +52,0 @@ const logResources = (resources) => {

export * from './default-service-name';
export * from './detect-resources';
export * from './detectors';
//# sourceMappingURL=index.d.ts.map

@@ -30,3 +30,2 @@ "use strict";

__exportStar(require("./detect-resources"), exports);
__exportStar(require("./detectors"), exports);
//# sourceMappingURL=index.js.map

@@ -47,3 +47,3 @@ "use strict";

return new Resource({
[semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME]: platform_1.defaultServiceName(),
[semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME]: (0, platform_1.defaultServiceName)(),
[semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]: core_1.SDK_INFO[semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE],

@@ -50,0 +50,0 @@ [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_NAME]: core_1.SDK_INFO[semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_NAME],

@@ -1,2 +0,2 @@

export declare const VERSION = "1.0.1";
export declare const VERSION = "1.1.0";
//# sourceMappingURL=version.d.ts.map

@@ -20,3 +20,3 @@ "use strict";

// this is autogenerated file, see scripts/version-update.js
exports.VERSION = '1.0.1';
exports.VERSION = '1.1.0';
//# sourceMappingURL=version.js.map
{
"name": "@opentelemetry/resources",
"version": "1.0.1",
"version": "1.1.0",
"description": "OpenTelemetry SDK resources",
"main": "build/src/index.js",
"module": "build/esm/index.js",
"esnext": "build/esnext/index.js",
"browser": {
"./src/platform/index.ts": "./src/platform/browser/index.ts",
"./build/esm/platform/index.js": "./build/esm/platform/browser/index.js",
"./build/esnext/platform/index.js": "./build/esnext/platform/browser/index.js",
"./build/src/platform/index.js": "./build/src/platform/browser/index.js"

@@ -15,11 +17,13 @@ },

"scripts": {
"compile": "tsc --build tsconfig.json tsconfig.esm.json",
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
"compile": "tsc --build tsconfig.all.json",
"clean": "tsc --build --clean tsconfig.all.json",
"codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
"test:browser": "nyc karma start --single-run",
"tdd": "npm run test -- --watch-extensions ts --watch",
"codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../",
"version": "node ../../scripts/version-update.js",
"precompile": "lerna run version --scope $(npm pkg get name) --include-filtered-dependencies",
"precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies",
"prewatch": "npm run precompile"

@@ -43,2 +47,5 @@ },

"build/esm/**/*.d.ts",
"build/esnext/**/*.js",
"build/esnext/**/*.js.map",
"build/esnext/**/*.d.ts",
"build/src/**/*.js",

@@ -55,9 +62,17 @@ "build/src/**/*.js.map",

"devDependencies": {
"@opentelemetry/api": "~1.0.3",
"@opentelemetry/api": "~1.1.0",
"@types/mocha": "8.2.3",
"@types/node": "14.17.11",
"@types/sinon": "10.0.2",
"@types/node": "14.17.33",
"@types/sinon": "10.0.6",
"@types/webpack-env": "1.16.3",
"codecov": "3.8.3",
"karma": "6.3.16",
"karma-chrome-launcher": "3.1.0",
"karma-coverage-istanbul-reporter": "3.0.3",
"karma-mocha": "2.0.1",
"karma-mocha-webworker": "1.3.0",
"karma-spec-reporter": "0.0.32",
"karma-webpack": "4.0.2",
"mocha": "7.2.0",
"nock": "12.0.3",
"nock": "13.0.11",
"nyc": "15.1.0",

@@ -67,12 +82,15 @@ "rimraf": "3.0.2",

"ts-mocha": "8.0.0",
"typescript": "4.3.5"
"typescript": "4.4.4",
"webpack": "4.46.0",
"webpack-cli": "4.9.1",
"webpack-merge": "5.8.0"
},
"peerDependencies": {
"@opentelemetry/api": ">=1.0.0 <1.1.0"
"@opentelemetry/api": ">=1.0.0 <1.2.0"
},
"dependencies": {
"@opentelemetry/core": "1.0.1",
"@opentelemetry/semantic-conventions": "1.0.1"
"@opentelemetry/core": "1.1.0",
"@opentelemetry/semantic-conventions": "1.1.0"
},
"gitHead": "9cf402ee4231ee1446884b5f59958ceafc1b5188"
"gitHead": "f384303ac469914d0dbafde0758ccdae473f336e"
}
# OpenTelemetry Resources Util
[![NPM Published Version][npm-img]][npm-url]
[![dependencies][dependencies-image]][dependencies-url]
[![devDependencies][devDependencies-image]][devDependencies-url]
[![Apache License][license-image]][license-image]

@@ -48,6 +46,2 @@

[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[dependencies-image]: https://status.david-dm.org/gh/open-telemetry/opentelemetry-js.svg?path=packages%2Fopentelemetry-resources
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-resources
[devDependencies-image]: https://status.david-dm.org/gh/open-telemetry/opentelemetry-js.svg?path=packages%2Fopentelemetry-resources&type=dev
[devDependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-resources&type=dev
[npm-url]: https://www.npmjs.com/package/@opentelemetry/resources

@@ -54,0 +48,0 @@ [npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fresources.svg

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc