Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@opentelemetry/instrumentation-http

Package Overview
Dependencies
Maintainers
3
Versions
192
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/instrumentation-http - npm Package Compare versions

Comparing version 0.52.1 to 0.53.0

40

build/src/http.js

@@ -60,5 +60,9 @@ "use strict";

return new instrumentation_1.InstrumentationNodeModuleDefinition('http', ['*'], (moduleExports) => {
this._wrap(moduleExports, 'request', this._getPatchOutgoingRequestFunction('http'));
this._wrap(moduleExports, 'get', this._getPatchOutgoingGetFunction(moduleExports.request));
this._wrap(moduleExports.Server.prototype, 'emit', this._getPatchIncomingRequestFunction('http'));
if (!this.getConfig().disableOutgoingRequestInstrumentation) {
const patchedRequest = this._wrap(moduleExports, 'request', this._getPatchOutgoingRequestFunction('http'));
this._wrap(moduleExports, 'get', this._getPatchOutgoingGetFunction(patchedRequest));
}
if (!this.getConfig().disableIncomingRequestInstrumentation) {
this._wrap(moduleExports.Server.prototype, 'emit', this._getPatchIncomingRequestFunction('http'));
}
return moduleExports;

@@ -68,5 +72,9 @@ }, (moduleExports) => {

return;
this._unwrap(moduleExports, 'request');
this._unwrap(moduleExports, 'get');
this._unwrap(moduleExports.Server.prototype, 'emit');
if (!this.getConfig().disableOutgoingRequestInstrumentation) {
this._unwrap(moduleExports, 'request');
this._unwrap(moduleExports, 'get');
}
if (!this.getConfig().disableIncomingRequestInstrumentation) {
this._unwrap(moduleExports.Server.prototype, 'emit');
}
});

@@ -76,5 +84,9 @@ }

return new instrumentation_1.InstrumentationNodeModuleDefinition('https', ['*'], (moduleExports) => {
this._wrap(moduleExports, 'request', this._getPatchHttpsOutgoingRequestFunction('https'));
this._wrap(moduleExports, 'get', this._getPatchHttpsOutgoingGetFunction(moduleExports.request));
this._wrap(moduleExports.Server.prototype, 'emit', this._getPatchIncomingRequestFunction('https'));
if (!this.getConfig().disableOutgoingRequestInstrumentation) {
const patchedRequest = this._wrap(moduleExports, 'request', this._getPatchHttpsOutgoingRequestFunction('https'));
this._wrap(moduleExports, 'get', this._getPatchHttpsOutgoingGetFunction(patchedRequest));
}
if (!this.getConfig().disableIncomingRequestInstrumentation) {
this._wrap(moduleExports.Server.prototype, 'emit', this._getPatchIncomingRequestFunction('https'));
}
return moduleExports;

@@ -84,5 +96,9 @@ }, (moduleExports) => {

return;
this._unwrap(moduleExports, 'request');
this._unwrap(moduleExports, 'get');
this._unwrap(moduleExports.Server.prototype, 'emit');
if (!this.getConfig().disableOutgoingRequestInstrumentation) {
this._unwrap(moduleExports, 'request');
this._unwrap(moduleExports, 'get');
}
if (!this.getConfig().disableIncomingRequestInstrumentation) {
this._unwrap(moduleExports.Server.prototype, 'emit');
}
});

@@ -89,0 +105,0 @@ }

@@ -1,4 +0,4 @@

export * from './http';
export * from './types';
export * from './utils';
export { HttpInstrumentation } from './http';
export { Err, Func, GetFunction, Http, HttpCallback, HttpCallbackOptional, HttpCustomAttributeFunction, HttpInstrumentationConfig, HttpRequestArgs, HttpRequestCustomAttributeFunction, HttpResponseCustomAttributeFunction, Https, IgnoreIncomingRequestFunction, IgnoreMatcher, IgnoreOutgoingRequestFunction, ParsedRequestOptions, RequestFunction, RequestSignature, StartIncomingSpanCustomAttributeFunction, StartOutgoingSpanCustomAttributeFunction, } from './types';
export { extractHostnameAndPort, getAbsoluteUrl, getIncomingRequestAttributes, getIncomingRequestAttributesOnResponse, getIncomingRequestMetricAttributes, getIncomingRequestMetricAttributesOnResponse, getOutgoingRequestAttributes, getOutgoingRequestAttributesOnResponse, getOutgoingRequestMetricAttributes, getOutgoingRequestMetricAttributesOnResponse, getRequestInfo, headerCapture, isCompressed, isIgnored, isValidOptionsType, parseResponseStatus, satisfiesPattern, setAttributesFromHttpKind, setRequestContentLengthAttribute, setResponseContentLengthAttribute, setSpanWithError, } from './utils';
//# sourceMappingURL=index.d.ts.map

