Skip to content

Commit

Permalink
feat: expand restify supported version range to include v5, v6 (googl…
Browse files Browse the repository at this point in the history
  • Loading branch information
kjin authored Oct 18, 2017
1 parent 1854797 commit cf3ada0
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ The trace agent can do automatic tracing of the following web frameworks:
* [gRPC](https://www.npmjs.com/package/grpc)* server (version 1)
* [hapi](https://www.npmjs.com/package/hapi) (versions 8 - 16)
* [koa](https://www.npmjs.com/package/koa) (version 1)
* [restify](https://www.npmjs.com/package/restify) (versions 3 - 4)
* [restify](https://www.npmjs.com/package/restify) (versions 3 - 6)

The agent will also automatic trace of the following kinds of RPCs:
* Outbound HTTP requests through the `http` and `https` core modules
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/plugin-restify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

var shimmer = require('shimmer');

var SUPPORTED_VERSIONS = '<=4.x';
var SUPPORTED_VERSIONS = '<=6.x';

function unpatchRestify(restify) {
shimmer.unwrap(restify, 'createServer');
Expand Down
1 change: 1 addition & 0 deletions test/plugins/fixtures/restify5/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('restify');
8 changes: 8 additions & 0 deletions test/plugins/fixtures/restify5/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "restify5",
"version": "1.0.0",
"main": "index.js",
"dependencies": {
"restify": "^5.2.0"
}
}
1 change: 1 addition & 0 deletions test/plugins/fixtures/restify6/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('restify');
8 changes: 8 additions & 0 deletions test/plugins/fixtures/restify6/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "restify6",
"version": "1.0.0",
"main": "index.js",
"dependencies": {
"restify": "^6.0.1"
}
}
4 changes: 3 additions & 1 deletion test/plugins/test-trace-restify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ var assert = require('assert');
var common = require('./common'/*.js*/);
var semver = require('semver');
var versions: any = {
restify4: './fixtures/restify4'
restify4: './fixtures/restify4',
restify5: './fixtures/restify5',
restify6: './fixtures/restify6'
};
if (semver.satisfies(process.version, '<7')) {
versions.restify3 = './fixtures/restify3';
Expand Down

0 comments on commit cf3ada0

Please sign in to comment.