Skip to content

Commit

Permalink
feat: support restify@7 (#917)
Browse files Browse the repository at this point in the history
  • Loading branch information
kjin authored Nov 13, 2018
1 parent c66e9c3 commit 4b74f5a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The trace agent can do automatic tracing of the following web frameworks:
* [gRPC](https://www.npmjs.com/package/grpc) server (version ^1.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 - 6)
* [restify](https://www.npmjs.com/package/restify) (versions 3 - 7)

The agent will also automatically trace RPCs from the following modules:
* Outbound HTTP requests through `http`, `https`, and `http2` 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 @@ -28,7 +28,7 @@ type Response = restify_5.Response;
type Next = restify_5.Next;
type CreateServerFn = (options?: restify_5.ServerOptions) => restify_5.Server;

const SUPPORTED_VERSIONS = '<=6.x';
const SUPPORTED_VERSIONS = '<=7.x';

function unpatchRestify(restify: Restify5) {
shimmer.unwrap(restify, 'createServer');
Expand Down
5 changes: 5 additions & 0 deletions test/fixtures/plugin-fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,10 @@
"dependencies": {
"restify": "^6.0.1"
}
},
"restify7": {
"dependencies": {
"restify": "^7.2.2"
}
}
}
4 changes: 2 additions & 2 deletions test/test-trace-web-frameworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {Hapi17} from './web-frameworks/hapi17';
import {Hapi12, Hapi15, Hapi16, Hapi8} from './web-frameworks/hapi8_16';
import {Koa1} from './web-frameworks/koa1';
import {Koa2} from './web-frameworks/koa2';
import {Restify3, Restify4, Restify5, Restify6} from './web-frameworks/restify';
import {Restify3, Restify4, Restify5, Restify6, Restify7} from './web-frameworks/restify';

// The type of a stack trace object after being parsed from a trace span's stack
// frame label.
Expand All @@ -46,7 +46,7 @@ const ABORTED_SPAN_RETRIES = 3;
// The list of web frameworks to test.
const FRAMEWORKS: WebFrameworkConstructor[] = [
Connect3, Express4, Hapi8, Hapi12, Hapi15, Hapi16, Hapi17, Koa1, Koa2,
Restify3, Restify4, Restify5, Restify6
Restify3, Restify4, Restify5, Restify6, Restify7
];

/**
Expand Down
1 change: 1 addition & 0 deletions test/web-frameworks/restify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,5 @@ export const Restify3 = makeRestifyClass(3, '<7');
export const Restify4 = makeRestifyClass(4);
export const Restify5 = makeRestifyClass(5);
export const Restify6 = makeRestifyClass(6);
export const Restify7 = makeRestifyClass(7);
// tslint:enable:variable-name

0 comments on commit 4b74f5a

Please sign in to comment.