@@ -17,16 +17,28 @@ "use strict";

*/
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" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./http"), exports);
__exportStar(require("./types"), exports);
__exportStar(require("./utils"), exports);
exports.setSpanWithError = exports.setResponseContentLengthAttribute = exports.setRequestContentLengthAttribute = exports.setAttributesFromHttpKind = exports.satisfiesPattern = exports.parseResponseStatus = exports.isValidOptionsType = exports.isIgnored = exports.isCompressed = exports.headerCapture = exports.getRequestInfo = exports.getOutgoingRequestMetricAttributesOnResponse = exports.getOutgoingRequestMetricAttributes = exports.getOutgoingRequestAttributesOnResponse = exports.getOutgoingRequestAttributes = exports.getIncomingRequestMetricAttributesOnResponse = exports.getIncomingRequestMetricAttributes = exports.getIncomingRequestAttributesOnResponse = exports.getIncomingRequestAttributes = exports.getAbsoluteUrl = exports.extractHostnameAndPort = exports.HttpInstrumentation = void 0;
var http_1 = require("./http");
Object.defineProperty(exports, "HttpInstrumentation", { enumerable: true, get: function () { return http_1.HttpInstrumentation; } });
var utils_1 = require("./utils");
Object.defineProperty(exports, "extractHostnameAndPort", { enumerable: true, get: function () { return utils_1.extractHostnameAndPort; } });
Object.defineProperty(exports, "getAbsoluteUrl", { enumerable: true, get: function () { return utils_1.getAbsoluteUrl; } });
Object.defineProperty(exports, "getIncomingRequestAttributes", { enumerable: true, get: function () { return utils_1.getIncomingRequestAttributes; } });
Object.defineProperty(exports, "getIncomingRequestAttributesOnResponse", { enumerable: true, get: function () { return utils_1.getIncomingRequestAttributesOnResponse; } });
Object.defineProperty(exports, "getIncomingRequestMetricAttributes", { enumerable: true, get: function () { return utils_1.getIncomingRequestMetricAttributes; } });
Object.defineProperty(exports, "getIncomingRequestMetricAttributesOnResponse", { enumerable: true, get: function () { return utils_1.getIncomingRequestMetricAttributesOnResponse; } });
Object.defineProperty(exports, "getOutgoingRequestAttributes", { enumerable: true, get: function () { return utils_1.getOutgoingRequestAttributes; } });
Object.defineProperty(exports, "getOutgoingRequestAttributesOnResponse", { enumerable: true, get: function () { return utils_1.getOutgoingRequestAttributesOnResponse; } });
Object.defineProperty(exports, "getOutgoingRequestMetricAttributes", { enumerable: true, get: function () { return utils_1.getOutgoingRequestMetricAttributes; } });
Object.defineProperty(exports, "getOutgoingRequestMetricAttributesOnResponse", { enumerable: true, get: function () { return utils_1.getOutgoingRequestMetricAttributesOnResponse; } });
Object.defineProperty(exports, "getRequestInfo", { enumerable: true, get: function () { return utils_1.getRequestInfo; } });
Object.defineProperty(exports, "headerCapture", { enumerable: true, get: function () { return utils_1.headerCapture; } });
Object.defineProperty(exports, "isCompressed", { enumerable: true, get: function () { return utils_1.isCompressed; } });
Object.defineProperty(exports, "isIgnored", { enumerable: true, get: function () { return utils_1.isIgnored; } });
Object.defineProperty(exports, "isValidOptionsType", { enumerable: true, get: function () { return utils_1.isValidOptionsType; } });
Object.defineProperty(exports, "parseResponseStatus", { enumerable: true, get: function () { return utils_1.parseResponseStatus; } });
Object.defineProperty(exports, "satisfiesPattern", { enumerable: true, get: function () { return utils_1.satisfiesPattern; } });
Object.defineProperty(exports, "setAttributesFromHttpKind", { enumerable: true, get: function () { return utils_1.setAttributesFromHttpKind; } });
Object.defineProperty(exports, "setRequestContentLengthAttribute", { enumerable: true, get: function () { return utils_1.setRequestContentLengthAttribute; } });
Object.defineProperty(exports, "setResponseContentLengthAttribute", { enumerable: true, get: function () { return utils_1.setResponseContentLengthAttribute; } });
Object.defineProperty(exports, "setSpanWithError", { enumerable: true, get: function () { return utils_1.setSpanWithError; } });
//# sourceMappingURL=index.js.map

@@ -58,2 +58,6 @@ /// <reference types="node" />

