Skip to content

Commit

Permalink
fix(grpc): use correct supportedVersions (#487)
Browse files Browse the repository at this point in the history
* fix(grpc): use correct supportedVersions

* chore: use more clear semver

* chore: use more clear semver

* fix: incorrect file changed
  • Loading branch information
Mark Wolff authored and mayurkale22 committed Nov 7, 2019
1 parent e1a2779 commit b00a2f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
6 changes: 3 additions & 3 deletions packages/opentelemetry-plugin-grpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,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 @@ -60,8 +62,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

0 comments on commit b00a2f3

Please sign in to comment.