New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@opentelemetry/node

Package Overview
Dependencies
Maintainers
3
Versions
153
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/node - npm Package Compare versions

Comparing version 0.8.3 to 0.9.0

15

build/src/config.d.ts

@@ -1,16 +0,1 @@

/**
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Plugins } from './instrumentation/PluginLoader';

@@ -17,0 +2,0 @@ import { TracerConfig } from '@opentelemetry/tracing';

5

build/src/config.js
"use strict";
/**
* Copyright 2019, OpenTelemetry Authors
/*
* Copyright The OpenTelemetry Authors
*

@@ -18,2 +18,3 @@ * Licensed under the Apache License, Version 2.0 (the "License");

Object.defineProperty(exports, "__esModule", { value: true });
exports.DEFAULT_INSTRUMENTATION_PLUGINS = void 0;
/** List of all default supported plugins */

@@ -20,0 +21,0 @@ exports.DEFAULT_INSTRUMENTATION_PLUGINS = {

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

/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './NodeTracerProvider';
//# sourceMappingURL=index.d.ts.map

19

build/src/index.js
"use strict";
/*!
* Copyright 2019, OpenTelemetry Authors
/*
* Copyright The OpenTelemetry Authors
*

@@ -17,7 +17,14 @@ * Licensed under the Apache License, Version 2.0 (the "License");

*/
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./NodeTracerProvider"));
__exportStar(require("./NodeTracerProvider"), exports);
//# sourceMappingURL=index.js.map

@@ -1,16 +0,1 @@

/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Logger, PluginConfig, TracerProvider } from '@opentelemetry/api';

