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

fix(grpc): use correct supportedVersions #487

Merged
Show file tree
Hide file tree
Changes from 4 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
6 changes: 3 additions & 3 deletions packages/opentelemetry-plugin-grpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@
"access": "public"
},
"devDependencies": {
"@opentelemetry/node": "^0.2.0",
"@opentelemetry/tracing": "^0.2.0",
"@types/mocha": "^5.2.7",
"@types/node": "^12.6.9",
"@types/shimmer": "^1.0.1",
"@types/sinon": "^7.0.13",
"codecov": "^3.5.0",
"grpc": "~1.23.3",
"grpc": "^1.23.3",
"gts": "^1.1.0",
"mocha": "^6.2.0",
"node-pre-gyp": "^0.12.0",
Expand All @@ -59,8 +61,6 @@
},
"dependencies": {
"@opentelemetry/core": "^0.2.0",
"@opentelemetry/node": "^0.2.0",
"@opentelemetry/tracing": "^0.2.0",
"@opentelemetry/types": "^0.2.0",
"shimmer": "^1.2.1"
}
Expand Down
18 changes: 7 additions & 11 deletions packages/opentelemetry-plugin-grpc/src/grpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ let grpcClientModule: GrpcInternalClientTypes;

export class GrpcPlugin extends BasePlugin<grpc> {
static readonly component = 'grpc';
readonly supportedVersions = ['^1.23.3'];
readonly supportedVersions = ['1.*'];

protected _config!: GrpcPluginOptions;

Expand Down Expand Up @@ -83,13 +83,11 @@ export class GrpcPlugin extends BasePlugin<grpc> {
}

// Wrap the externally exported client constructor
if (this._moduleExports.makeGenericClientConstructor) {
shimmer.wrap(
this._moduleExports,
'makeGenericClientConstructor',
this._patchClient()
);
}
shimmer.wrap(
this._moduleExports,
'makeGenericClientConstructor',
this._patchClient()
);

if (this._internalFilesExports['client']) {
grpcClientModule = this._internalFilesExports[
Expand Down Expand Up @@ -117,9 +115,7 @@ export class GrpcPlugin extends BasePlugin<grpc> {
shimmer.unwrap(this._moduleExports.Server.prototype, 'register');
}

if (this._moduleExports.makeGenericClientConstructor) {
shimmer.unwrap(this._moduleExports, 'makeGenericClientConstructor');
}
shimmer.unwrap(this._moduleExports, 'makeGenericClientConstructor');

if (grpcClientModule) {
shimmer.unwrap(grpcClientModule, 'makeClientConstructor');
Expand Down