ignoreOutgoingRequestHook?: IgnoreOutgoingRequestFunction;
/** If set to true, incoming requests will not be instrumented at all. */
disableIncomingRequestInstrumentation?: boolean;
/** If set to true, outgoing requests will not be instrumented at all. */
disableOutgoingRequestInstrumentation?: boolean;
/** Function for adding custom attributes after response is handled */

@@ -60,0 +64,0 @@ applyCustomAttributesOnSpan?: HttpCustomAttributeFunction;

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

export declare const VERSION = "0.52.1";
export declare const VERSION = "0.53.0";
//# sourceMappingURL=version.d.ts.map

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

// this is autogenerated file, see scripts/version-update.js
exports.VERSION = '0.52.1';
exports.VERSION = '0.53.0';
//# sourceMappingURL=version.js.map
{
"name": "@opentelemetry/instrumentation-http",
"version": "0.52.1",
"version": "0.53.0",
"description": "OpenTelemetry instrumentation for `node:http` and `node:https` http client and server modules",

@@ -12,3 +12,5 @@ "main": "build/src/index.js",

"clean": "tsc --build --clean",
"test": "nyc ts-mocha -p tsconfig.json test/**/*.test.ts",
"test:cjs": "nyc mocha test/**/*.test.ts",
"test:esm": "nyc node --experimental-loader=@opentelemetry/instrumentation/hook.mjs ../../../node_modules/mocha/bin/mocha 'test/**/*.test.mjs'",
"test": "npm run test:cjs && npm run test:esm",
"tdd": "npm run test -- --watch-extensions ts --watch",

@@ -52,7 +54,7 @@ "lint": "eslint . --ext .ts",

"@opentelemetry/api": "1.9.0",
"@opentelemetry/context-async-hooks": "1.25.1",
"@opentelemetry/sdk-metrics": "1.25.1",
"@opentelemetry/sdk-trace-base": "1.25.1",
"@opentelemetry/sdk-trace-node": "1.25.1",
"@types/mocha": "10.0.6",
"@opentelemetry/context-async-hooks": "1.26.0",
"@opentelemetry/sdk-metrics": "1.26.0",
"@opentelemetry/sdk-trace-base": "1.26.0",
"@opentelemetry/sdk-trace-node": "1.26.0",
"@types/mocha": "10.0.7",
"@types/node": "18.6.5",

@@ -62,3 +64,3 @@ "@types/request-promise-native": "1.0.21",

"@types/sinon": "17.0.3",
"@types/superagent": "8.1.7",
"@types/superagent": "8.1.8",
"axios": "1.6.0",

@@ -68,3 +70,3 @@ "codecov": "3.8.3",

"lerna": "6.6.2",
"mocha": "10.2.0",
"mocha": "10.7.3",
"nock": "13.3.8",

@@ -75,4 +77,3 @@ "nyc": "15.1.0",

"sinon": "15.1.2",
"superagent": "9.0.2",
"ts-mocha": "10.0.0",
"superagent": "10.0.2",
"typescript": "4.4.4"

@@ -84,5 +85,5 @@ },

"dependencies": {
"@opentelemetry/core": "1.25.1",
"@opentelemetry/instrumentation": "0.52.1",
"@opentelemetry/semantic-conventions": "1.25.1",
"@opentelemetry/core": "1.26.0",
"@opentelemetry/instrumentation": "0.53.0",
"@opentelemetry/semantic-conventions": "1.27.0",
"semver": "^7.5.2"

@@ -92,3 +93,3 @@ },

"sideEffects": false,
"gitHead": "0608f405573901e54db01e44c533009cf28be262"
"gitHead": "720bc8c70d47029cb6b41a34ffdc3d25cbaa2f80"
}

@@ -64,2 +64,4 @@ # OpenTelemetry HTTP and HTTPS Instrumentation for Node.js

| `ignoreOutgoingRequestHook` | `IgnoreOutgoingRequestFunction` | Http instrumentation will not trace all outgoing requests that matched with custom function |
| `disableOutgoingRequestInstrumentation` | `boolean` | Set to true to avoid instrumenting outgoing requests at all. This can be helpful when another instrumentation handles outgoing requests. |
| `disableIncomingRequestInstrumentation` | `boolean` | Set to true to avoid instrumenting incoming requests at all. This can be helpful when another instrumentation handles incoming requests. |
| [`serverName`](https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/opentelemetry-instrumentation-http/src/types.ts#L101) | `string` | The primary server name of the matched virtual host. |

@@ -66,0 +68,0 @@ | [`requireParentforOutgoingSpans`](https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/opentelemetry-instrumentation-http/src/types.ts#L103) | Boolean | Require that is a parent span to create new span for outgoing requests. |

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc