Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Commit 4b74f5a

Browse files
authored
feat: support restify@7 (#917)
1 parent c66e9c3 commit 4b74f5a

5 files changed

Lines changed: 10 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The trace agent can do automatic tracing of the following web frameworks:
5959
* [gRPC](https://www.npmjs.com/package/grpc) server (version ^1.1)
6060
* [hapi](https://www.npmjs.com/package/hapi) (versions 8 - 16)
6161
* [koa](https://www.npmjs.com/package/koa) (version 1)
62-
* [restify](https://www.npmjs.com/package/restify) (versions 3 - 6)
62+
* [restify](https://www.npmjs.com/package/restify) (versions 3 - 7)
6363

6464
The agent will also automatically trace RPCs from the following modules:
6565
* Outbound HTTP requests through `http`, `https`, and `http2` core modules

src/plugins/plugin-restify.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type Response = restify_5.Response;
2828
type Next = restify_5.Next;
2929
type CreateServerFn = (options?: restify_5.ServerOptions) => restify_5.Server;
3030

31-
const SUPPORTED_VERSIONS = '<=6.x';
31+
const SUPPORTED_VERSIONS = '<=7.x';
3232

3333
function unpatchRestify(restify: Restify5) {
3434
shimmer.unwrap(restify, 'createServer');

test/fixtures/plugin-fixtures.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,5 +203,10 @@
203203
"dependencies": {
204204
"restify": "^6.0.1"
205205
}
206+
},
207+
"restify7": {
208+
"dependencies": {
209+
"restify": "^7.2.2"
210+
}
206211
}
207212
}

test/test-trace-web-frameworks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {Hapi17} from './web-frameworks/hapi17';
3333
import {Hapi12, Hapi15, Hapi16, Hapi8} from './web-frameworks/hapi8_16';
3434
import {Koa1} from './web-frameworks/koa1';
3535
import {Koa2} from './web-frameworks/koa2';
36-
import {Restify3, Restify4, Restify5, Restify6} from './web-frameworks/restify';
36+
import {Restify3, Restify4, Restify5, Restify6, Restify7} from './web-frameworks/restify';
3737

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

5252
/**

test/web-frameworks/restify.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,5 @@ export const Restify3 = makeRestifyClass(3, '<7');
8585
export const Restify4 = makeRestifyClass(4);
8686
export const Restify5 = makeRestifyClass(5);
8787
export const Restify6 = makeRestifyClass(6);
88+
export const Restify7 = makeRestifyClass(7);
8889
// tslint:enable:variable-name

0 commit comments

Comments
 (0)