Skip to content

Commit

Permalink
feat: support restify 8 (#1250)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored Apr 21, 2020
1 parent 69b4049 commit f52fa4d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .readme-partials.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ body: |-
* [gRPC](https://www.npmjs.com/package/grpc) server (version ^1.1)
* [hapi](https://www.npmjs.com/package/hapi) (versions 8 - 19)
* [koa](https://www.npmjs.com/package/koa) (version 1 - 2)
* [restify](https://www.npmjs.com/package/restify) (versions 3 - 7)
* [restify](https://www.npmjs.com/package/restify) (versions 3 - 8)
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,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 - 19)
* [koa](https://www.npmjs.com/package/koa) (version 1 - 2)
* [restify](https://www.npmjs.com/package/restify) (versions 3 - 7)
* [restify](https://www.npmjs.com/package/restify) (versions 3 - 8)

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 @@ -25,7 +25,7 @@ type Response = restify_5.Response;
type Next = restify_5.Next;
type CreateServerFn = (options?: restify_5.ServerOptions) => restify_5.Server;

const SUPPORTED_VERSIONS = '<=7.x';
const SUPPORTED_VERSIONS = '<=8.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 @@ -238,5 +238,10 @@
"dependencies": {
"restify": "^7.2.2"
}
},
"restify8": {
"dependencies": {
"restify": "^8.5.1"
}
}
}
2 changes: 2 additions & 0 deletions test/test-trace-web-frameworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {
Restify5,
Restify6,
Restify7,
Restify8,
} from './web-frameworks/restify';

// The type of a stack trace object after being parsed from a trace span's stack
Expand Down Expand Up @@ -68,6 +69,7 @@ const FRAMEWORKS: WebFrameworkConstructor[] = [
Restify5,
Restify6,
Restify7,
Restify8,
];

/**
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 @@ -91,4 +91,5 @@ export const Restify4 = makeRestifyClass(4);
export const Restify5 = makeRestifyClass(5);
export const Restify6 = makeRestifyClass(6);
export const Restify7 = makeRestifyClass(7);
export const Restify8 = makeRestifyClass(8);
// tslint:enable:variable-name

0 comments on commit f52fa4d

Please sign in to comment.