@opentelemetry/instrumentation-express
Advanced tools
Comparing version 0.16.0 to 0.20.0
@@ -1,3 +0,4 @@ | ||
export * from './express'; | ||
export { ExpressInstrumentationConfig, ExpressLayerType } from './types'; | ||
export * from './instrumentation'; | ||
export { ExpressLayerType } from './enums/ExpressLayerType'; | ||
export { ExpressInstrumentationConfig } from './types'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -29,5 +29,5 @@ "use strict"; | ||
exports.ExpressLayerType = void 0; | ||
__exportStar(require("./express"), exports); | ||
var types_1 = require("./types"); | ||
Object.defineProperty(exports, "ExpressLayerType", { enumerable: true, get: function () { return types_1.ExpressLayerType; } }); | ||
__exportStar(require("./instrumentation"), exports); | ||
var ExpressLayerType_1 = require("./enums/ExpressLayerType"); | ||
Object.defineProperty(exports, "ExpressLayerType", { enumerable: true, get: function () { return ExpressLayerType_1.ExpressLayerType; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -1,5 +0,6 @@ | ||
import { kLayerPatched } from './express'; | ||
import { kLayerPatched } from './'; | ||
import { Request } from 'express'; | ||
import { SpanAttributes, Span } from '@opentelemetry/api'; | ||
import { SpanAttributes } from '@opentelemetry/api'; | ||
import { InstrumentationConfig } from '@opentelemetry/instrumentation'; | ||
import { ExpressLayerType } from './enums/ExpressLayerType'; | ||
/** | ||
@@ -50,11 +51,2 @@ * This const define where on the `request` object the Instrumentation will mount the | ||
}; | ||
export declare enum CustomAttributeNames { | ||
EXPRESS_TYPE = "express.type", | ||
EXPRESS_NAME = "express.name" | ||
} | ||
export declare enum ExpressLayerType { | ||
ROUTER = "router", | ||
MIDDLEWARE = "middleware", | ||
REQUEST_HANDLER = "request_handler" | ||
} | ||
export declare type IgnoreMatcher = string | RegExp | ((name: string) => boolean); | ||
@@ -70,8 +62,2 @@ /** | ||
} | ||
/** | ||
* extends opentelemetry/api Span object to instrument the root span name of http instrumentation | ||
*/ | ||
export interface ExpressInstrumentationSpan extends Span { | ||
name?: string; | ||
} | ||
//# sourceMappingURL=types.d.ts.map |
@@ -18,4 +18,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ExpressLayerType = exports.CustomAttributeNames = exports._LAYERS_STORE_PROPERTY = void 0; | ||
const express_1 = require("./express"); | ||
exports._LAYERS_STORE_PROPERTY = void 0; | ||
const _1 = require("./"); | ||
/** | ||
@@ -38,13 +38,2 @@ * This const define where on the `request` object the Instrumentation will mount the | ||
exports._LAYERS_STORE_PROPERTY = '__ot_middlewares'; | ||
var CustomAttributeNames; | ||
(function (CustomAttributeNames) { | ||
CustomAttributeNames["EXPRESS_TYPE"] = "express.type"; | ||
CustomAttributeNames["EXPRESS_NAME"] = "express.name"; | ||
})(CustomAttributeNames = exports.CustomAttributeNames || (exports.CustomAttributeNames = {})); | ||
var ExpressLayerType; | ||
(function (ExpressLayerType) { | ||
ExpressLayerType["ROUTER"] = "router"; | ||
ExpressLayerType["MIDDLEWARE"] = "middleware"; | ||
ExpressLayerType["REQUEST_HANDLER"] = "request_handler"; | ||
})(ExpressLayerType = exports.ExpressLayerType || (exports.ExpressLayerType = {})); | ||
//# sourceMappingURL=types.js.map |
import { SpanAttributes } from '@opentelemetry/api'; | ||
import { ExpressLayer, PatchedRequest, ExpressLayerType, ExpressInstrumentationConfig } from './types'; | ||
import { ExpressLayer, PatchedRequest, ExpressInstrumentationConfig } from './types'; | ||
import { ExpressLayerType } from './enums/ExpressLayerType'; | ||
/** | ||
@@ -4,0 +5,0 @@ * Store layers path in the request to be able to construct route later |
@@ -20,2 +20,4 @@ "use strict"; | ||
const types_1 = require("./types"); | ||
const ExpressLayerType_1 = require("./enums/ExpressLayerType"); | ||
const AttributeNames_1 = require("./enums/AttributeNames"); | ||
/** | ||
@@ -47,4 +49,4 @@ * Store layers path in the request to be able to construct route later | ||
attributes: { | ||
[types_1.CustomAttributeNames.EXPRESS_NAME]: layerPath, | ||
[types_1.CustomAttributeNames.EXPRESS_TYPE]: types_1.ExpressLayerType.ROUTER, | ||
[AttributeNames_1.AttributeNames.EXPRESS_NAME]: layerPath, | ||
[AttributeNames_1.AttributeNames.EXPRESS_TYPE]: ExpressLayerType_1.ExpressLayerType.ROUTER, | ||
}, | ||
@@ -57,4 +59,4 @@ name: `router - ${layerPath}`, | ||
attributes: { | ||
[types_1.CustomAttributeNames.EXPRESS_NAME]: layerPath !== null && layerPath !== void 0 ? layerPath : 'request handler', | ||
[types_1.CustomAttributeNames.EXPRESS_TYPE]: types_1.ExpressLayerType.REQUEST_HANDLER, | ||
[AttributeNames_1.AttributeNames.EXPRESS_NAME]: layerPath !== null && layerPath !== void 0 ? layerPath : 'request handler', | ||
[AttributeNames_1.AttributeNames.EXPRESS_TYPE]: ExpressLayerType_1.ExpressLayerType.REQUEST_HANDLER, | ||
}, | ||
@@ -67,4 +69,4 @@ name: `request handler${layer.path ? ` - ${layerPath}` : ''}`, | ||
attributes: { | ||
[types_1.CustomAttributeNames.EXPRESS_NAME]: layer.name, | ||
[types_1.CustomAttributeNames.EXPRESS_TYPE]: types_1.ExpressLayerType.MIDDLEWARE, | ||
[AttributeNames_1.AttributeNames.EXPRESS_NAME]: layer.name, | ||
[AttributeNames_1.AttributeNames.EXPRESS_TYPE]: ExpressLayerType_1.ExpressLayerType.MIDDLEWARE, | ||
}, | ||
@@ -106,3 +108,4 @@ name: `middleware - ${layer.name}`, | ||
var _a; | ||
if (Array.isArray(config === null || config === void 0 ? void 0 : config.ignoreLayersType) && ((_a = config === null || config === void 0 ? void 0 : config.ignoreLayersType) === null || _a === void 0 ? void 0 : _a.includes(type))) { | ||
if (Array.isArray(config === null || config === void 0 ? void 0 : config.ignoreLayersType) && | ||
((_a = config === null || config === void 0 ? void 0 : config.ignoreLayersType) === null || _a === void 0 ? void 0 : _a.includes(type))) { | ||
return true; | ||
@@ -109,0 +112,0 @@ } |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.16.0"; | ||
export declare const VERSION = "0.20.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '0.16.0'; | ||
exports.VERSION = '0.20.0'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@opentelemetry/instrumentation-express", | ||
"version": "0.16.0", | ||
"version": "0.20.0", | ||
"description": "OpenTelemetry express automatic instrumentation package.", | ||
@@ -45,9 +45,8 @@ "main": "build/src/index.js", | ||
"devDependencies": { | ||
"@opentelemetry/context-async-hooks": "0.19.0", | ||
"@opentelemetry/node": "0.19.0", | ||
"@opentelemetry/tracing": "0.19.0", | ||
"@types/express": "4.17.7", | ||
"@opentelemetry/context-async-hooks": "0.20.0", | ||
"@opentelemetry/node": "0.20.0", | ||
"@opentelemetry/tracing": "0.20.0", | ||
"@types/mocha": "7.0.2", | ||
"@types/node": "14.0.27", | ||
"codecov": "3.7.2", | ||
"@types/node": "14.17.2", | ||
"codecov": "3.8.2", | ||
"express": "4.17.1", | ||
@@ -59,13 +58,12 @@ "gts": "3.1.0", | ||
"ts-mocha": "8.0.0", | ||
"tslint-consistent-codestyle": "1.16.0", | ||
"tslint-microsoft-contrib": "6.2.0", | ||
"typescript": "4.1.3" | ||
"typescript": "4.3.2" | ||
}, | ||
"dependencies": { | ||
"@opentelemetry/api": "^1.0.0-rc.0", | ||
"@opentelemetry/core": "^0.19.0", | ||
"@opentelemetry/instrumentation": "^0.19.0", | ||
"@opentelemetry/semantic-conventions": "^0.19.0" | ||
"@opentelemetry/api": "^0.20.0", | ||
"@opentelemetry/core": "^0.20.0", | ||
"@opentelemetry/instrumentation": "^0.20.0", | ||
"@opentelemetry/semantic-conventions": "^0.20.0", | ||
"@types/express": "4.17.12" | ||
}, | ||
"gitHead": "5ecccc916e8f4eecaf6629a0350fc672edcba1be" | ||
"gitHead": "5d73dc2d11a8fd57b21a0c6286861cb992556ca1" | ||
} |
@@ -15,3 +15,3 @@ # OpenTelemetry Express Instrumentation for Node.js | ||
This instrumentation relies on HTTP calls to also be instrumented. Make sure you install and enable both. | ||
This instrumentation relies on HTTP calls to also be instrumented. Make sure you install and enable both, otherwise you will not see any spans being exported from the instrumentation. | ||
@@ -23,4 +23,5 @@ ```bash | ||
### Supported Versions | ||
- `^4.0.0` | ||
- `^4.0.0` | ||
## Usage | ||
@@ -47,3 +48,2 @@ | ||
], | ||
tracerProvider: provider, | ||
}); | ||
@@ -80,2 +80,3 @@ ``` | ||
## Useful links | ||
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/> | ||
@@ -82,0 +83,0 @@ - For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43527
13
17
590
95
5
1
+ Added@types/express@4.17.12
+ Added@opentelemetry/api@0.20.0(transitive)
+ Added@opentelemetry/api-metrics@0.20.0(transitive)
+ Added@opentelemetry/core@0.20.0(transitive)
+ Added@opentelemetry/instrumentation@0.20.0(transitive)
+ Added@opentelemetry/semantic-conventions@0.20.0(transitive)
+ Added@types/body-parser@1.19.5(transitive)
+ Added@types/connect@3.4.38(transitive)
+ Added@types/express@4.17.12(transitive)
+ Added@types/express-serve-static-core@4.19.6(transitive)
+ Added@types/http-errors@2.0.4(transitive)
+ Added@types/mime@1.3.5(transitive)
+ Added@types/node@22.9.0(transitive)
+ Added@types/qs@6.9.17(transitive)
+ Added@types/range-parser@1.2.7(transitive)
+ Added@types/send@0.17.4(transitive)
+ Added@types/serve-static@1.15.7(transitive)
+ Addedundici-types@6.19.8(transitive)
- Removed@opentelemetry/api@1.9.0(transitive)
- Removed@opentelemetry/api-metrics@0.19.0(transitive)
- Removed@opentelemetry/core@0.19.0(transitive)
- Removed@opentelemetry/instrumentation@0.19.0(transitive)
- Removed@opentelemetry/semantic-conventions@0.19.0(transitive)
Updated@opentelemetry/api@^0.20.0
Updated@opentelemetry/core@^0.20.0