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

chore: experimental 0.51.0, remove instrumentations generic type to align with upstream #2091

Merged
Merged
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
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>,
Comment on lines -76 to -77
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this comment is here, I think it's not safe to type the moduleExports with the now-removed generic type, which does not give a lot of value IMO.

) 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
Loading
Loading