Skip to content

Commit 39fb600

Browse files
committed
chore: clean-up imports and usage
1 parent 816d98d commit 39fb600

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/app.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@ import {
1111
RawRequestDefaultExpression,
1212
RawServerDefault,
1313
} from "fastify";
14-
import { createRequire } from "module";
14+
import fastifyMetrics from "fastify-metrics";
1515
import * as path from "path";
1616
import { fileURLToPath } from "url";
1717

18-
const require = createRequire(import.meta.url);
19-
const fastifyMetrics = require("fastify-metrics");
20-
2118
const __filename = fileURLToPath(import.meta.url);
2219
const __dirname = path.dirname(__filename);
2320

@@ -74,7 +71,7 @@ if (options.lokiHost) {
7471
batching: true,
7572
interval: 5,
7673
host: options.lokiHost,
77-
labels: { application: "template-service" },
74+
labels: { application: packageJson.name },
7875
},
7976
},
8077
};
@@ -105,7 +102,7 @@ const app: FastifyPluginAsync<AppOptions> = async (
105102
});
106103

107104
// Register Metrics
108-
await fastify.register(fastifyMetrics, {
105+
await fastify.register(fastifyMetrics.default, {
109106
endpoint: "/metrics",
110107
defaultMetrics: { enabled: true },
111108
});

0 commit comments

Comments
 (0)