Skip to content

Commit

Permalink
chore: experimental 0.51.0, remove instrumentations generic type to a…
Browse files Browse the repository at this point in the history
…lign with upstream (#2091)

* chore: remove instrumentations generic type to align with upstream

* fix: lint

* chore: update core to 0.51.0

* revert: redundant any type

* fix: merged issue

* fix: apply original types from generics

* revert: cucumber testing

* fix: tedious import types

---------

Co-authored-by: Trent Mick <trentm@gmail.com>
  • Loading branch information
blumamir and trentm committed Apr 25, 2024
1 parent 46b6775 commit 80cbee7
Show file tree
Hide file tree
Showing 83 changed files with 717 additions and 746 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"devDependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/contrib-test-utils": "^0.38.0",
"@opentelemetry/sdk-node": "^0.50.0",
"@opentelemetry/sdk-node": "^0.51.0",
"@types/mocha": "8.2.3",
"@types/node": "18.6.5",
"@types/semver": "7.5.3",
Expand Down
8 changes: 4 additions & 4 deletions metapackages/auto-instrumentations-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"typescript": "4.4.4"
},
"dependencies": {
"@opentelemetry/instrumentation": "^0.50.0",
"@opentelemetry/instrumentation": "^0.51.0",
"@opentelemetry/instrumentation-amqplib": "^0.36.0",
"@opentelemetry/instrumentation-aws-lambda": "^0.40.0",
"@opentelemetry/instrumentation-aws-sdk": "^0.40.0",
Expand All @@ -64,9 +64,9 @@
"@opentelemetry/instrumentation-fs": "^0.11.0",
"@opentelemetry/instrumentation-generic-pool": "^0.35.0",
"@opentelemetry/instrumentation-graphql": "^0.39.0",
"@opentelemetry/instrumentation-grpc": "^0.50.0",
"@opentelemetry/instrumentation-grpc": "^0.51.0",
"@opentelemetry/instrumentation-hapi": "^0.36.0",
"@opentelemetry/instrumentation-http": "^0.50.0",
"@opentelemetry/instrumentation-http": "^0.51.0",
"@opentelemetry/instrumentation-ioredis": "^0.39.0",
"@opentelemetry/instrumentation-knex": "^0.35.0",
"@opentelemetry/instrumentation-koa": "^0.39.0",
Expand All @@ -92,7 +92,7 @@
"@opentelemetry/resource-detector-container": "^0.3.8",
"@opentelemetry/resource-detector-gcp": "^0.29.8",
"@opentelemetry/resources": "^1.12.0",
"@opentelemetry/sdk-node": "^0.50.0"
"@opentelemetry/sdk-node": "^0.51.0"
},
"files": [
"build/src/**/*.js",
Expand Down
6 changes: 3 additions & 3 deletions metapackages/auto-instrumentations-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@
"webpack-merge": "5.8.0"
},
"dependencies": {
"@opentelemetry/instrumentation": "^0.50.0",
"@opentelemetry/instrumentation": "^0.51.0",
"@opentelemetry/instrumentation-document-load": "^0.37.0",
"@opentelemetry/instrumentation-fetch": "^0.50.0",
"@opentelemetry/instrumentation-fetch": "^0.51.0",
"@opentelemetry/instrumentation-user-interaction": "^0.37.0",
"@opentelemetry/instrumentation-xml-http-request": "^0.50.0"
"@opentelemetry/instrumentation-xml-http-request": "^0.51.0"
},
"files": [
"build/src/**/*.js",
Expand Down
930 changes: 465 additions & 465 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/opentelemetry-test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
"dependencies": {
"@opentelemetry/core": "^1.0.0",
"@opentelemetry/exporter-jaeger": "^1.3.1",
"@opentelemetry/instrumentation": "^0.50.0",
"@opentelemetry/instrumentation": "^0.51.0",
"@opentelemetry/resources": "^1.8.0",
"@opentelemetry/sdk-node": "^0.50.0",
"@opentelemetry/sdk-node": "^0.51.0",
"@opentelemetry/sdk-trace-base": "^1.8.0",
"@opentelemetry/sdk-trace-node": "^1.8.0",
"@opentelemetry/semantic-conventions": "^1.22.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/winston-transport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"typescript": "4.4.4"
},
"dependencies": {
"@opentelemetry/api-logs": "^0.50.0",
"@opentelemetry/api-logs": "^0.51.0",
"winston-transport": "4.*"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/winston-transport#readme"
Expand Down
2 changes: 1 addition & 1 deletion plugins/node/instrumentation-amqplib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
},
"dependencies": {
"@opentelemetry/core": "^1.8.0",
"@opentelemetry/instrumentation": "^0.50.0",
"@opentelemetry/instrumentation": "^0.51.0",
"@opentelemetry/semantic-conventions": "^1.22.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion plugins/node/instrumentation-cucumber/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"typescript": "4.4.4"
},
"dependencies": {
"@opentelemetry/instrumentation": "^0.50.0",
"@opentelemetry/instrumentation": "^0.51.0",
"@opentelemetry/semantic-conventions": "^1.0.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/instrumentation-cucumber#readme"
Expand Down
12 changes: 5 additions & 7 deletions plugins/node/instrumentation-cucumber/src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ export class CucumberInstrumentation extends InstrumentationBase {
super('@opentelemetry/instrumentation-cucumber', VERSION, config);
}

init(): InstrumentationNodeModuleDefinition<any>[] {
init(): InstrumentationNodeModuleDefinition[] {
return [
new InstrumentationNodeModuleDefinition<Cucumber>(
new InstrumentationNodeModuleDefinition(
'@cucumber/cucumber',
['^8.0.0', '^9.0.0', '^10.0.0'],
(moduleExports, moduleVersion) => {
(moduleExports: Cucumber, moduleVersion) => {
this._diag.debug(
`Applying patch for @cucumber/cucumber@${moduleVersion}`
);
Expand All @@ -72,7 +72,7 @@ export class CucumberInstrumentation extends InstrumentationBase {
});
return moduleExports;
},
(moduleExports, moduleVersion) => {
(moduleExports: Cucumber, moduleVersion) => {
if (moduleExports === undefined) return;
this._diag.debug(
`Removing patch for @cucumber/cucumber@${moduleVersion}`
Expand All @@ -82,9 +82,7 @@ export class CucumberInstrumentation extends InstrumentationBase {
});
},
[
new InstrumentationNodeModuleFile<{
default: { new (): TestCaseRunner; prototype: TestCaseRunner };
}>(
new InstrumentationNodeModuleFile(
'@cucumber/cucumber/lib/runtime/test_case_runner.js',
['^8.0.0', '^9.0.0', '^10.0.0'],
(moduleExports, moduleVersion) => {
Expand Down
2 changes: 1 addition & 1 deletion plugins/node/instrumentation-dataloader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"typescript": "4.4.4"
},
"dependencies": {
"@opentelemetry/instrumentation": "^0.50.0"
"@opentelemetry/instrumentation": "^0.51.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/instrumentation-dataloader#readme"
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class DataloaderInstrumentation extends InstrumentationBase {

protected init() {
return [
new InstrumentationNodeModuleDefinition<typeof Dataloader>(
new InstrumentationNodeModuleDefinition(
MODULE_NAME,
['^2.0.0'],
(dataloader, moduleVersion) => {
Expand All @@ -73,8 +73,7 @@ export class DataloaderInstrumentation extends InstrumentationBase {
this._unwrap(dataloader.prototype, 'loadMany');
}
}
// cast it to module definition of unknown type to avoid exposing Dataloader types on public APIs
) as InstrumentationNodeModuleDefinition<unknown>,
) as InstrumentationNodeModuleDefinition,
];
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/node/instrumentation-fs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
},
"dependencies": {
"@opentelemetry/core": "^1.8.0",
"@opentelemetry/instrumentation": "^0.50.0"
"@opentelemetry/instrumentation": "^0.51.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/instrumentation-fs#readme"
}
10 changes: 5 additions & 5 deletions plugins/node/instrumentation-fs/src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ function patchedFunctionWithOriginalProperties<
return Object.assign(patchedFunction, original);
}

export default class FsInstrumentation extends InstrumentationBase<FS> {
export default class FsInstrumentation extends InstrumentationBase {
constructor(config?: FsInstrumentationConfig) {
super('@opentelemetry/instrumentation-fs', VERSION, config);
}

init(): (
| InstrumentationNodeModuleDefinition<FS>
| InstrumentationNodeModuleDefinition<FSPromises>
| InstrumentationNodeModuleDefinition
| InstrumentationNodeModuleDefinition
)[] {
return [
new InstrumentationNodeModuleDefinition<FS>(
new InstrumentationNodeModuleDefinition(
'fs',
['*'],
(fs: FS) => {
Expand Down Expand Up @@ -133,7 +133,7 @@ export default class FsInstrumentation extends InstrumentationBase<FS> {
}
}
),
new InstrumentationNodeModuleDefinition<FSPromises>(
new InstrumentationNodeModuleDefinition(
'fs/promises',
['*'],
(fsPromises: FSPromises) => {
Expand Down
2 changes: 1 addition & 1 deletion plugins/node/instrumentation-lru-memoizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"typescript": "4.4.4"
},
"dependencies": {
"@opentelemetry/instrumentation": "^0.50.0"
"@opentelemetry/instrumentation": "^0.51.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/instrumentation-lru-memoizer#readme"
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export default class LruMemoizerInstrumentation extends InstrumentationBase {
super('@opentelemetry/instrumentation-lru-memoizer', VERSION, config);
}

init(): InstrumentationNodeModuleDefinition<any>[] {
init(): InstrumentationNodeModuleDefinition[] {
return [
new InstrumentationNodeModuleDefinition<any>(
new InstrumentationNodeModuleDefinition(
'lru-memoizer',
['>=1.3 <3'],
moduleExports => {
Expand Down
2 changes: 1 addition & 1 deletion plugins/node/instrumentation-mongoose/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
},
"dependencies": {
"@opentelemetry/core": "^1.8.0",
"@opentelemetry/instrumentation": "^0.50.0",
"@opentelemetry/instrumentation": "^0.51.0",
"@opentelemetry/semantic-conventions": "^1.22.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/instrumentation-mongoose#readme"
Expand Down
6 changes: 3 additions & 3 deletions plugins/node/instrumentation-mongoose/src/mongoose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const contextCaptureFunctions = [
// calls. this bypass the unlinked spans issue on thenables await operations.
export const _STORED_PARENT_SPAN: unique symbol = Symbol('stored-parent-span');

export class MongooseInstrumentation extends InstrumentationBase<any> {
export class MongooseInstrumentation extends InstrumentationBase {
protected override _config!: MongooseInstrumentationConfig;

constructor(config: MongooseInstrumentationConfig = {}) {
Expand All @@ -72,8 +72,8 @@ export class MongooseInstrumentation extends InstrumentationBase<any> {
this._config = Object.assign({}, config);
}

protected init(): InstrumentationModuleDefinition<any> {
const module = new InstrumentationNodeModuleDefinition<any>(
protected init(): InstrumentationModuleDefinition {
const module = new InstrumentationNodeModuleDefinition(
'mongoose',
['>=5.9.7 <7'],
this.patch.bind(this),
Expand Down
2 changes: 1 addition & 1 deletion plugins/node/instrumentation-runtime-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"access": "public"
},
"dependencies": {
"@opentelemetry/instrumentation": "^0.50.0"
"@opentelemetry/instrumentation": "^0.51.0"
},
"devDependencies": {
"@opentelemetry/api": "^1.3.0",
Expand Down
2 changes: 1 addition & 1 deletion plugins/node/instrumentation-socket.io/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"typescript": "4.4.4"
},
"dependencies": {
"@opentelemetry/instrumentation": "^0.50.0",
"@opentelemetry/instrumentation": "^0.51.0",
"@opentelemetry/semantic-conventions": "^1.0.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/instrumentation-socket.io#readme"
Expand Down

0 comments on commit 80cbee7

Please sign in to comment.