Skip to content

Commit de287f1

Browse files
committed
Revert "feat: limit /metrics to local networks using plugins"
This reverts commit 6057846.
1 parent 6057846 commit de287f1

File tree

4 files changed

+8
-77
lines changed

4 files changed

+8
-77
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"fastify-cli": "7.4.1",
4040
"fastify-metrics": "^12.1.0",
4141
"fastify-plugin": "^5.1.0",
42-
"ipaddr.js": "^2.3.0",
4342
"jsonwebtoken": "^9.0.2",
4443
"jwks-rsa": "^3.2.0",
4544
"openid-client": "^6.8.1",

src/app.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
RawRequestDefaultExpression,
1212
RawServerDefault,
1313
} from "fastify";
14+
import fastifyMetrics from "fastify-metrics";
1415
import * as path from "path";
1516
import { fileURLToPath } from "url";
1617

@@ -68,7 +69,7 @@ if (options.lokiHost) {
6869
target: "pino-loki",
6970
options: {
7071
batching: true,
71-
interval: 5, // Every 5 seconds, default.
72+
interval: 5,
7273
host: options.lokiHost,
7374
labels: { application: packageJson.name },
7475
},
@@ -100,6 +101,12 @@ const app: FastifyPluginAsync<AppOptions> = async (
100101
origin: "*",
101102
});
102103

104+
// Register Metrics
105+
await fastify.register(fastifyMetrics.default, {
106+
endpoint: "/metrics",
107+
defaultMetrics: { enabled: true },
108+
});
109+
103110
// Register Swagger & Swagger UI & Scalar
104111
await fastify.register(import("@fastify/swagger"), {
105112
openapi: {

src/plugins/metrics.ts

Lines changed: 0 additions & 67 deletions
This file was deleted.

yarn.lock

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2500,13 +2500,6 @@ __metadata:
25002500
languageName: node
25012501
linkType: hard
25022502

2503-
"ipaddr.js@npm:^2.3.0":
2504-
version: 2.3.0
2505-
resolution: "ipaddr.js@npm:2.3.0"
2506-
checksum: 10c0/084bab99e2f6875d7a62adc3325e1c64b038a12c9521e35fb967b5e263a8b3afb1b8884dd77c276092331f5d63298b767491e10997ef147c62da01b143780bbd
2507-
languageName: node
2508-
linkType: hard
2509-
25102503
"is-arrayish@npm:^0.2.1":
25112504
version: 0.2.1
25122505
resolution: "is-arrayish@npm:0.2.1"
@@ -4273,7 +4266,6 @@ __metadata:
42734266
fastify-tsconfig: "npm:^3.0.0"
42744267
globals: "npm:^16.5.0"
42754268
husky: "npm:^9.1.7"
4276-
ipaddr.js: "npm:^2.3.0"
42774269
jsonwebtoken: "npm:^9.0.2"
42784270
jwks-rsa: "npm:^3.2.0"
42794271
openid-client: "npm:^6.8.1"

0 commit comments

Comments
 (0)