Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(instrumentation-all): generate esm build files too #2673

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions plugins/node/instrumentation-amqplib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
"url": "https://github.com/open-telemetry/opentelemetry-js-contrib/issues"
},
"main": "build/src/index.js",
"module": "build/esm/index.js",
"types": "build/src/index.d.ts",
"files": [
"build/esm/**/*.js",
"build/esm/**/*.js.map",
"build/esm/**/*.d.ts",
"build/src/**/*.js",
"build/src/**/*.js.map",
"build/src/**/*.d.ts"
Expand All @@ -26,19 +30,19 @@
},
"repository": "open-telemetry/opentelemetry-js-contrib",
"scripts": {
"clean": "rimraf build/*",
"compile": "tsc -p .",
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
"compile": "tsc --build tsconfig.json tsconfig.esm.json",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"lint:readme": "node ../../../scripts/lint-readme.js",
"prewatch": "npm run precompile",
"prepublishOnly": "npm run compile",
"prewatch": "npm run precompile",
"tdd": "npm run test -- --watch-extensions ts --watch",
"test": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'",
"test:docker:run": "docker run -d --hostname demo-amqplib-rabbit --name amqplib-unittests -p 22221:5672 --env RABBITMQ_DEFAULT_USER=username --env RABBITMQ_DEFAULT_PASS=password rabbitmq:3",
"test-all-versions": "tav",
"version:update": "node ../../../scripts/version-update.js",
"watch": "tsc -w",
"test:docker:run": "docker run -d --hostname demo-amqplib-rabbit --name amqplib-unittests -p 22221:5672 --env RABBITMQ_DEFAULT_USER=username --env RABBITMQ_DEFAULT_PASS=password rabbitmq:3"
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json"
},
"peerDependencies": {
"@opentelemetry/api": "^1.3.0"
Expand Down
12 changes: 12 additions & 0 deletions plugins/node/instrumentation-amqplib/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../../../tsconfig.base.esm.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build/esm",
"tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo",
"downlevelIteration": true
},
"include": [
"src/**/*.ts"
]
}
17 changes: 11 additions & 6 deletions plugins/node/instrumentation-cucumber/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
"version": "0.13.0",
"description": "OpenTelemetry instrumentation for `@cucumber/cucumber` automated tests runner",
"main": "build/src/index.js",
"module": "build/esm/index.js",
"types": "build/src/index.d.ts",
"repository": "open-telemetry/opentelemetry-js-contrib",
"scripts": {
"test": "nyc mocha 'test/**/*.test.ts'",
"test-all-versions": "tav",
"tdd": "npm run test -- --watch-extensions ts --watch",
"clean": "rimraf build/*",
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
"compile": "tsc --build tsconfig.json tsconfig.esm.json",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"lint:readme": "node ../../../scripts/lint-readme.js",
"prewatch": "npm run precompile",
"prepublishOnly": "npm run compile",
"prewatch": "npm run precompile",
"tdd": "npm run test -- --watch-extensions ts --watch",
"test": "nyc mocha 'test/**/*.test.ts'",
"test-all-versions": "tav",
"version:update": "node ../../../scripts/version-update.js",
"compile": "tsc -p ."
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json"
},
"keywords": [
"cucumber",
Expand All @@ -32,6 +34,9 @@
"node": ">=14"
},
"files": [
"build/esm/**/*.js",
"build/esm/**/*.js.map",
"build/esm/**/*.d.ts",
"build/src/**/*.js",
"build/src/**/*.js.map",
"build/src/**/*.d.ts"
Expand Down
11 changes: 11 additions & 0 deletions plugins/node/instrumentation-cucumber/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../../../tsconfig.base.esm.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build/esm",
"tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo"
},
"include": [
"src/**/*.ts"
]
}
14 changes: 10 additions & 4 deletions plugins/node/instrumentation-dataloader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@
"version": "0.16.0",
"description": "OpenTelemetry instrumentation for `dataloader` data fetching layer",
"main": "build/src/index.js",
"module": "build/esm/index.js",
"types": "build/src/index.d.ts",
"repository": "open-telemetry/opentelemetry-js-contrib",
"scripts": {
"clean": "rimraf build/*",
"compile": "tsc -p .",
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
"compile": "tsc --build tsconfig.json tsconfig.esm.json",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"prewatch": "npm run precompile",
"lint:readme": "node ../../../scripts/lint-readme.js",
"prepublishOnly": "npm run compile",
"prewatch": "npm run precompile",
"tdd": "npm run test -- --watch-extensions ts --watch",
"test": "nyc mocha 'test/**/*.test.ts'",
"test-all-versions": "tav",
"version:update": "node ../../../scripts/version-update.js"
"version:update": "node ../../../scripts/version-update.js",
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json"
},
"keywords": [
"dataloader",
Expand All @@ -31,6 +34,9 @@
"node": ">=14"
},
"files": [
"build/esm/**/*.js",
"build/esm/**/*.js.map",
"build/esm/**/*.d.ts",
"build/src/**/*.js",
"build/src/**/*.js.map",
"build/src/**/*.d.ts"
Expand Down
11 changes: 11 additions & 0 deletions plugins/node/instrumentation-dataloader/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../../../tsconfig.base.esm.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build/esm",
"tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo"
},
"include": [
"src/**/*.ts"
]
}
15 changes: 10 additions & 5 deletions plugins/node/instrumentation-fs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
"version": "0.19.0",
"description": "OpenTelemetry instrumentation for `node:fs` file system interactions module",
"main": "build/src/index.js",
"module": "build/esm/index.js",
"types": "build/src/index.d.ts",
"repository": "open-telemetry/opentelemetry-js-contrib",
"scripts": {
"test": "mocha 'test/**/*.test.ts'",
"tdd": "npm run test -- --watch-extensions ts --watch",
"clean": "rimraf build/*",
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
"compile": "tsc --build tsconfig.json tsconfig.esm.json",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"lint:readme": "node ../../../scripts/lint-readme.js",
"prewatch": "npm run precompile",
"prepublishOnly": "npm run compile",
"prewatch": "npm run precompile",
"tdd": "npm run test -- --watch-extensions ts --watch",
"test": "nyc mocha 'test/**/*.test.ts'",
"version:update": "node ../../../scripts/version-update.js",
"compile": "tsc -p ."
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json"
},
"keywords": [
"fs",
Expand All @@ -31,6 +33,9 @@
"node": ">=14"
},
"files": [
"build/esm/**/*.js",
"build/esm/**/*.js.map",
"build/esm/**/*.d.ts",
"build/src/**/*.js",
"build/src/**/*.js.map",
"build/src/**/*.d.ts"
Expand Down
11 changes: 11 additions & 0 deletions plugins/node/instrumentation-fs/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../../../tsconfig.base.esm.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build/esm",
"tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo"
},
"include": [
"src/**/*.ts"
]
}
17 changes: 11 additions & 6 deletions plugins/node/instrumentation-kafkajs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
"version": "0.7.0",
"description": "OpenTelemetry instrumentation for `kafkajs` messaging client for Apache Kafka",
"main": "build/src/index.js",
"module": "build/esm/index.js",
"types": "build/src/index.d.ts",
"repository": "open-telemetry/opentelemetry-js-contrib",
"scripts": {
"test": "mocha --require @opentelemetry/contrib-test-utils 'test/**/*.test.ts'",
"tdd": "npm run test -- --watch-extensions ts --watch",
"clean": "rimraf build/*",
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
"compile": "tsc --build tsconfig.json tsconfig.esm.json",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"lint:readme": "node ../../../scripts/lint-readme",
"prewatch": "npm run precompile",
"lint:readme": "node ../../../scripts/lint-readme.js",
"prepublishOnly": "npm run compile",
"prewatch": "npm run precompile",
"tdd": "npm run test -- --watch-extensions ts --watch",
"test": "mocha --require @opentelemetry/contrib-test-utils 'test/**/*.test.ts'",
"version:update": "node ../../../scripts/version-update.js",
"compile": "tsc -p ."
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json"
},
"keywords": [
"kafkajs",
Expand All @@ -31,6 +33,9 @@
"node": ">=14"
},
"files": [
"build/esm/**/*.js",
"build/esm/**/*.js.map",
"build/esm/**/*.d.ts",
"build/src/**/*.js",
"build/src/**/*.js.map",
"build/src/**/*.d.ts"
Expand Down
11 changes: 11 additions & 0 deletions plugins/node/instrumentation-kafkajs/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../../../tsconfig.base.esm.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build/esm",
"tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo"
},
"include": [
"src/**/*.ts"
]
}
17 changes: 11 additions & 6 deletions plugins/node/instrumentation-lru-memoizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
"version": "0.44.0",
"description": "OpenTelemetry instrumentation for `lru-memoizer` function memoization using lru-cache",
"main": "build/src/index.js",
"module": "build/esm/index.js",
"types": "build/src/index.d.ts",
"repository": "open-telemetry/opentelemetry-js-contrib",
"scripts": {
"test": "mocha --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'",
"test-all-versions": "tav",
"tdd": "npm run test -- --watch-extensions ts --watch",
"clean": "rimraf build/*",
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
"compile": "tsc --build tsconfig.json tsconfig.esm.json",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"lint:readme": "node ../../../scripts/lint-readme.js",
"prewatch": "npm run precompile",
"prepublishOnly": "npm run compile",
"prewatch": "npm run precompile",
"tdd": "npm run test -- --watch-extensions ts --watch",
"test": "mocha --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'",
"test-all-versions": "tav",
"version:update": "node ../../../scripts/version-update.js",
"compile": "tsc -p ."
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json"
},
"keywords": [
"lru-memoizer",
Expand All @@ -31,6 +33,9 @@
"node": ">=14"
},
"files": [
"build/esm/**/*.js",
"build/esm/**/*.js.map",
"build/esm/**/*.d.ts",
"build/src/**/*.js",
"build/src/**/*.js.map",
"build/src/**/*.d.ts"
Expand Down
12 changes: 12 additions & 0 deletions plugins/node/instrumentation-lru-memoizer/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../../../tsconfig.base.esm.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build/esm",
"tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo",
"downlevelIteration": true
},
"include": [
"src/**/*.ts"
]
}
21 changes: 13 additions & 8 deletions plugins/node/instrumentation-mongoose/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,25 @@
"version": "0.46.0",
"description": "OpenTelemetry instrumentation for `mongoose` database object data modeling (ODM) library for MongoDB",
"main": "build/src/index.js",
"module": "build/esm/index.js",
"types": "build/src/index.d.ts",
"repository": "open-telemetry/opentelemetry-js-contrib",
"scripts": {
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
"compile": "tsc --build tsconfig.json tsconfig.esm.json",
"docker:start": "docker run -e MONGODB_DB=opentelemetry-tests -e MONGODB_PORT=27017 -e MONGODB_HOST=127.0.0.1 -p 27017:27017 --rm mongo",
"test": "npm run test-v5-v6",
"test-v5-v6": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/mongoose-common.test.ts' 'test/**/mongoose-v5-v6.test.ts'",
"test-v7-v8": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/mongoose-common.test.ts' 'test/**/mongoose-v7-v8.test.ts'",
"test-all-versions": "tav",
"tdd": "npm run test -- --watch-extensions ts --watch",
"clean": "rimraf build/*",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"lint:readme": "node ../../../scripts/lint-readme.js",
"prewatch": "npm run precompile",
"prepublishOnly": "npm run compile",
"prewatch": "npm run precompile",
"tdd": "npm run test -- --watch-extensions ts --watch",
"test": "npm run test-v5-v6",
"test-all-versions": "tav",
"test-v5-v6": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/mongoose-common.test.ts' 'test/**/mongoose-v5-v6.test.ts'",
"test-v7-v8": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/mongoose-common.test.ts' 'test/**/mongoose-v7-v8.test.ts'",
"version:update": "node ../../../scripts/version-update.js",
"compile": "tsc -p ."
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json"
},
"keywords": [
"mongodb",
Expand All @@ -36,6 +38,9 @@
"node": ">=14"
},
"files": [
"build/esm/**/*.js",
"build/esm/**/*.js.map",
"build/esm/**/*.d.ts",
"build/src/**/*.js",
"build/src/**/*.js.map",
"build/src/**/*.d.ts"
Expand Down
8 changes: 4 additions & 4 deletions plugins/node/instrumentation-mongoose/src/mongoose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,9 @@ export class MongooseInstrumentation extends InstrumentationBase<MongooseInstrum
return (original: Function) => {
return function captureSpanContext(this: any) {
const currentSpan = trace.getSpan(context.active());
const _args = arguments;
const aggregate = self._callOriginalFunction(() =>
original.apply(this, arguments)
original.apply(this, _args)
);
if (aggregate) aggregate[_STORED_PARENT_SPAN] = currentSpan;
return aggregate;
Expand All @@ -333,9 +334,8 @@ export class MongooseInstrumentation extends InstrumentationBase<MongooseInstrum
return (original: Function) => {
return function captureSpanContext(this: any) {
this[_STORED_PARENT_SPAN] = trace.getSpan(context.active());
return self._callOriginalFunction(() =>
original.apply(this, arguments)
);
const _args = arguments;
return self._callOriginalFunction(() => original.apply(this, _args));
};
};
}
Expand Down
11 changes: 11 additions & 0 deletions plugins/node/instrumentation-mongoose/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../../../tsconfig.base.esm.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build/esm",
"tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo"
},
"include": [
"src/**/*.ts"
]
}
4 changes: 2 additions & 2 deletions plugins/node/instrumentation-runtime-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions
[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[npm-url]: https://www.npmjs.com/package/@opentelemetry/instrumentation-pg
[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Finstrumentation-pg.svg
[npm-url]: https://www.npmjs.com/package/@opentelemetry/instrumentation-runtime-node
[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Finstrumentation-runtime-node.svg
Loading
Loading