@@ -22,2 +7,7 @@ export declare enum HookState {

}
/**
* Environment variable which will contain list of modules to not load corresponding plugins for
* e.g.OTEL_NO_PATCH_MODULES=pg,https,mongodb
*/
export declare const ENV_PLUGIN_DISABLED_LIST = "OTEL_NO_PATCH_MODULES";
export interface Plugins {

@@ -24,0 +14,0 @@ [pluginName: string]: PluginConfig;

"use strict";
/*!
* Copyright 2019, OpenTelemetry Authors
/*
* Copyright The OpenTelemetry Authors
*

@@ -18,2 +18,3 @@ * Licensed under the Apache License, Version 2.0 (the "License");

Object.defineProperty(exports, "__esModule", { value: true });
exports.searchPathForTest = exports.PluginLoader = exports.ENV_PLUGIN_DISABLED_LIST = exports.HookState = void 0;
const hook = require("require-in-the-middle");

@@ -29,2 +30,11 @@ const utils = require("./utils");

/**
* Environment variable which will contain list of modules to not load corresponding plugins for
* e.g.OTEL_NO_PATCH_MODULES=pg,https,mongodb
*/
exports.ENV_PLUGIN_DISABLED_LIST = 'OTEL_NO_PATCH_MODULES';
/**
* Wildcard symbol. If ignore list is set to this, disable all plugins
*/
const DISABLE_ALL_PLUGINS = '*';
/**
* Returns the Plugins object that meet the below conditions.

@@ -42,2 +52,13 @@ * Valid criteria: 1. It should be enabled. 2. Should have non-empty path.

/**
* Parse process.env[ENV_PLUGIN_DISABLED_LIST] for a list of modules
* not to load corresponding plugins for.
*/
function getIgnoreList() {
const envIgnoreList = process.env[exports.ENV_PLUGIN_DISABLED_LIST] || '';
if (envIgnoreList === DISABLE_ALL_PLUGINS) {
return envIgnoreList;
}
return envIgnoreList.split(',').map(v => v.trim());
}
/**
* The PluginLoader class can load instrumentation plugins that use a patch

@@ -71,2 +92,3 @@ * mechanism to enable automatic tracing for specific target modules.

const modulesToHook = Object.keys(pluginsToLoad);
const modulesToIgnore = getIgnoreList();
// Do not hook require when no module is provided. In this case it is

@@ -109,2 +131,11 @@ // not necessary. With skipping this step we lower our footprint in

}
// Skip loading of all modules if '*' is provided
if (modulesToIgnore === DISABLE_ALL_PLUGINS) {
this.logger.info(`PluginLoader#load: skipped patching module ${name} because all plugins are disabled (${exports.ENV_PLUGIN_DISABLED_LIST})`);
return exports;
}
if (modulesToIgnore.includes(name)) {
this.logger.info(`PluginLoader#load: skipped patching module ${name} because it was on the ignore list (${exports.ENV_PLUGIN_DISABLED_LIST})`);
return exports;
}
this.logger.info(`PluginLoader#load: trying to load ${name}@${version}`);

@@ -111,0 +142,0 @@ if (!version)

@@ -1,16 +0,1 @@

/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Logger } from '@opentelemetry/api';

@@ -17,0 +2,0 @@ /**

"use strict";
/*!
* Copyright 2019, OpenTelemetry Authors
/*
* Copyright The OpenTelemetry Authors
*

@@ -18,2 +18,3 @@ * Licensed under the Apache License, Version 2.0 (the "License");

Object.defineProperty(exports, "__esModule", { value: true });
exports.searchPathForTest = exports.isSupportedVersion = exports.getPackageVersion = void 0;
const path = require("path");

@@ -20,0 +21,0 @@ const semver = require("semver");

@@ -1,16 +0,1 @@

/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { BasicTracerProvider, SDKRegistrationConfig } from '@opentelemetry/tracing';

@@ -17,0 +2,0 @@ import { NodeTracerConfig } from './config';

"use strict";
/*!
* Copyright 2019, OpenTelemetry Authors
/*
* Copyright The OpenTelemetry Authors
*

@@ -18,2 +18,3 @@ * Licensed under the Apache License, Version 2.0 (the "License");

Object.defineProperty(exports, "__esModule", { value: true });
exports.NodeTracerProvider = void 0;
const context_async_hooks_1 = require("@opentelemetry/context-async-hooks");

@@ -20,0 +21,0 @@ const tracing_1 = require("@opentelemetry/tracing");

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

export declare const VERSION = "0.8.3";
export declare const VERSION = "0.9.0";
//# sourceMappingURL=version.d.ts.map
"use strict";
/*
* Copyright 2020, OpenTelemetry Authors
* Copyright The OpenTelemetry Authors
*

@@ -18,4 +18,5 @@ * Licensed under the Apache License, Version 2.0 (the "License");

Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION = void 0;
// this is autogenerated file, see scripts/version-update.js
exports.VERSION = '0.8.3';
exports.VERSION = '0.9.0';
//# sourceMappingURL=version.js.map
{
"name": "@opentelemetry/node",
"version": "0.8.3",
"version": "0.9.0",
"description": "OpenTelemetry Node SDK provides automatic telemetry (tracing, metrics, etc) for Node.js applications",

@@ -44,23 +44,23 @@ "main": "build/src/index.js",

"devDependencies": {
"@opentelemetry/context-base": "^0.8.3",
"@opentelemetry/resources": "^0.8.3",
"@types/mocha": "^7.0.0",
"@types/node": "^14.0.5",
"@types/semver": "^6.0.1",
"@types/shimmer": "^1.0.1",
"codecov": "^3.6.1",
"gts": "^2.0.0",
"mocha": "^7.1.2",
"nyc": "^15.0.0",
"rimraf": "^3.0.0",
"shimmer": "^1.2.0",
"ts-mocha": "^7.0.0",
"ts-node": "^8.6.2",
"typescript": "3.7.2"
"@opentelemetry/context-base": "^0.9.0",
"@opentelemetry/resources": "^0.9.0",
"@types/mocha": "7.0.2",
"@types/node": "14.0.13",
"@types/semver": "7.2.0",
"@types/shimmer": "1.0.1",
"codecov": "3.7.0",
"gts": "2.0.2",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "3.0.2",
"shimmer": "1.2.1",
"ts-mocha": "7.0.0",
"ts-node": "8.10.2",
"typescript": "3.9.5"
},
"dependencies": {
"@opentelemetry/api": "^0.8.3",
"@opentelemetry/context-async-hooks": "^0.8.3",
"@opentelemetry/core": "^0.8.3",
"@opentelemetry/tracing": "^0.8.3",
"@opentelemetry/api": "^0.9.0",
"@opentelemetry/context-async-hooks": "^0.9.0",
"@opentelemetry/core": "^0.9.0",
"@opentelemetry/tracing": "^0.9.0",
"require-in-the-middle": "^5.0.0",

@@ -67,0 +67,0 @@ "semver": "^7.1.3"

@@ -105,2 +105,10 @@ # OpenTelemetry Node SDK

### Disable Plugins with Environment Variables
Plugins can be disabled without modifying and redeploying code.
`OTEL_NO_PATCH_MODULES` accepts a
comma separated list of module names to disabled specific plugins.
The names should match what you use to `require` the module into your application.
For example, `OTEL_NO_PATCH_MODULES=pg,https` will disable the postgres plugin and the https plugin. To disable **all** plugins, set the environment variable to `*`.
## Examples

@@ -107,0 +115,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc